
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -8e+83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 110000000.0)
(fma
(/ F (sin B))
(pow (fma x 2.0 (fma F F 2.0)) -0.5)
(/ x (- (tan B))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -8e+83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 110000000.0) {
tmp = fma((F / sin(B)), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (x / -tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -8e+83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 110000000.0) tmp = fma(Float64(F / sin(B)), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(x / Float64(-tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] + N[(x / (-N[Tan[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 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{x}{-\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8.00000000000000025e83Initial program 48.4%
Taylor expanded in F around -inf 99.7%
if -8.00000000000000025e83 < F < 1.1e8Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
if 1.1e8 < F Initial program 52.4%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -4.45e+151)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 125000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) (/ x (tan B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -4.45e+151) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 125000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -4.45e+151) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 125000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.45e+151], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 125000000.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] - N[(x / N[Tan[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 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -4.45 \cdot 10^{+151}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 125000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.4500000000000003e151Initial program 37.7%
Taylor expanded in F around -inf 99.7%
if -4.4500000000000003e151 < F < 1.25e8Initial program 97.4%
distribute-lft-neg-in97.4%
+-commutative97.4%
associate-*l/99.6%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.6%
if 1.25e8 < F Initial program 52.4%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -8e+97)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 110000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -8e+97) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 110000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * (1.0d0 / tan(b))
if (f <= (-8d+97)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 110000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (1.0 / Math.tan(B));
double tmp;
if (F <= -8e+97) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 110000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -8e+97: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 110000000.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -8e+97) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 110000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -8e+97) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 110000000.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+97], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+97}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8.0000000000000006e97Initial program 46.8%
Taylor expanded in F around -inf 99.7%
if -8.0000000000000006e97 < F < 1.1e8Initial program 99.5%
if 1.1e8 < F Initial program 52.4%
Taylor expanded in F around inf 99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -7.6e+83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 15000000.0)
(+
(/ -1.0 (/ (tan B) x))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -7.6e+83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 15000000.0) {
tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * (1.0d0 / tan(b))
if (f <= (-7.6d+83)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 15000000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (1.0 / Math.tan(B));
double tmp;
if (F <= -7.6e+83) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 15000000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -7.6e+83: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 15000000.0: tmp = (-1.0 / (math.tan(B) / x)) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -7.6e+83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 15000000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -7.6e+83) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 15000000.0) tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.6e+83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 15000000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -7.6 \cdot 10^{+83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 15000000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7.6000000000000004e83Initial program 48.4%
Taylor expanded in F around -inf 99.7%
if -7.6000000000000004e83 < F < 1.5e7Initial program 99.5%
div-inv99.7%
clear-num99.6%
Applied egg-rr99.6%
if 1.5e7 < F Initial program 52.4%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (* x (/ 1.0 (tan B)))))
(if (<= F -1.55)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.46)
(- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) (/ x (tan B)))
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x * (1.0 / tan(B));
double tmp;
if (F <= -1.55) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.46) {
tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / tan(B));
} else {
tmp = t_0 - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 / sin(b)
t_1 = x * (1.0d0 / tan(b))
if (f <= (-1.55d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.46d0) then
tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - (x / tan(b))
else
tmp = t_0 - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x * (1.0 / Math.tan(B));
double tmp;
if (F <= -1.55) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.46) {
tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / Math.tan(B));
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -1.55: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.46: tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / math.tan(B)) else: tmp = t_0 - t_1 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -1.55) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.46) tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - Float64(x / tan(B))); else tmp = Float64(t_0 - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -1.55) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.46) tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - (x / tan(B)); else tmp = t_0 - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.55], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.46], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.55:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.46:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -1.55000000000000004Initial program 58.1%
Taylor expanded in F around -inf 99.7%
if -1.55000000000000004 < F < 1.46Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
associate-*l/99.5%
associate-/l*99.4%
fma-define99.4%
/-rgt-identity99.4%
remove-double-neg99.4%
fma-neg99.4%
Simplified99.6%
Taylor expanded in F around 0 99.1%
if 1.46 < F Initial program 53.7%
Taylor expanded in F around inf 99.3%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(+ (* x (/ -1.0 (tan B))) (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt((2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * (1.0d0 / tan(b))
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = (x * ((-1.0d0) / tan(b))) + (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0)))))
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 * (1.0 / Math.tan(B));
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (x * (-1.0 / Math.tan(B))) + (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = (x * (-1.0 / math.tan(B))) + (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0)))))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt((2.0 + (x * 2.0))))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 58.1%
Taylor expanded in F around -inf 99.7%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.5%
associate-*l/99.5%
+-commutative99.5%
*-commutative99.5%
fma-undefine99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.4%
clear-num99.4%
un-div-inv99.5%
fma-define99.5%
fma-undefine99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 99.0%
if 1.44999999999999996 < F Initial program 53.7%
Taylor expanded in F around inf 99.3%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -0.205)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 9.6e-116)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) (/ x (tan B)))
(if (<= F 155000.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -0.205) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 9.6e-116) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / tan(B));
} else if (F <= 155000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / 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 * (1.0d0 / tan(b))
if (f <= (-0.205d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 9.6d-116) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - (x / tan(b))
else if (f <= 155000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / 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 * (1.0 / Math.tan(B));
double tmp;
if (F <= -0.205) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 9.6e-116) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / Math.tan(B));
} else if (F <= 155000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -0.205: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 9.6e-116: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / math.tan(B)) elif F <= 155000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -0.205) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 9.6e-116) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - Float64(x / tan(B))); elseif (F <= 155000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / 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 * (1.0 / tan(B)); tmp = 0.0; if (F <= -0.205) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 9.6e-116) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / tan(B)); elseif (F <= 155000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / 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[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.205], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9.6e-116], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 155000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -0.205:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 9.6 \cdot 10^{-116}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 155000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.204999999999999988Initial program 58.1%
Taylor expanded in F around -inf 99.7%
if -0.204999999999999988 < F < 9.59999999999999972e-116Initial program 99.6%
distribute-lft-neg-in99.6%
+-commutative99.6%
associate-*l/99.6%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.6%
Taylor expanded in B around 0 87.1%
Taylor expanded in F around 0 87.1%
if 9.59999999999999972e-116 < F < 155000Initial program 99.3%
Taylor expanded in B around 0 88.5%
if 155000 < F Initial program 52.4%
Taylor expanded in F around inf 99.7%
Final simplification94.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -0.37)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.34)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) (/ x (tan B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -0.37) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.34) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * (1.0d0 / tan(b))
if (f <= (-0.37d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.34d0) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - (x / tan(b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (1.0 / Math.tan(B));
double tmp;
if (F <= -0.37) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.34) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / Math.tan(B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -0.37: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.34: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / math.tan(B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -0.37) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.34) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -0.37) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.34) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / tan(B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.34], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[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 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -0.37:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.34:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.37Initial program 58.1%
Taylor expanded in F around -inf 99.7%
if -0.37 < F < 0.340000000000000024Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
associate-*l/99.5%
associate-/l*99.4%
fma-define99.4%
/-rgt-identity99.4%
remove-double-neg99.4%
fma-neg99.4%
Simplified99.6%
Taylor expanded in B around 0 82.7%
Taylor expanded in F around 0 82.2%
if 0.340000000000000024 < F Initial program 53.7%
Taylor expanded in F around inf 99.3%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -3.4e-10)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -4.5e-100)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 1.3e-33) (/ x (- (tan B))) (- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -3.4e-10) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -4.5e-100) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 1.3e-33) {
tmp = x / -tan(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * (1.0d0 / tan(b))
if (f <= (-3.4d-10)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-4.5d-100)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 1.3d-33) then
tmp = x / -tan(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (1.0 / Math.tan(B));
double tmp;
if (F <= -3.4e-10) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -4.5e-100) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 1.3e-33) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -3.4e-10: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -4.5e-100: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 1.3e-33: tmp = x / -math.tan(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -3.4e-10) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -4.5e-100) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 1.3e-33) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -3.4e-10) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -4.5e-100) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 1.3e-33) tmp = x / -tan(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.4e-10], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -4.5e-100], 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], If[LessEqual[F, 1.3e-33], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -3.4 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -4.5 \cdot 10^{-100}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-33}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.40000000000000015e-10Initial program 59.1%
Taylor expanded in F around -inf 99.8%
if -3.40000000000000015e-10 < F < -4.5000000000000001e-100Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
fma-define99.4%
+-commutative99.4%
*-commutative99.4%
fma-define99.4%
fma-define99.4%
metadata-eval99.4%
metadata-eval99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Taylor expanded in B around 0 70.4%
Taylor expanded in F around 0 70.4%
if -4.5000000000000001e-100 < F < 1.29999999999999997e-33Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in F around 0 75.4%
mul-1-neg75.4%
associate-/l*75.2%
Simplified75.2%
clear-num75.1%
un-div-inv75.3%
quot-tan75.5%
Applied egg-rr75.5%
if 1.29999999999999997e-33 < F Initial program 59.3%
Taylor expanded in F around inf 90.5%
Final simplification87.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
(if (<= F -1.9e-9)
(- (/ -1.0 (sin B)) (* x (/ 1.0 (tan B))))
(if (<= F -5e-88)
(/ (- (* F t_0) x) B)
(if (<= F 2.8e-101)
(/ x (- (tan B)))
(if (<= F 32500.0)
(- (* t_0 (/ F B)) (/ x B))
(if (or (<= F 3.1e+213) (not (<= F 8.4e+273)))
(- (* F (/ 1.0 (* F B))) (/ x (tan B)))
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B)))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double tmp;
if (F <= -1.9e-9) {
tmp = (-1.0 / sin(B)) - (x * (1.0 / tan(B)));
} else if (F <= -5e-88) {
tmp = ((F * t_0) - x) / B;
} else if (F <= 2.8e-101) {
tmp = x / -tan(B);
} else if (F <= 32500.0) {
tmp = (t_0 * (F / B)) - (x / B);
} else if ((F <= 3.1e+213) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - (x / tan(B));
} else {
tmp = ((F / sin(B)) * (1.0 / F)) - (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 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
if (f <= (-1.9d-9)) then
tmp = ((-1.0d0) / sin(b)) - (x * (1.0d0 / tan(b)))
else if (f <= (-5d-88)) then
tmp = ((f * t_0) - x) / b
else if (f <= 2.8d-101) then
tmp = x / -tan(b)
else if (f <= 32500.0d0) then
tmp = (t_0 * (f / b)) - (x / b)
else if ((f <= 3.1d+213) .or. (.not. (f <= 8.4d+273))) then
tmp = (f * (1.0d0 / (f * b))) - (x / tan(b))
else
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double tmp;
if (F <= -1.9e-9) {
tmp = (-1.0 / Math.sin(B)) - (x * (1.0 / Math.tan(B)));
} else if (F <= -5e-88) {
tmp = ((F * t_0) - x) / B;
} else if (F <= 2.8e-101) {
tmp = x / -Math.tan(B);
} else if (F <= 32500.0) {
tmp = (t_0 * (F / B)) - (x / B);
} else if ((F <= 3.1e+213) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - (x / Math.tan(B));
} else {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) tmp = 0 if F <= -1.9e-9: tmp = (-1.0 / math.sin(B)) - (x * (1.0 / math.tan(B))) elif F <= -5e-88: tmp = ((F * t_0) - x) / B elif F <= 2.8e-101: tmp = x / -math.tan(B) elif F <= 32500.0: tmp = (t_0 * (F / B)) - (x / B) elif (F <= 3.1e+213) or not (F <= 8.4e+273): tmp = (F * (1.0 / (F * B))) - (x / math.tan(B)) else: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) tmp = 0.0 if (F <= -1.9e-9) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= -5e-88) tmp = Float64(Float64(Float64(F * t_0) - x) / B); elseif (F <= 2.8e-101) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 32500.0) tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x / B)); elseif ((F <= 3.1e+213) || !(F <= 8.4e+273)) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); tmp = 0.0; if (F <= -1.9e-9) tmp = (-1.0 / sin(B)) - (x * (1.0 / tan(B))); elseif (F <= -5e-88) tmp = ((F * t_0) - x) / B; elseif (F <= 2.8e-101) tmp = x / -tan(B); elseif (F <= 32500.0) tmp = (t_0 * (F / B)) - (x / B); elseif ((F <= 3.1e+213) || ~((F <= 8.4e+273))) tmp = (F * (1.0 / (F * B))) - (x / tan(B)); else tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -1.9e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5e-88], N[(N[(N[(F * t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.8e-101], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 32500.0], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3.1e+213], N[Not[LessEqual[F, 8.4e+273]], $MachinePrecision]], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{if}\;F \leq -1.9 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq -5 \cdot 10^{-88}:\\
\;\;\;\;\frac{F \cdot t\_0 - x}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 32500:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{+213} \lor \neg \left(F \leq 8.4 \cdot 10^{+273}\right):\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.90000000000000006e-9Initial program 59.1%
Taylor expanded in F around -inf 99.8%
if -1.90000000000000006e-9 < F < -5.00000000000000009e-88Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
fma-define99.4%
+-commutative99.4%
*-commutative99.4%
fma-define99.4%
fma-define99.4%
metadata-eval99.4%
metadata-eval99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Taylor expanded in B around 0 70.4%
Taylor expanded in F around 0 70.4%
if -5.00000000000000009e-88 < F < 2.79999999999999989e-101Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in F around 0 78.8%
mul-1-neg78.8%
associate-/l*78.7%
Simplified78.7%
clear-num78.6%
un-div-inv78.7%
quot-tan78.9%
Applied egg-rr78.9%
if 2.79999999999999989e-101 < F < 32500Initial program 99.3%
distribute-lft-neg-in99.3%
+-commutative99.3%
fma-define99.3%
+-commutative99.3%
*-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Taylor expanded in B around 0 60.2%
Taylor expanded in F around 0 57.9%
if 32500 < F < 3.09999999999999991e213 or 8.40000000000000007e273 < F Initial program 61.4%
distribute-lft-neg-in61.4%
+-commutative61.4%
associate-*l/82.1%
associate-/l*82.0%
fma-define82.0%
/-rgt-identity82.0%
remove-double-neg82.0%
fma-neg82.0%
Simplified82.1%
Taylor expanded in B around 0 74.1%
Taylor expanded in F around inf 82.9%
if 3.09999999999999991e213 < F < 8.40000000000000007e273Initial program 16.6%
Taylor expanded in F around inf 92.8%
Taylor expanded in B around 0 85.4%
Final simplification84.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B))
(t_1 (/ x (tan B))))
(if (<= F -2.9e-8)
(- (/ -1.0 B) t_1)
(if (<= F -5.8e-86)
t_0
(if (<= F 4.5e-99)
(/ x (- (tan B)))
(if (<= F 32500.0)
t_0
(if (or (<= F 3.3e+213) (not (<= F 8.4e+273)))
(- (* F (/ 1.0 (* F B))) t_1)
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double t_1 = x / tan(B);
double tmp;
if (F <= -2.9e-8) {
tmp = (-1.0 / B) - t_1;
} else if (F <= -5.8e-86) {
tmp = t_0;
} else if (F <= 4.5e-99) {
tmp = x / -tan(B);
} else if (F <= 32500.0) {
tmp = t_0;
} else if ((F <= 3.3e+213) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - t_1;
} else {
tmp = ((F / sin(B)) * (1.0 / F)) - (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 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
t_1 = x / tan(b)
if (f <= (-2.9d-8)) then
tmp = ((-1.0d0) / b) - t_1
else if (f <= (-5.8d-86)) then
tmp = t_0
else if (f <= 4.5d-99) then
tmp = x / -tan(b)
else if (f <= 32500.0d0) then
tmp = t_0
else if ((f <= 3.3d+213) .or. (.not. (f <= 8.4d+273))) then
tmp = (f * (1.0d0 / (f * b))) - t_1
else
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -2.9e-8) {
tmp = (-1.0 / B) - t_1;
} else if (F <= -5.8e-86) {
tmp = t_0;
} else if (F <= 4.5e-99) {
tmp = x / -Math.tan(B);
} else if (F <= 32500.0) {
tmp = t_0;
} else if ((F <= 3.3e+213) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - t_1;
} else {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B t_1 = x / math.tan(B) tmp = 0 if F <= -2.9e-8: tmp = (-1.0 / B) - t_1 elif F <= -5.8e-86: tmp = t_0 elif F <= 4.5e-99: tmp = x / -math.tan(B) elif F <= 32500.0: tmp = t_0 elif (F <= 3.3e+213) or not (F <= 8.4e+273): tmp = (F * (1.0 / (F * B))) - t_1 else: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.9e-8) tmp = Float64(Float64(-1.0 / B) - t_1); elseif (F <= -5.8e-86) tmp = t_0; elseif (F <= 4.5e-99) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 32500.0) tmp = t_0; elseif ((F <= 3.3e+213) || !(F <= 8.4e+273)) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_1); else tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; t_1 = x / tan(B); tmp = 0.0; if (F <= -2.9e-8) tmp = (-1.0 / B) - t_1; elseif (F <= -5.8e-86) tmp = t_0; elseif (F <= 4.5e-99) tmp = x / -tan(B); elseif (F <= 32500.0) tmp = t_0; elseif ((F <= 3.3e+213) || ~((F <= 8.4e+273))) tmp = (F * (1.0 / (F * B))) - t_1; else tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.9e-8], N[(N[(-1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -5.8e-86], t$95$0, If[LessEqual[F, 4.5e-99], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 32500.0], t$95$0, If[Or[LessEqual[F, 3.3e+213], N[Not[LessEqual[F, 8.4e+273]], $MachinePrecision]], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{-8}:\\
\;\;\;\;\frac{-1}{B} - t\_1\\
\mathbf{elif}\;F \leq -5.8 \cdot 10^{-86}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-99}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 32500:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 3.3 \cdot 10^{+213} \lor \neg \left(F \leq 8.4 \cdot 10^{+273}\right):\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -2.9000000000000002e-8Initial program 59.1%
distribute-lft-neg-in59.1%
+-commutative59.1%
associate-*l/74.0%
associate-/l*73.9%
fma-define73.9%
/-rgt-identity73.9%
remove-double-neg73.9%
fma-neg73.9%
Simplified74.0%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 74.0%
if -2.9000000000000002e-8 < F < -5.7999999999999998e-86 or 4.5000000000000003e-99 < F < 32500Initial program 99.3%
distribute-lft-neg-in99.3%
+-commutative99.3%
fma-define99.3%
+-commutative99.3%
*-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Taylor expanded in B around 0 64.0%
Taylor expanded in F around 0 62.5%
if -5.7999999999999998e-86 < F < 4.5000000000000003e-99Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in F around 0 78.8%
mul-1-neg78.8%
associate-/l*78.7%
Simplified78.7%
clear-num78.6%
un-div-inv78.7%
quot-tan78.9%
Applied egg-rr78.9%
if 32500 < F < 3.3000000000000001e213 or 8.40000000000000007e273 < F Initial program 61.4%
distribute-lft-neg-in61.4%
+-commutative61.4%
associate-*l/82.1%
associate-/l*82.0%
fma-define82.0%
/-rgt-identity82.0%
remove-double-neg82.0%
fma-neg82.0%
Simplified82.1%
Taylor expanded in B around 0 74.1%
Taylor expanded in F around inf 82.9%
if 3.3000000000000001e213 < F < 8.40000000000000007e273Initial program 16.6%
Taylor expanded in F around inf 92.8%
Taylor expanded in B around 0 85.4%
Final simplification76.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (t_1 (/ x (tan B))))
(if (<= F -3.9e-11)
(- (/ -1.0 B) t_1)
(if (<= F -1.7e-100)
(/ (- (* F t_0) x) B)
(if (<= F 2.8e-101)
(/ x (- (tan B)))
(if (<= F 32500.0)
(- (* t_0 (/ F B)) (/ x B))
(if (or (<= F 1.5e+211) (not (<= F 8.4e+273)))
(- (* F (/ 1.0 (* F B))) t_1)
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B)))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / tan(B);
double tmp;
if (F <= -3.9e-11) {
tmp = (-1.0 / B) - t_1;
} else if (F <= -1.7e-100) {
tmp = ((F * t_0) - x) / B;
} else if (F <= 2.8e-101) {
tmp = x / -tan(B);
} else if (F <= 32500.0) {
tmp = (t_0 * (F / B)) - (x / B);
} else if ((F <= 1.5e+211) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - t_1;
} else {
tmp = ((F / sin(B)) * (1.0 / F)) - (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 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = x / tan(b)
if (f <= (-3.9d-11)) then
tmp = ((-1.0d0) / b) - t_1
else if (f <= (-1.7d-100)) then
tmp = ((f * t_0) - x) / b
else if (f <= 2.8d-101) then
tmp = x / -tan(b)
else if (f <= 32500.0d0) then
tmp = (t_0 * (f / b)) - (x / b)
else if ((f <= 1.5d+211) .or. (.not. (f <= 8.4d+273))) then
tmp = (f * (1.0d0 / (f * b))) - t_1
else
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -3.9e-11) {
tmp = (-1.0 / B) - t_1;
} else if (F <= -1.7e-100) {
tmp = ((F * t_0) - x) / B;
} else if (F <= 2.8e-101) {
tmp = x / -Math.tan(B);
} else if (F <= 32500.0) {
tmp = (t_0 * (F / B)) - (x / B);
} else if ((F <= 1.5e+211) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - t_1;
} else {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = x / math.tan(B) tmp = 0 if F <= -3.9e-11: tmp = (-1.0 / B) - t_1 elif F <= -1.7e-100: tmp = ((F * t_0) - x) / B elif F <= 2.8e-101: tmp = x / -math.tan(B) elif F <= 32500.0: tmp = (t_0 * (F / B)) - (x / B) elif (F <= 1.5e+211) or not (F <= 8.4e+273): tmp = (F * (1.0 / (F * B))) - t_1 else: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.9e-11) tmp = Float64(Float64(-1.0 / B) - t_1); elseif (F <= -1.7e-100) tmp = Float64(Float64(Float64(F * t_0) - x) / B); elseif (F <= 2.8e-101) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 32500.0) tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x / B)); elseif ((F <= 1.5e+211) || !(F <= 8.4e+273)) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_1); else tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = x / tan(B); tmp = 0.0; if (F <= -3.9e-11) tmp = (-1.0 / B) - t_1; elseif (F <= -1.7e-100) tmp = ((F * t_0) - x) / B; elseif (F <= 2.8e-101) tmp = x / -tan(B); elseif (F <= 32500.0) tmp = (t_0 * (F / B)) - (x / B); elseif ((F <= 1.5e+211) || ~((F <= 8.4e+273))) tmp = (F * (1.0 / (F * B))) - t_1; else tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.9e-11], N[(N[(-1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.7e-100], N[(N[(N[(F * t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.8e-101], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 32500.0], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.5e+211], N[Not[LessEqual[F, 8.4e+273]], $MachinePrecision]], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.9 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{B} - t\_1\\
\mathbf{elif}\;F \leq -1.7 \cdot 10^{-100}:\\
\;\;\;\;\frac{F \cdot t\_0 - x}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 32500:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+211} \lor \neg \left(F \leq 8.4 \cdot 10^{+273}\right):\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.9000000000000001e-11Initial program 59.1%
distribute-lft-neg-in59.1%
+-commutative59.1%
associate-*l/74.0%
associate-/l*73.9%
fma-define73.9%
/-rgt-identity73.9%
remove-double-neg73.9%
fma-neg73.9%
Simplified74.0%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 74.0%
if -3.9000000000000001e-11 < F < -1.69999999999999988e-100Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
fma-define99.4%
+-commutative99.4%
*-commutative99.4%
fma-define99.4%
fma-define99.4%
metadata-eval99.4%
metadata-eval99.4%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Taylor expanded in B around 0 70.4%
Taylor expanded in F around 0 70.4%
if -1.69999999999999988e-100 < F < 2.79999999999999989e-101Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in F around 0 78.8%
mul-1-neg78.8%
associate-/l*78.7%
Simplified78.7%
clear-num78.6%
un-div-inv78.7%
quot-tan78.9%
Applied egg-rr78.9%
if 2.79999999999999989e-101 < F < 32500Initial program 99.3%
distribute-lft-neg-in99.3%
+-commutative99.3%
fma-define99.3%
+-commutative99.3%
*-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
associate-*r/99.4%
*-rgt-identity99.4%
Simplified99.4%
Taylor expanded in B around 0 60.2%
Taylor expanded in F around 0 57.9%
if 32500 < F < 1.5e211 or 8.40000000000000007e273 < F Initial program 61.4%
distribute-lft-neg-in61.4%
+-commutative61.4%
associate-*l/82.1%
associate-/l*82.0%
fma-define82.0%
/-rgt-identity82.0%
remove-double-neg82.0%
fma-neg82.0%
Simplified82.1%
Taylor expanded in B around 0 74.1%
Taylor expanded in F around inf 82.9%
if 1.5e211 < F < 8.40000000000000007e273Initial program 16.6%
Taylor expanded in F around inf 92.8%
Taylor expanded in B around 0 85.4%
Final simplification76.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4.2e-50)
(- (/ -1.0 B) t_0)
(if (<= F 2.25e-32)
(/ x (- (tan B)))
(if (or (<= F 3.3e+213) (not (<= F 8.4e+273)))
(- (* F (/ 1.0 (* F B))) t_0)
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4.2e-50) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2.25e-32) {
tmp = x / -tan(B);
} else if ((F <= 3.3e+213) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - t_0;
} else {
tmp = ((F / sin(B)) * (1.0 / F)) - (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 <= (-4.2d-50)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 2.25d-32) then
tmp = x / -tan(b)
else if ((f <= 3.3d+213) .or. (.not. (f <= 8.4d+273))) then
tmp = (f * (1.0d0 / (f * b))) - t_0
else
tmp = ((f / sin(b)) * (1.0d0 / f)) - (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 <= -4.2e-50) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2.25e-32) {
tmp = x / -Math.tan(B);
} else if ((F <= 3.3e+213) || !(F <= 8.4e+273)) {
tmp = (F * (1.0 / (F * B))) - t_0;
} else {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -4.2e-50: tmp = (-1.0 / B) - t_0 elif F <= 2.25e-32: tmp = x / -math.tan(B) elif (F <= 3.3e+213) or not (F <= 8.4e+273): tmp = (F * (1.0 / (F * B))) - t_0 else: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4.2e-50) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 2.25e-32) tmp = Float64(x / Float64(-tan(B))); elseif ((F <= 3.3e+213) || !(F <= 8.4e+273)) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_0); else tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -4.2e-50) tmp = (-1.0 / B) - t_0; elseif (F <= 2.25e-32) tmp = x / -tan(B); elseif ((F <= 3.3e+213) || ~((F <= 8.4e+273))) tmp = (F * (1.0 / (F * B))) - t_0; else tmp = ((F / sin(B)) * (1.0 / F)) - (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, -4.2e-50], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.25e-32], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 3.3e+213], N[Not[LessEqual[F, 8.4e+273]], $MachinePrecision]], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 2.25 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 3.3 \cdot 10^{+213} \lor \neg \left(F \leq 8.4 \cdot 10^{+273}\right):\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.2000000000000002e-50Initial program 63.1%
distribute-lft-neg-in63.1%
+-commutative63.1%
associate-*l/76.5%
associate-/l*76.4%
fma-define76.4%
/-rgt-identity76.4%
remove-double-neg76.4%
fma-neg76.4%
Simplified76.5%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 69.4%
if -4.2000000000000002e-50 < F < 2.25000000000000002e-32Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.7%
mul-1-neg72.7%
associate-/l*72.6%
Simplified72.6%
clear-num72.4%
un-div-inv72.7%
quot-tan72.8%
Applied egg-rr72.8%
if 2.25000000000000002e-32 < F < 3.3000000000000001e213 or 8.40000000000000007e273 < F Initial program 66.1%
distribute-lft-neg-in66.1%
+-commutative66.1%
associate-*l/84.3%
associate-/l*84.1%
fma-define84.1%
/-rgt-identity84.1%
remove-double-neg84.1%
fma-neg84.1%
Simplified84.2%
Taylor expanded in B around 0 71.2%
Taylor expanded in F around inf 74.8%
if 3.3000000000000001e213 < F < 8.40000000000000007e273Initial program 16.6%
Taylor expanded in F around inf 92.8%
Taylor expanded in B around 0 85.4%
Final simplification72.8%
(FPCore (F B x) :precision binary64 (if (<= F -6.2e-50) (- (/ -1.0 B) (/ x (tan B))) (if (<= F 2.25e-32) (/ x (- (tan B))) (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-50) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 2.25e-32) {
tmp = x / -tan(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / 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 <= (-6.2d-50)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 2.25d-32) then
tmp = x / -tan(b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-50) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 2.25e-32) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e-50: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 2.25e-32: tmp = x / -math.tan(B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e-50) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 2.25e-32) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.2e-50) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 2.25e-32) tmp = x / -tan(B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e-50], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.25e-32], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.2 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.25 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -6.2000000000000004e-50Initial program 63.1%
distribute-lft-neg-in63.1%
+-commutative63.1%
associate-*l/76.5%
associate-/l*76.4%
fma-define76.4%
/-rgt-identity76.4%
remove-double-neg76.4%
fma-neg76.4%
Simplified76.5%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 69.4%
if -6.2000000000000004e-50 < F < 2.25000000000000002e-32Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.7%
mul-1-neg72.7%
associate-/l*72.6%
Simplified72.6%
clear-num72.4%
un-div-inv72.7%
quot-tan72.8%
Applied egg-rr72.8%
if 2.25000000000000002e-32 < F Initial program 57.2%
Taylor expanded in F around inf 73.8%
Taylor expanded in B around 0 69.4%
Final simplification70.5%
(FPCore (F B x) :precision binary64 (if (<= F -3.4e+74) (+ (* 0.3333333333333333 (* x B)) (/ (- -1.0 x) B)) (if (<= F 2.6e-32) (/ x (- (tan B))) (- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e+74) {
tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B);
} else if (F <= 2.6e-32) {
tmp = x / -tan(B);
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.4d+74)) then
tmp = (0.3333333333333333d0 * (x * b)) + (((-1.0d0) - x) / b)
else if (f <= 2.6d-32) then
tmp = x / -tan(b)
else
tmp = (1.0d0 / b) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e+74) {
tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B);
} else if (F <= 2.6e-32) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.4e+74: tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B) elif F <= 2.6e-32: tmp = x / -math.tan(B) else: tmp = (1.0 / B) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.4e+74) tmp = Float64(Float64(0.3333333333333333 * Float64(x * B)) + Float64(Float64(-1.0 - x) / B)); elseif (F <= 2.6e-32) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.4e+74) tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B); elseif (F <= 2.6e-32) tmp = x / -tan(B); else tmp = (1.0 / B) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.4e+74], N[(N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.6e-32], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.4 \cdot 10^{+74}:\\
\;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.3999999999999999e74Initial program 50.7%
distribute-lft-neg-in50.7%
+-commutative50.7%
associate-*l/68.6%
associate-/l*68.6%
fma-define68.6%
/-rgt-identity68.6%
remove-double-neg68.6%
fma-neg68.6%
Simplified68.7%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 78.6%
*-commutative78.6%
Simplified78.6%
Taylor expanded in B around 0 59.3%
+-commutative59.3%
mul-1-neg59.3%
unsub-neg59.3%
+-commutative59.3%
Simplified59.3%
if -3.3999999999999999e74 < F < 2.5999999999999997e-32Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 66.0%
mul-1-neg66.0%
associate-/l*66.0%
Simplified66.0%
clear-num65.8%
un-div-inv66.0%
quot-tan66.1%
Applied egg-rr66.1%
if 2.5999999999999997e-32 < F Initial program 57.2%
distribute-lft-neg-in57.2%
+-commutative57.2%
fma-define57.2%
+-commutative57.2%
*-commutative57.2%
fma-define57.2%
fma-define57.2%
metadata-eval57.2%
metadata-eval57.2%
associate-*r/57.3%
*-rgt-identity57.3%
Simplified57.3%
Taylor expanded in B around 0 43.8%
Taylor expanded in F around inf 50.4%
mul-1-neg50.4%
unsub-neg50.4%
Simplified50.4%
Taylor expanded in x around 0 50.5%
+-commutative50.5%
neg-mul-150.5%
sub-neg50.5%
Simplified50.5%
Final simplification59.5%
(FPCore (F B x) :precision binary64 (if (<= F -3.6e-50) (- (/ -1.0 B) (/ x (tan B))) (if (<= F 2.6e-32) (/ x (- (tan B))) (- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-50) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 2.6e-32) {
tmp = x / -tan(B);
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.6d-50)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 2.6d-32) then
tmp = x / -tan(b)
else
tmp = (1.0d0 / b) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-50) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 2.6e-32) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.6e-50: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 2.6e-32: tmp = x / -math.tan(B) else: tmp = (1.0 / B) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.6e-50) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 2.6e-32) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.6e-50) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 2.6e-32) tmp = x / -tan(B); else tmp = (1.0 / B) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.6e-50], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.6e-32], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.6 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.59999999999999979e-50Initial program 63.1%
distribute-lft-neg-in63.1%
+-commutative63.1%
associate-*l/76.5%
associate-/l*76.4%
fma-define76.4%
/-rgt-identity76.4%
remove-double-neg76.4%
fma-neg76.4%
Simplified76.5%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 69.4%
if -3.59999999999999979e-50 < F < 2.5999999999999997e-32Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.7%
mul-1-neg72.7%
associate-/l*72.6%
Simplified72.6%
clear-num72.4%
un-div-inv72.7%
quot-tan72.8%
Applied egg-rr72.8%
if 2.5999999999999997e-32 < F Initial program 57.2%
distribute-lft-neg-in57.2%
+-commutative57.2%
fma-define57.2%
+-commutative57.2%
*-commutative57.2%
fma-define57.2%
fma-define57.2%
metadata-eval57.2%
metadata-eval57.2%
associate-*r/57.3%
*-rgt-identity57.3%
Simplified57.3%
Taylor expanded in B around 0 43.8%
Taylor expanded in F around inf 50.4%
mul-1-neg50.4%
unsub-neg50.4%
Simplified50.4%
Taylor expanded in x around 0 50.5%
+-commutative50.5%
neg-mul-150.5%
sub-neg50.5%
Simplified50.5%
Final simplification64.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.3e-59) (/ (- -1.0 x) B) (if (<= F 2.5e-32) (/ (- x) B) (- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e-59) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-32) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.3d-59)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.5d-32) then
tmp = -x / b
else
tmp = (1.0d0 / b) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e-59) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-32) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e-59: tmp = (-1.0 - x) / B elif F <= 2.5e-32: tmp = -x / B else: tmp = (1.0 / B) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e-59) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.5e-32) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.3e-59) tmp = (-1.0 - x) / B; elseif (F <= 2.5e-32) tmp = -x / B; else tmp = (1.0 / B) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e-59], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-32], N[((-x) / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{-59}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-32}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.29999999999999999e-59Initial program 63.1%
distribute-lft-neg-in63.1%
+-commutative63.1%
associate-*l/76.5%
associate-/l*76.4%
fma-define76.4%
/-rgt-identity76.4%
remove-double-neg76.4%
fma-neg76.4%
Simplified76.5%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in B around 0 50.3%
mul-1-neg50.3%
distribute-neg-frac250.3%
+-commutative50.3%
Simplified50.3%
if -1.29999999999999999e-59 < F < 2.5e-32Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in B around 0 47.1%
Taylor expanded in x around inf 34.8%
associate-*r/34.8%
mul-1-neg34.8%
Simplified34.8%
if 2.5e-32 < F Initial program 57.2%
distribute-lft-neg-in57.2%
+-commutative57.2%
fma-define57.2%
+-commutative57.2%
*-commutative57.2%
fma-define57.2%
fma-define57.2%
metadata-eval57.2%
metadata-eval57.2%
associate-*r/57.3%
*-rgt-identity57.3%
Simplified57.3%
Taylor expanded in B around 0 43.8%
Taylor expanded in F around inf 50.4%
mul-1-neg50.4%
unsub-neg50.4%
Simplified50.4%
Taylor expanded in x around 0 50.5%
+-commutative50.5%
neg-mul-150.5%
sub-neg50.5%
Simplified50.5%
Final simplification45.1%
(FPCore (F B x) :precision binary64 (if (<= F -6.2e-59) (+ (* 0.3333333333333333 (* x B)) (/ (- -1.0 x) B)) (if (<= F 1.85e-32) (/ (- x) B) (- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-59) {
tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B);
} else if (F <= 1.85e-32) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-6.2d-59)) then
tmp = (0.3333333333333333d0 * (x * b)) + (((-1.0d0) - x) / b)
else if (f <= 1.85d-32) then
tmp = -x / b
else
tmp = (1.0d0 / b) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-59) {
tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B);
} else if (F <= 1.85e-32) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e-59: tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B) elif F <= 1.85e-32: tmp = -x / B else: tmp = (1.0 / B) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e-59) tmp = Float64(Float64(0.3333333333333333 * Float64(x * B)) + Float64(Float64(-1.0 - x) / B)); elseif (F <= 1.85e-32) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.2e-59) tmp = (0.3333333333333333 * (x * B)) + ((-1.0 - x) / B); elseif (F <= 1.85e-32) tmp = -x / B; else tmp = (1.0 / B) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e-59], N[(N[(0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e-32], N[((-x) / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.2 \cdot 10^{-59}:\\
\;\;\;\;0.3333333333333333 \cdot \left(x \cdot B\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{-32}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.19999999999999998e-59Initial program 63.1%
distribute-lft-neg-in63.1%
+-commutative63.1%
associate-*l/76.5%
associate-/l*76.4%
fma-define76.4%
/-rgt-identity76.4%
remove-double-neg76.4%
fma-neg76.4%
Simplified76.5%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in B around 0 50.9%
+-commutative50.9%
mul-1-neg50.9%
unsub-neg50.9%
+-commutative50.9%
Simplified50.9%
if -6.19999999999999998e-59 < F < 1.85e-32Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in B around 0 47.1%
Taylor expanded in x around inf 34.8%
associate-*r/34.8%
mul-1-neg34.8%
Simplified34.8%
if 1.85e-32 < F Initial program 57.2%
distribute-lft-neg-in57.2%
+-commutative57.2%
fma-define57.2%
+-commutative57.2%
*-commutative57.2%
fma-define57.2%
fma-define57.2%
metadata-eval57.2%
metadata-eval57.2%
associate-*r/57.3%
*-rgt-identity57.3%
Simplified57.3%
Taylor expanded in B around 0 43.8%
Taylor expanded in F around inf 50.4%
mul-1-neg50.4%
unsub-neg50.4%
Simplified50.4%
Taylor expanded in x around 0 50.5%
+-commutative50.5%
neg-mul-150.5%
sub-neg50.5%
Simplified50.5%
Final simplification45.3%
(FPCore (F B x) :precision binary64 (if (<= F -2.9e-56) (/ (- -1.0 x) B) (if (<= F 2.1e-32) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.9e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.1e-32) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.9d-56)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.1d-32) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.9e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.1e-32) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.9e-56: tmp = (-1.0 - x) / B elif F <= 2.1e-32: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.9e-56) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.1e-32) 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 <= -2.9e-56) tmp = (-1.0 - x) / B; elseif (F <= 2.1e-32) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.9e-56], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.1e-32], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.9 \cdot 10^{-56}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-32}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.89999999999999991e-56Initial program 63.1%
distribute-lft-neg-in63.1%
+-commutative63.1%
associate-*l/76.5%
associate-/l*76.4%
fma-define76.4%
/-rgt-identity76.4%
remove-double-neg76.4%
fma-neg76.4%
Simplified76.5%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in B around 0 50.3%
mul-1-neg50.3%
distribute-neg-frac250.3%
+-commutative50.3%
Simplified50.3%
if -2.89999999999999991e-56 < F < 2.0999999999999999e-32Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in B around 0 47.1%
Taylor expanded in x around inf 34.8%
associate-*r/34.8%
mul-1-neg34.8%
Simplified34.8%
if 2.0999999999999999e-32 < F Initial program 57.2%
distribute-lft-neg-in57.2%
+-commutative57.2%
fma-define57.2%
+-commutative57.2%
*-commutative57.2%
fma-define57.2%
fma-define57.2%
metadata-eval57.2%
metadata-eval57.2%
associate-*r/57.3%
*-rgt-identity57.3%
Simplified57.3%
Taylor expanded in B around 0 43.8%
Taylor expanded in F around inf 50.4%
mul-1-neg50.4%
unsub-neg50.4%
Simplified50.4%
Final simplification45.1%
(FPCore (F B x) :precision binary64 (if (or (<= x -4e-101) (not (<= x 6.5e-57))) (/ (- x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -4e-101) || !(x <= 6.5e-57)) {
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 <= (-4d-101)) .or. (.not. (x <= 6.5d-57))) 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 <= -4e-101) || !(x <= 6.5e-57)) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -4e-101) or not (x <= 6.5e-57): tmp = -x / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -4e-101) || !(x <= 6.5e-57)) 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 <= -4e-101) || ~((x <= 6.5e-57))) tmp = -x / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -4e-101], N[Not[LessEqual[x, 6.5e-57]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-101} \lor \neg \left(x \leq 6.5 \cdot 10^{-57}\right):\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if x < -4.00000000000000021e-101 or 6.49999999999999992e-57 < x Initial program 78.7%
distribute-lft-neg-in78.7%
+-commutative78.7%
fma-define78.7%
+-commutative78.7%
*-commutative78.7%
fma-define78.7%
fma-define78.7%
metadata-eval78.7%
metadata-eval78.7%
associate-*r/78.9%
*-rgt-identity78.9%
Simplified78.9%
Taylor expanded in B around 0 50.1%
Taylor expanded in x around inf 45.4%
associate-*r/45.4%
mul-1-neg45.4%
Simplified45.4%
if -4.00000000000000021e-101 < x < 6.49999999999999992e-57Initial program 66.4%
distribute-lft-neg-in66.4%
+-commutative66.4%
fma-define66.4%
+-commutative66.4%
*-commutative66.4%
fma-define66.4%
fma-define66.4%
metadata-eval66.4%
metadata-eval66.4%
associate-*r/66.4%
*-rgt-identity66.4%
Simplified66.4%
Taylor expanded in B around 0 35.4%
Taylor expanded in F around inf 16.4%
mul-1-neg16.4%
unsub-neg16.4%
Simplified16.4%
Taylor expanded in x around 0 16.4%
Final simplification33.5%
(FPCore (F B x) :precision binary64 (if (<= F 2.3e-32) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.3e-32) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 2.3d-32) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.3e-32) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.3e-32: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.3e-32) 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 <= 2.3e-32) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.3e-32], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.3 \cdot 10^{-32}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.3000000000000001e-32Initial program 80.9%
distribute-lft-neg-in80.9%
+-commutative80.9%
fma-define80.9%
+-commutative80.9%
*-commutative80.9%
fma-define80.9%
fma-define80.9%
metadata-eval80.9%
metadata-eval80.9%
associate-*r/81.0%
*-rgt-identity81.0%
Simplified81.0%
Taylor expanded in B around 0 44.2%
Taylor expanded in x around inf 32.1%
associate-*r/32.1%
mul-1-neg32.1%
Simplified32.1%
if 2.3000000000000001e-32 < F Initial program 57.2%
distribute-lft-neg-in57.2%
+-commutative57.2%
fma-define57.2%
+-commutative57.2%
*-commutative57.2%
fma-define57.2%
fma-define57.2%
metadata-eval57.2%
metadata-eval57.2%
associate-*r/57.3%
*-rgt-identity57.3%
Simplified57.3%
Taylor expanded in B around 0 43.8%
Taylor expanded in F around inf 50.4%
mul-1-neg50.4%
unsub-neg50.4%
Simplified50.4%
Final simplification37.7%
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
return 1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
return 1.0 / B;
}
def code(F, B, x): return 1.0 / B
function code(F, B, x) return Float64(1.0 / B) end
function tmp = code(F, B, x) tmp = 1.0 / B; end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{B}
\end{array}
Initial program 73.7%
distribute-lft-neg-in73.7%
+-commutative73.7%
fma-define73.7%
+-commutative73.7%
*-commutative73.7%
fma-define73.7%
fma-define73.7%
metadata-eval73.7%
metadata-eval73.7%
associate-*r/73.8%
*-rgt-identity73.8%
Simplified73.8%
Taylor expanded in B around 0 44.1%
Taylor expanded in F around inf 31.6%
mul-1-neg31.6%
unsub-neg31.6%
Simplified31.6%
Taylor expanded in x around 0 10.1%
Final simplification10.1%
herbie shell --seed 2024052
(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))))))