
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.1e+154)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5e+148)
(- (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)) t_0)
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.1e+154) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5e+148) {
tmp = ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.1e+154) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5e+148) tmp = Float64(Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.1e+154], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5e+148], N[(N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.1 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+148}:\\
\;\;\;\;\frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -2.09999999999999994e154Initial program 31.4%
Simplified51.4%
Taylor expanded in F around -inf 99.7%
if -2.09999999999999994e154 < F < 5.00000000000000024e148Initial program 95.9%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
if 5.00000000000000024e148 < F Initial program 29.2%
Simplified52.6%
Taylor expanded in F around inf 99.8%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.55e+73)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 115000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.55e+73) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 115000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.55e+73) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 115000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / 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.55e+73], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 115000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.55 \cdot 10^{+73}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 115000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.55e73Initial program 53.9%
Simplified71.2%
Taylor expanded in F around -inf 99.7%
if -1.55e73 < F < 1.15e8Initial program 99.3%
Simplified99.6%
if 1.15e8 < F Initial program 57.5%
Simplified74.8%
Taylor expanded in F around inf 99.7%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.08e+73)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 25000000.0)
(+
(/ -1.0 (/ (tan B) x))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.08e+73) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 25000000.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)) - (cos(B) * (x / 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 <= (-1.08d+73)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 25000000.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)) - (cos(b) * (x / sin(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.08e+73) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 25000000.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)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.08e+73: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 25000000.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)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.08e+73) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 25000000.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)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.08e+73) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 25000000.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)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.08e+73], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 25000000.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] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.08 \cdot 10^{+73}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 25000000:\\
\;\;\;\;\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} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.08e73Initial program 53.9%
Simplified71.2%
Taylor expanded in F around -inf 99.7%
if -1.08e73 < F < 2.5e7Initial program 99.3%
div-inv99.6%
neg-mul-199.6%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
if 2.5e7 < F Initial program 57.5%
Simplified74.8%
Taylor expanded in F around inf 99.7%
associate-*l/99.8%
*-commutative99.8%
Simplified99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -9.6e-8)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 115000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ 1.0 (tan B))))
(- (/ 1.0 (sin B)) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.6e-8) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 115000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x * (1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - (cos(B) * (x / 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 <= (-9.6d-8)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 115000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x * (1.0d0 / tan(b)))
else
tmp = (1.0d0 / sin(b)) - (cos(b) * (x / sin(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9.6e-8) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 115000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x * (1.0 / Math.tan(B)));
} else {
tmp = (1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.6e-8: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 115000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x * (1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.6e-8) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 115000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9.6e-8) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 115000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x * (1.0 / tan(B))); else tmp = (1.0 / sin(B)) - (cos(B) * (x / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.6e-8], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 115000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 115000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -9.59999999999999994e-8Initial program 63.7%
Simplified77.4%
Taylor expanded in F around -inf 99.8%
if -9.59999999999999994e-8 < F < 1.15e8Initial program 99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
if 1.15e8 < F Initial program 57.5%
Simplified74.8%
Taylor expanded in F around inf 99.7%
associate-*l/99.8%
*-commutative99.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 (sin B)) (* (cos B) (/ x (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 / sin(B)) - (cos(B) * (x / 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 / sin(b)) - (cos(b) * (x / 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 / Math.sin(B)) - (Math.cos(B) * (x / 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 / math.sin(B)) - (math.cos(B) * (x / 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(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(cos(B) * Float64(x / 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 / sin(B)) - (cos(B) * (x / 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[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $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:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.3%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 98.1%
Taylor expanded in x around 0 98.1%
if 1.3999999999999999 < F Initial program 58.0%
Simplified75.1%
Taylor expanded in F around inf 99.5%
associate-*l/99.6%
*-commutative99.6%
Simplified99.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 (sin B)) (* (cos B) (/ x (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 / sin(B)) - (cos(B) * (x / 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 / sin(b)) - (cos(b) * (x / 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 / Math.sin(B)) - (Math.cos(B) * (x / 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 / math.sin(B)) - (math.cos(B) * (x / 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 / sin(B)) - Float64(cos(B) * Float64(x / 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 / sin(B)) - (cos(B) * (x / 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[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $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}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.3%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 98.1%
Taylor expanded in x around 0 98.1%
associate-/l*98.0%
Simplified98.0%
if 1.3999999999999999 < F Initial program 58.0%
Simplified75.1%
Taylor expanded in F around inf 99.5%
associate-*l/99.6%
*-commutative99.6%
Simplified99.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 (sin B)) t_0)))))
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 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.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 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.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 / Math.sin(B)) - t_0;
}
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 / math.sin(B)) - t_0 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 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.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 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.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[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.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}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.3%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 98.1%
Taylor expanded in x around 0 98.1%
associate-/l*98.0%
Simplified98.0%
if 1.3999999999999999 < F Initial program 58.0%
Simplified75.1%
Taylor expanded in F around inf 99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.115)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.017)
(- (/ (* F (sqrt 0.5)) B) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.115) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.017) {
tmp = ((F * sqrt(0.5)) / B) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.115d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.017d0) then
tmp = ((f * sqrt(0.5d0)) / b) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.115) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.017) {
tmp = ((F * Math.sqrt(0.5)) / B) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.115: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.017: tmp = ((F * math.sqrt(0.5)) / B) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.115) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.017) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.115) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.017) tmp = ((F * sqrt(0.5)) / B) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.115], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.017], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.115:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.017:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.115000000000000005Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
if -0.115000000000000005 < F < 0.017000000000000001Initial program 99.3%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 99.3%
Taylor expanded in x around 0 99.3%
Taylor expanded in B around 0 82.8%
if 0.017000000000000001 < F Initial program 59.6%
Simplified76.0%
Taylor expanded in F around inf 97.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4.6e-15)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.55e-48)
(* (cos B) (/ x (- (sin B))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4.6e-15) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.55e-48) {
tmp = cos(B) * (x / -sin(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-4.6d-15)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.55d-48) then
tmp = cos(b) * (x / -sin(b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -4.6e-15) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.55e-48) {
tmp = Math.cos(B) * (x / -Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -4.6e-15: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.55e-48: tmp = math.cos(B) * (x / -math.sin(B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4.6e-15) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.55e-48) tmp = Float64(cos(B) * Float64(x / Float64(-sin(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -4.6e-15) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.55e-48) tmp = cos(B) * (x / -sin(B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.6e-15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.55e-48], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.6 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.55 \cdot 10^{-48}:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.59999999999999981e-15Initial program 64.3%
Simplified77.7%
Taylor expanded in F around -inf 98.4%
if -4.59999999999999981e-15 < F < 2.55000000000000006e-48Initial program 99.3%
Simplified99.6%
Taylor expanded in F around -inf 36.3%
Taylor expanded in x around inf 74.5%
mul-1-neg74.5%
*-commutative74.5%
associate-*r/74.6%
distribute-rgt-neg-in74.6%
distribute-neg-frac74.6%
Simplified74.6%
if 2.55000000000000006e-48 < F Initial program 63.3%
Simplified78.2%
Taylor expanded in F around inf 92.4%
Final simplification86.7%
(FPCore (F B x)
:precision binary64
(if (<= F -6e-16)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 0.032)
(* (cos B) (/ x (- (sin B))))
(- (/ (* F (/ 1.0 F)) (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 0.032) {
tmp = cos(B) * (x / -sin(B));
} else {
tmp = ((F * (1.0 / F)) / 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 <= (-6d-16)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 0.032d0) then
tmp = cos(b) * (x / -sin(b))
else
tmp = ((f * (1.0d0 / f)) / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 0.032) {
tmp = Math.cos(B) * (x / -Math.sin(B));
} else {
tmp = ((F * (1.0 / F)) / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-16: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 0.032: tmp = math.cos(B) * (x / -math.sin(B)) else: tmp = ((F * (1.0 / F)) / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 0.032) tmp = Float64(cos(B) * Float64(x / Float64(-sin(B)))); else tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6e-16) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 0.032) tmp = cos(B) * (x / -sin(B)); else tmp = ((F * (1.0 / F)) / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.032], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.032:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.99999999999999987e-16Initial program 64.3%
Simplified77.7%
Taylor expanded in F around -inf 98.4%
if -5.99999999999999987e-16 < F < 0.032000000000000001Initial program 99.3%
Simplified99.6%
Taylor expanded in F around -inf 37.0%
Taylor expanded in x around inf 72.3%
mul-1-neg72.3%
*-commutative72.3%
associate-*r/72.4%
distribute-rgt-neg-in72.4%
distribute-neg-frac72.4%
Simplified72.4%
if 0.032000000000000001 < F Initial program 59.1%
Simplified75.7%
associate-*r/75.8%
fma-define75.8%
fma-undefine75.8%
*-commutative75.8%
fma-define75.8%
fma-define75.8%
Applied egg-rr75.8%
Taylor expanded in F around inf 97.3%
Taylor expanded in B around 0 75.5%
Final simplification80.0%
(FPCore (F B x)
:precision binary64
(if (<= F -13500.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 0.03)
(* (cos B) (/ x (- (sin B))))
(- (/ (* F (/ 1.0 F)) (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -13500.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 0.03) {
tmp = cos(B) * (x / -sin(B));
} else {
tmp = ((F * (1.0 / F)) / 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 <= (-13500.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 0.03d0) then
tmp = cos(b) * (x / -sin(b))
else
tmp = ((f * (1.0d0 / f)) / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -13500.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 0.03) {
tmp = Math.cos(B) * (x / -Math.sin(B));
} else {
tmp = ((F * (1.0 / F)) / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -13500.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 0.03: tmp = math.cos(B) * (x / -math.sin(B)) else: tmp = ((F * (1.0 / F)) / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -13500.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 0.03) tmp = Float64(cos(B) * Float64(x / Float64(-sin(B)))); else tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -13500.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 0.03) tmp = cos(B) * (x / -sin(B)); else tmp = ((F * (1.0 / F)) / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -13500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.03], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -13500:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 0.03:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -13500Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.1%
if -13500 < F < 0.029999999999999999Initial program 99.3%
Simplified99.6%
Taylor expanded in F around -inf 37.3%
Taylor expanded in x around inf 71.9%
mul-1-neg71.9%
*-commutative71.9%
associate-*r/72.0%
distribute-rgt-neg-in72.0%
distribute-neg-frac72.0%
Simplified72.0%
if 0.029999999999999999 < F Initial program 59.1%
Simplified75.7%
associate-*r/75.8%
fma-define75.8%
fma-undefine75.8%
*-commutative75.8%
fma-define75.8%
fma-define75.8%
Applied egg-rr75.8%
Taylor expanded in F around inf 97.3%
Taylor expanded in B around 0 75.5%
Final simplification74.6%
(FPCore (F B x)
:precision binary64
(if (<= F -170.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 0.022)
(* x (/ (cos B) (- (sin B))))
(- (/ (* F (/ 1.0 F)) (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -170.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 0.022) {
tmp = x * (cos(B) / -sin(B));
} else {
tmp = ((F * (1.0 / F)) / 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 <= (-170.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 0.022d0) then
tmp = x * (cos(b) / -sin(b))
else
tmp = ((f * (1.0d0 / f)) / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -170.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 0.022) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else {
tmp = ((F * (1.0 / F)) / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -170.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 0.022: tmp = x * (math.cos(B) / -math.sin(B)) else: tmp = ((F * (1.0 / F)) / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -170.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 0.022) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); else tmp = Float64(Float64(Float64(F * Float64(1.0 / F)) / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -170.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 0.022) tmp = x * (cos(B) / -sin(B)); else tmp = ((F * (1.0 / F)) / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -170.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.022], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -170:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 0.022:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \frac{1}{F}}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -170Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.1%
if -170 < F < 0.021999999999999999Initial program 99.3%
Simplified99.6%
Taylor expanded in F around -inf 37.3%
Taylor expanded in x around inf 71.9%
mul-1-neg71.9%
associate-/l*71.8%
distribute-rgt-neg-in71.8%
mul-1-neg71.8%
associate-*r/71.8%
neg-mul-171.8%
Simplified71.8%
if 0.021999999999999999 < F Initial program 59.1%
Simplified75.7%
associate-*r/75.8%
fma-define75.8%
fma-undefine75.8%
*-commutative75.8%
fma-define75.8%
fma-define75.8%
Applied egg-rr75.8%
Taylor expanded in F around inf 97.3%
Taylor expanded in B around 0 75.5%
Final simplification74.5%
(FPCore (F B x)
:precision binary64
(if (<= F -7000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F -2.3e-136) (not (<= F 1.2e-150)))
(- (/ 1.0 B) (/ x (tan B)))
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= -2.3e-136) || !(F <= 1.2e-150)) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.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 <= (-7000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= (-2.3d-136)) .or. (.not. (f <= 1.2d-150))) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= -2.3e-136) || !(F <= 1.2e-150)) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= -2.3e-136) or not (F <= 1.2e-150): tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= -2.3e-136) || !(F <= 1.2e-150)) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= -2.3e-136) || ~((F <= 1.2e-150))) tmp = (1.0 / B) - (x / tan(B)); else tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -2.3e-136], N[Not[LessEqual[F, 1.2e-150]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.3 \cdot 10^{-136} \lor \neg \left(F \leq 1.2 \cdot 10^{-150}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -7e3Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.1%
if -7e3 < F < -2.29999999999999998e-136 or 1.2e-150 < F Initial program 75.8%
Simplified85.6%
Taylor expanded in F around inf 73.7%
Taylor expanded in B around 0 63.8%
if -2.29999999999999998e-136 < F < 1.2e-150Initial program 99.5%
Simplified99.7%
Taylor expanded in B around 0 55.6%
Taylor expanded in F around 0 55.6%
neg-mul-155.6%
+-commutative55.6%
unsub-neg55.6%
*-commutative55.6%
Simplified55.6%
Final simplification65.5%
(FPCore (F B x)
:precision binary64
(if (<= F -7000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F -2.2e-136) (not (<= F 8.6e-152)))
(- (/ 1.0 B) (/ x (tan B)))
(/ (- (* F (sqrt 0.5)) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= -2.2e-136) || !(F <= 8.6e-152)) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = ((F * sqrt(0.5)) - 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 <= (-7000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= (-2.2d-136)) .or. (.not. (f <= 8.6d-152))) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = ((f * sqrt(0.5d0)) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= -2.2e-136) || !(F <= 8.6e-152)) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= -2.2e-136) or not (F <= 8.6e-152): tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = ((F * math.sqrt(0.5)) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= -2.2e-136) || !(F <= 8.6e-152)) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= -2.2e-136) || ~((F <= 8.6e-152))) tmp = (1.0 / B) - (x / tan(B)); else tmp = ((F * sqrt(0.5)) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -2.2e-136], N[Not[LessEqual[F, 8.6e-152]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.2 \cdot 10^{-136} \lor \neg \left(F \leq 8.6 \cdot 10^{-152}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\end{array}
\end{array}
if F < -7e3Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.1%
if -7e3 < F < -2.2000000000000001e-136 or 8.5999999999999997e-152 < F Initial program 75.8%
Simplified85.6%
Taylor expanded in F around inf 73.7%
Taylor expanded in B around 0 63.8%
if -2.2000000000000001e-136 < F < 8.5999999999999997e-152Initial program 99.5%
Simplified99.7%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in B around 0 55.6%
Final simplification65.5%
(FPCore (F B x) :precision binary64 (if (<= B 0.00017) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.00017) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 0.00017d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 0.00017) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 0.00017: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 0.00017) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 0.00017) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 0.00017], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.00017:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 1.7e-4Initial program 77.5%
Simplified89.5%
Taylor expanded in B around 0 57.0%
unpow257.0%
Applied egg-rr57.0%
if 1.7e-4 < B Initial program 79.8%
Simplified80.1%
Taylor expanded in F around inf 60.6%
Taylor expanded in B around 0 51.5%
Final simplification55.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.95e-93) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 2.25e-37) (* (cos B) (/ (- x) B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e-93) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.25e-37) {
tmp = cos(B) * (-x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.95d-93)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.25d-37) then
tmp = cos(b) * (-x / b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e-93) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.25e-37) {
tmp = Math.cos(B) * (-x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.95e-93: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.25e-37: tmp = math.cos(B) * (-x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.95e-93) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.25e-37) tmp = Float64(cos(B) * 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 <= -1.95e-93) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.25e-37) tmp = cos(B) * (-x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.95e-93], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.25e-37], N[(N[Cos[B], $MachinePrecision] * N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{-93}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.25 \cdot 10^{-37}:\\
\;\;\;\;\cos B \cdot \frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.95000000000000009e-93Initial program 71.7%
Simplified82.4%
Taylor expanded in F around -inf 85.7%
Taylor expanded in B around 0 62.2%
if -1.95000000000000009e-93 < F < 2.2500000000000002e-37Initial program 99.4%
Simplified99.7%
Taylor expanded in F around -inf 35.7%
Taylor expanded in x around inf 78.6%
mul-1-neg78.6%
*-commutative78.6%
associate-*r/78.7%
distribute-rgt-neg-in78.7%
distribute-neg-frac78.7%
Simplified78.7%
Taylor expanded in B around 0 39.4%
if 2.2500000000000002e-37 < F Initial program 63.3%
Simplified78.2%
Taylor expanded in F around inf 92.2%
Taylor expanded in B around 0 45.1%
(FPCore (F B x) :precision binary64 (if (<= F -7.2e-93) (/ (- -1.0 x) B) (if (<= F 7e-50) (* (cos B) (/ (- x) B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-93) {
tmp = (-1.0 - x) / B;
} else if (F <= 7e-50) {
tmp = cos(B) * (-x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-7.2d-93)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7d-50) then
tmp = cos(b) * (-x / b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-93) {
tmp = (-1.0 - x) / B;
} else if (F <= 7e-50) {
tmp = Math.cos(B) * (-x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.2e-93: tmp = (-1.0 - x) / B elif F <= 7e-50: tmp = math.cos(B) * (-x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.2e-93) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7e-50) tmp = Float64(cos(B) * Float64(Float64(-x) / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.2e-93) tmp = (-1.0 - x) / B; elseif (F <= 7e-50) tmp = cos(B) * (-x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.2e-93], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e-50], N[(N[Cos[B], $MachinePrecision] * N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{-93}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-50}:\\
\;\;\;\;\cos B \cdot \frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.2000000000000003e-93Initial program 71.7%
Simplified82.4%
Taylor expanded in B around 0 37.3%
Taylor expanded in F around -inf 40.7%
associate-*r/40.7%
distribute-lft-in40.7%
metadata-eval40.7%
neg-mul-140.7%
unsub-neg40.7%
Simplified40.7%
if -7.2000000000000003e-93 < F < 6.99999999999999993e-50Initial program 99.4%
Simplified99.7%
Taylor expanded in F around -inf 35.7%
Taylor expanded in x around inf 78.6%
mul-1-neg78.6%
*-commutative78.6%
associate-*r/78.7%
distribute-rgt-neg-in78.7%
distribute-neg-frac78.7%
Simplified78.7%
Taylor expanded in B around 0 39.4%
if 6.99999999999999993e-50 < F Initial program 63.3%
Simplified78.2%
Taylor expanded in F around inf 92.2%
Taylor expanded in B around 0 45.1%
(FPCore (F B x) :precision binary64 (if (<= F -10.0) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -10.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-10.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -10.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -10.0: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -10.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -10.0) tmp = (-1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -10.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -10:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -10Initial program 63.2%
Simplified77.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.1%
if -10 < F Initial program 83.2%
Simplified90.0%
Taylor expanded in F around inf 57.3%
Taylor expanded in B around 0 56.0%
(FPCore (F B x) :precision binary64 (if (<= F -2.2e-107) (/ (- -1.0 x) B) (if (<= F 1.22e-41) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.2e-107) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.22e-41) {
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.2d-107)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.22d-41) 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.2e-107) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.22e-41) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.2e-107: tmp = (-1.0 - x) / B elif F <= 1.22e-41: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.2e-107) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.22e-41) 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.2e-107) tmp = (-1.0 - x) / B; elseif (F <= 1.22e-41) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.2e-107], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22e-41], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.2 \cdot 10^{-107}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-41}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.20000000000000012e-107Initial program 73.0%
Simplified83.2%
Taylor expanded in B around 0 37.8%
Taylor expanded in F around -inf 40.1%
associate-*r/40.1%
distribute-lft-in40.1%
metadata-eval40.1%
neg-mul-140.1%
unsub-neg40.1%
Simplified40.1%
if -2.20000000000000012e-107 < F < 1.22e-41Initial program 99.4%
Simplified99.7%
Taylor expanded in F around inf 26.1%
Taylor expanded in B around 0 15.0%
Taylor expanded in x around inf 39.8%
associate-*r/39.8%
mul-1-neg39.8%
Simplified39.8%
if 1.22e-41 < F Initial program 63.3%
Simplified78.2%
Taylor expanded in F around inf 92.2%
Taylor expanded in B around 0 45.1%
(FPCore (F B x) :precision binary64 (if (<= F -6.6e-103) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-103) {
tmp = (-1.0 - x) / B;
} else {
tmp = -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.6d-103)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-103) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.6e-103: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.6e-103) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.6e-103) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.6e-103], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{-103}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -6.59999999999999979e-103Initial program 72.4%
Simplified82.8%
Taylor expanded in B around 0 37.6%
Taylor expanded in F around -inf 39.8%
associate-*r/39.8%
distribute-lft-in39.8%
metadata-eval39.8%
neg-mul-139.8%
unsub-neg39.8%
Simplified39.8%
if -6.59999999999999979e-103 < F Initial program 81.1%
Simplified88.8%
Taylor expanded in F around inf 59.8%
Taylor expanded in B around 0 30.6%
Taylor expanded in x around inf 31.6%
associate-*r/31.6%
mul-1-neg31.6%
Simplified31.6%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 78.2%
Simplified86.8%
Taylor expanded in F around inf 56.0%
Taylor expanded in B around 0 29.1%
Taylor expanded in x around inf 29.9%
associate-*r/29.9%
mul-1-neg29.9%
Simplified29.9%
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
return 1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
return 1.0 / B;
}
def code(F, B, x): return 1.0 / B
function code(F, B, x) return Float64(1.0 / B) end
function tmp = code(F, B, x) tmp = 1.0 / B; end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{B}
\end{array}
Initial program 78.2%
Simplified86.8%
Taylor expanded in F around inf 56.0%
Taylor expanded in B around 0 29.1%
Taylor expanded in x around 0 9.9%
herbie shell --seed 2024166
(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))))))