
(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 24 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 -1.5e+20)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 300000000.0)
(- (* F (/ 1.0 (/ (sin B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)))) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.5e+20) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 300000000.0) {
tmp = (F * (1.0 / (sin(B) / pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)))) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5e+20) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 300000000.0) tmp = Float64(Float64(F * Float64(1.0 / Float64(sin(B) / (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e+20], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 300000000.0], N[(N[(F * N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 300000000:\\
\;\;\;\;F \cdot \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.5e20Initial program 54.0%
Simplified68.9%
Taylor expanded in F around -inf 99.6%
if -1.5e20 < F < 3e8Initial program 99.5%
Simplified99.7%
clear-num99.7%
inv-pow99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
Applied egg-rr99.7%
unpow-199.7%
fma-define99.7%
*-commutative99.7%
fma-define99.7%
Simplified99.7%
if 3e8 < F Initial program 64.4%
Simplified77.0%
associate-*r/77.0%
fma-undefine77.0%
+-commutative77.0%
*-commutative77.0%
fma-define77.0%
metadata-eval77.0%
metadata-eval77.0%
fma-define77.0%
+-commutative77.0%
fma-define77.0%
metadata-eval77.0%
metadata-eval77.0%
Applied egg-rr77.0%
Taylor expanded in F around inf 99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9e+74)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 300000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -9e+74) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 300000000.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)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9e+74) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 300000000.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(Float64(x * cos(B)) / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9e+74], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 300000000.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[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{+74}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 300000000:\\
\;\;\;\;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} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -8.9999999999999999e74Initial program 47.2%
Simplified64.2%
Taylor expanded in F around -inf 99.6%
if -8.9999999999999999e74 < F < 3e8Initial program 99.5%
Simplified99.7%
if 3e8 < F Initial program 64.4%
Simplified77.0%
associate-*r/77.0%
fma-undefine77.0%
+-commutative77.0%
*-commutative77.0%
fma-define77.0%
metadata-eval77.0%
metadata-eval77.0%
fma-define77.0%
+-commutative77.0%
fma-define77.0%
metadata-eval77.0%
metadata-eval77.0%
Applied egg-rr77.0%
Taylor expanded in F around inf 99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+17)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 100000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ (cos B) (sin B))))
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+17) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 100000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x * (cos(B) / sin(B)));
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2d+17)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 100000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x * (cos(b) / sin(b)))
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2e+17) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 100000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x * (Math.cos(B) / Math.sin(B)));
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e+17: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 100000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x * (math.cos(B) / math.sin(B))) else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e+17) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 100000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x * Float64(cos(B) / sin(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2e+17) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 100000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x * (cos(B) / sin(B))); else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.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[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - x \cdot \frac{\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -2e17Initial program 55.3%
Simplified69.7%
Taylor expanded in F around -inf 99.6%
if -2e17 < F < 1e8Initial program 99.5%
Taylor expanded in x around 0 99.5%
mul-1-neg99.5%
associate-/l*99.5%
Simplified99.5%
if 1e8 < F Initial program 64.9%
Simplified77.3%
associate-*r/77.3%
fma-undefine77.3%
+-commutative77.3%
*-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
fma-define77.3%
+-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
Applied egg-rr77.3%
Taylor expanded in F around inf 99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.45e+17)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 105000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ 1.0 (/ (sin B) F))))
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.45e+17) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 105000000.0) {
tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (1.0 / (sin(B) / F)));
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.45d+17)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 105000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (1.0d0 / (sin(b) / f)))
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.45e+17) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 105000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (1.0 / (Math.sin(B) / F)));
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.45e+17: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 105000000.0: tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (1.0 / (math.sin(B) / F))) else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.45e+17) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 105000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(1.0 / Float64(sin(B) / F)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.45e+17) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 105000000.0) tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (1.0 / (sin(B) / F))); else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.45e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 105000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(1.0 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.45 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 105000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{1}{\frac{\sin B}{F}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -2.45e17Initial program 54.7%
Simplified69.3%
Taylor expanded in F around -inf 99.6%
if -2.45e17 < F < 1.05e8Initial program 99.5%
clear-num99.5%
inv-pow99.5%
Applied egg-rr99.5%
unpow-199.5%
Simplified99.5%
if 1.05e8 < F Initial program 64.9%
Simplified77.3%
associate-*r/77.3%
fma-undefine77.3%
+-commutative77.3%
*-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
fma-define77.3%
+-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
Applied egg-rr77.3%
Taylor expanded in F around inf 99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -6.2e+15)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 125000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e+15) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 125000000.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)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-6.2d+15)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 125000000.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)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e+15) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 125000000.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)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e+15: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 125000000.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)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e+15) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 125000000.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(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.2e+15) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 125000000.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)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 125000000.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[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 125000000:\\
\;\;\;\;\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} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -6.2e15Initial program 55.3%
Simplified69.7%
Taylor expanded in F around -inf 99.6%
if -6.2e15 < F < 1.25e8Initial program 99.5%
if 1.25e8 < F Initial program 64.9%
Simplified77.3%
associate-*r/77.3%
fma-undefine77.3%
+-commutative77.3%
*-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
fma-define77.3%
+-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
Applied egg-rr77.3%
Taylor expanded in F around inf 99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+17)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 108000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ -1.0 (/ (tan B) x)))
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+17) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 108000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (-1.0 / (tan(B) / x));
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2d+17)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 108000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + ((-1.0d0) / (tan(b) / x))
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2e+17) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 108000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (-1.0 / (Math.tan(B) / x));
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e+17: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 108000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (-1.0 / (math.tan(B) / x)) else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e+17) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 108000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(-1.0 / Float64(tan(B) / x))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2e+17) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 108000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (-1.0 / (tan(B) / x)); else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 108000000.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[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 108000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + \frac{-1}{\frac{\tan B}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -2e17Initial program 55.3%
Simplified69.7%
Taylor expanded in F around -inf 99.6%
if -2e17 < F < 1.08e8Initial program 99.5%
neg-mul-199.5%
div-inv99.6%
clear-num99.4%
un-div-inv99.4%
Applied egg-rr99.4%
if 1.08e8 < F Initial program 64.9%
Simplified77.3%
associate-*r/77.3%
fma-undefine77.3%
+-commutative77.3%
*-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
fma-define77.3%
+-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
Applied egg-rr77.3%
Taylor expanded in F around inf 99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -310000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -310000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-310000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -310000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -310000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -310000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -310000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -310000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -310000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -3.1e5Initial program 55.9%
Simplified70.2%
Taylor expanded in F around -inf 99.7%
if -3.1e5 < F < 1.44999999999999996Initial program 99.5%
Simplified99.7%
clear-num99.7%
un-div-inv99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in F around 0 99.3%
if 1.44999999999999996 < F Initial program 65.4%
Simplified77.6%
associate-*r/77.6%
fma-undefine77.6%
+-commutative77.6%
*-commutative77.6%
fma-define77.5%
metadata-eval77.5%
metadata-eval77.5%
fma-define77.6%
+-commutative77.6%
fma-define77.6%
metadata-eval77.6%
metadata-eval77.6%
Applied egg-rr77.6%
Taylor expanded in F around inf 99.5%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6.2e+15)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1850000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -6.2e+15) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1850000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-6.2d+15)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1850000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -6.2e+15) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1850000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -6.2e+15: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1850000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6.2e+15) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1850000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -6.2e+15) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1850000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - t_0; else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6.2e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1850000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1850000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -6.2e15Initial program 55.3%
Simplified69.7%
Taylor expanded in F around -inf 99.6%
if -6.2e15 < F < 1.85e6Initial program 99.5%
Taylor expanded in B around 0 87.4%
neg-sub087.4%
div-inv87.5%
Applied egg-rr87.5%
neg-sub087.5%
distribute-neg-frac87.5%
Simplified87.5%
if 1.85e6 < F Initial program 64.9%
Simplified77.3%
associate-*r/77.3%
fma-undefine77.3%
+-commutative77.3%
*-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
fma-define77.3%
+-commutative77.3%
fma-define77.3%
metadata-eval77.3%
metadata-eval77.3%
Applied egg-rr77.3%
Taylor expanded in F around inf 99.7%
Final simplification94.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6.2e+15)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1850000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F 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 <= -6.2e+15) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1850000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= (-6.2d+15)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1850000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / 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 <= -6.2e+15) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1850000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -6.2e+15: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1850000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -6.2e+15) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1850000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / 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 <= -6.2e+15) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1850000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / 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, -6.2e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1850000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - 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 -6.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1850000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.2e15Initial program 55.3%
Simplified69.7%
Taylor expanded in F around -inf 99.6%
if -6.2e15 < F < 1.85e6Initial program 99.5%
Taylor expanded in B around 0 87.4%
neg-sub087.4%
div-inv87.5%
Applied egg-rr87.5%
neg-sub087.5%
distribute-neg-frac87.5%
Simplified87.5%
if 1.85e6 < F Initial program 64.9%
Simplified77.3%
Taylor expanded in F around inf 99.6%
Final simplification94.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.2e-16)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -3.35e-77)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 1.55e-118)
(* x (/ (cos B) (- (sin B))))
(if (<= F 1850000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.2e-16) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -3.35e-77) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 1.55e-118) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 1850000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (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 / tan(b)
if (f <= (-1.2d-16)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-3.35d-77)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 1.55d-118) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 1850000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (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 / Math.tan(B);
double tmp;
if (F <= -1.2e-16) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -3.35e-77) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 1.55e-118) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 1850000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.2e-16: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -3.35e-77: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 1.55e-118: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 1850000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.2e-16) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -3.35e-77) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 1.55e-118) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 1850000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - 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 / tan(B); tmp = 0.0; if (F <= -1.2e-16) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -3.35e-77) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 1.55e-118) tmp = x * (cos(B) / -sin(B)); elseif (F <= 1850000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (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[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.35e-77], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.55e-118], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1850000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], 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.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -3.35 \cdot 10^{-77}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-118}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1850000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.20000000000000002e-16Initial program 58.2%
Simplified71.7%
Taylor expanded in F around -inf 98.5%
if -1.20000000000000002e-16 < F < -3.3499999999999999e-77Initial program 99.1%
Simplified99.1%
associate-*r/99.5%
fma-undefine99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 77.5%
associate-*l/77.9%
*-lft-identity77.9%
times-frac77.5%
/-rgt-identity77.5%
+-commutative77.5%
unpow277.5%
fma-undefine77.5%
Simplified77.5%
Taylor expanded in F around 0 77.9%
if -3.3499999999999999e-77 < F < 1.5500000000000001e-118Initial program 99.5%
Simplified99.7%
associate-*r/99.6%
fma-undefine99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
fma-define99.6%
+-commutative99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in F around 0 83.0%
mul-1-neg83.0%
associate-/l*83.2%
distribute-lft-neg-in83.2%
Simplified83.2%
if 1.5500000000000001e-118 < F < 1.85e6Initial program 99.5%
Taylor expanded in B around 0 86.4%
Taylor expanded in B around 0 77.7%
associate-*r/77.7%
mul-1-neg77.7%
Simplified77.7%
if 1.85e6 < F Initial program 64.9%
Simplified77.3%
Taylor expanded in F around inf 99.6%
Final simplification91.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3e+138)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -3.1e-19)
(- (/ -1.0 B) t_0)
(if (<= F -5.2e-76)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 9.6e-119)
(* x (/ (cos B) (- (sin B))))
(if (<= F 1850000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 B) t_0))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3e+138) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -3.1e-19) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -5.2e-76) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 9.6e-119) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 1850000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-3d+138)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-3.1d-19)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-5.2d-76)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 9.6d-119) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 1850000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -3e+138) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -3.1e-19) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -5.2e-76) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 9.6e-119) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 1850000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3e+138: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -3.1e-19: tmp = (-1.0 / B) - t_0 elif F <= -5.2e-76: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 9.6e-119: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 1850000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3e+138) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -3.1e-19) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -5.2e-76) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 9.6e-119) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 1850000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3e+138) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -3.1e-19) tmp = (-1.0 / B) - t_0; elseif (F <= -5.2e-76) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 9.6e-119) tmp = x * (cos(B) / -sin(B)); elseif (F <= 1850000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3e+138], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.1e-19], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.2e-76], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.6e-119], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1850000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3 \cdot 10^{+138}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -3.1 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -5.2 \cdot 10^{-76}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 9.6 \cdot 10^{-119}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1850000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -3.0000000000000001e138Initial program 37.4%
Simplified53.6%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 78.7%
if -3.0000000000000001e138 < F < -3.0999999999999999e-19Initial program 90.1%
Simplified99.5%
Taylor expanded in F around -inf 96.7%
Taylor expanded in B around 0 82.0%
if -3.0999999999999999e-19 < F < -5.1999999999999999e-76Initial program 99.1%
Simplified99.1%
associate-*r/99.5%
fma-undefine99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 77.5%
associate-*l/77.9%
*-lft-identity77.9%
times-frac77.5%
/-rgt-identity77.5%
+-commutative77.5%
unpow277.5%
fma-undefine77.5%
Simplified77.5%
Taylor expanded in F around 0 77.9%
if -5.1999999999999999e-76 < F < 9.60000000000000034e-119Initial program 99.5%
Simplified99.7%
associate-*r/99.6%
fma-undefine99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
fma-define99.6%
+-commutative99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in F around 0 83.0%
mul-1-neg83.0%
associate-/l*83.2%
distribute-lft-neg-in83.2%
Simplified83.2%
if 9.60000000000000034e-119 < F < 1.85e6Initial program 99.5%
Taylor expanded in B around 0 86.4%
Taylor expanded in B around 0 77.7%
associate-*r/77.7%
mul-1-neg77.7%
Simplified77.7%
if 1.85e6 < F Initial program 64.9%
Taylor expanded in B around 0 42.8%
neg-sub042.8%
div-inv42.8%
Applied egg-rr42.8%
neg-sub042.8%
distribute-neg-frac42.8%
Simplified42.8%
Taylor expanded in F around inf 64.8%
Final simplification76.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -310000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.027)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) 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 <= -310000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.027) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - 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 <= (-310000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.027d0) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - 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 <= -310000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.027) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - 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 <= -310000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.027: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - 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 <= -310000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.027) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - 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 <= -310000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.027) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - 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, -310000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.027], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $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 -310000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.027:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.1e5Initial program 55.9%
Simplified70.2%
Taylor expanded in F around -inf 99.7%
if -3.1e5 < F < 0.0269999999999999997Initial program 99.5%
Taylor expanded in B around 0 87.2%
neg-sub087.2%
div-inv87.3%
Applied egg-rr87.3%
neg-sub087.3%
distribute-neg-frac87.3%
Simplified87.3%
Taylor expanded in F around 0 87.0%
if 0.0269999999999999997 < F Initial program 65.4%
Simplified77.6%
Taylor expanded in F around inf 99.4%
Final simplification94.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.5e-16)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2.35e-76)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 5e-122)
(* x (/ (cos B) (- (sin B))))
(if (<= F 1850000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.5e-16) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2.35e-76) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 5e-122) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 1850000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.5d-16)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2.35d-76)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 5d-122) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 1850000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.5e-16) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2.35e-76) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 5e-122) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 1850000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.5e-16: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2.35e-76: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 5e-122: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 1850000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5e-16) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2.35e-76) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 5e-122) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 1850000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.5e-16) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2.35e-76) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 5e-122) tmp = x * (cos(B) / -sin(B)); elseif (F <= 1850000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.35e-76], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-122], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1850000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2.35 \cdot 10^{-76}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-122}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1850000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.49999999999999997e-16Initial program 58.2%
Simplified71.7%
Taylor expanded in F around -inf 98.5%
if -1.49999999999999997e-16 < F < -2.3500000000000001e-76Initial program 99.1%
Simplified99.1%
associate-*r/99.5%
fma-undefine99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in x around 0 77.5%
associate-*l/77.9%
*-lft-identity77.9%
times-frac77.5%
/-rgt-identity77.5%
+-commutative77.5%
unpow277.5%
fma-undefine77.5%
Simplified77.5%
Taylor expanded in F around 0 77.9%
if -2.3500000000000001e-76 < F < 4.9999999999999999e-122Initial program 99.5%
Simplified99.7%
associate-*r/99.6%
fma-undefine99.6%
+-commutative99.6%
*-commutative99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
fma-define99.6%
+-commutative99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in F around 0 83.0%
mul-1-neg83.0%
associate-/l*83.2%
distribute-lft-neg-in83.2%
Simplified83.2%
if 4.9999999999999999e-122 < F < 1.85e6Initial program 99.5%
Taylor expanded in B around 0 86.4%
Taylor expanded in B around 0 77.7%
associate-*r/77.7%
mul-1-neg77.7%
Simplified77.7%
if 1.85e6 < F Initial program 64.9%
Taylor expanded in B around 0 42.8%
neg-sub042.8%
div-inv42.8%
Applied egg-rr42.8%
neg-sub042.8%
distribute-neg-frac42.8%
Simplified42.8%
Taylor expanded in F around inf 64.8%
Final simplification81.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4.1e+138)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 3e-178)
(- (/ -1.0 B) t_0)
(if (<= F 2500000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4.1e+138) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 3e-178) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2500000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-4.1d+138)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 3d-178) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 2500000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -4.1e+138) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 3e-178) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2500000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -4.1e+138: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 3e-178: tmp = (-1.0 / B) - t_0 elif F <= 2500000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4.1e+138) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 3e-178) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 2500000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -4.1e+138) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 3e-178) tmp = (-1.0 / B) - t_0; elseif (F <= 2500000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.1e+138], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3e-178], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2500000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.1 \cdot 10^{+138}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-178}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 2500000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -4.0999999999999998e138Initial program 37.4%
Simplified53.6%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 78.7%
if -4.0999999999999998e138 < F < 2.9999999999999999e-178Initial program 96.8%
Simplified99.6%
Taylor expanded in F around -inf 57.2%
Taylor expanded in B around 0 67.5%
if 2.9999999999999999e-178 < F < 2.5e6Initial program 99.6%
Taylor expanded in B around 0 84.7%
Taylor expanded in B around 0 69.5%
associate-*r/69.5%
mul-1-neg69.5%
Simplified69.5%
if 2.5e6 < F Initial program 64.9%
Taylor expanded in B around 0 42.8%
neg-sub042.8%
div-inv42.8%
Applied egg-rr42.8%
neg-sub042.8%
distribute-neg-frac42.8%
Simplified42.8%
Taylor expanded in F around inf 64.8%
Final simplification69.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -4.1e+138)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 210000.0)
t_0
(if (<= F 2.1e+105)
(/ 1.0 (sin B))
(if (<= F 7.5e+254) t_0 (* F (/ 1.0 (* F (sin B))))))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= -4.1e+138) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 210000.0) {
tmp = t_0;
} else if (F <= 2.1e+105) {
tmp = 1.0 / sin(B);
} else if (F <= 7.5e+254) {
tmp = t_0;
} else {
tmp = F * (1.0 / (F * 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 = ((-1.0d0) / b) - (x / tan(b))
if (f <= (-4.1d+138)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 210000.0d0) then
tmp = t_0
else if (f <= 2.1d+105) then
tmp = 1.0d0 / sin(b)
else if (f <= 7.5d+254) then
tmp = t_0
else
tmp = f * (1.0d0 / (f * sin(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= -4.1e+138) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 210000.0) {
tmp = t_0;
} else if (F <= 2.1e+105) {
tmp = 1.0 / Math.sin(B);
} else if (F <= 7.5e+254) {
tmp = t_0;
} else {
tmp = F * (1.0 / (F * Math.sin(B)));
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -4.1e+138: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 210000.0: tmp = t_0 elif F <= 2.1e+105: tmp = 1.0 / math.sin(B) elif F <= 7.5e+254: tmp = t_0 else: tmp = F * (1.0 / (F * math.sin(B))) return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= -4.1e+138) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 210000.0) tmp = t_0; elseif (F <= 2.1e+105) tmp = Float64(1.0 / sin(B)); elseif (F <= 7.5e+254) tmp = t_0; else tmp = Float64(F * Float64(1.0 / Float64(F * sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= -4.1e+138) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 210000.0) tmp = t_0; elseif (F <= 2.1e+105) tmp = 1.0 / sin(B); elseif (F <= 7.5e+254) tmp = t_0; else tmp = F * (1.0 / (F * sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.1e+138], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 210000.0], t$95$0, If[LessEqual[F, 2.1e+105], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e+254], t$95$0, N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.1 \cdot 10^{+138}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 210000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{+105}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{+254}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B}\\
\end{array}
\end{array}
if F < -4.0999999999999998e138Initial program 37.4%
Simplified53.6%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 78.7%
if -4.0999999999999998e138 < F < 2.1e5 or 2.1000000000000001e105 < F < 7.50000000000000043e254Initial program 90.7%
Simplified95.3%
Taylor expanded in F around -inf 54.8%
Taylor expanded in B around 0 61.3%
if 2.1e5 < F < 2.1000000000000001e105Initial program 95.7%
Simplified99.4%
Taylor expanded in F around inf 98.9%
Taylor expanded in x around 0 66.7%
if 7.50000000000000043e254 < F Initial program 2.4%
Simplified27.9%
associate-*r/27.9%
fma-undefine27.9%
+-commutative27.9%
*-commutative27.9%
fma-define27.9%
metadata-eval27.9%
metadata-eval27.9%
fma-define27.9%
+-commutative27.9%
fma-define27.9%
metadata-eval27.9%
metadata-eval27.9%
Applied egg-rr27.9%
Taylor expanded in x around 0 1.3%
associate-*l/2.3%
*-lft-identity2.3%
times-frac2.3%
/-rgt-identity2.3%
+-commutative2.3%
unpow22.3%
fma-undefine2.3%
Simplified2.3%
Taylor expanded in F around inf 72.7%
*-commutative72.7%
Simplified72.7%
Final simplification65.6%
(FPCore (F B x)
:precision binary64
(if (<= F -8.2e+244)
(/ (- -1.0 x) B)
(if (<= F -9.2e-15)
(/ -1.0 (sin B))
(if (<= F 0.55)
(/ x (- B))
(if (<= F 1.4e+168) (/ 1.0 (sin B)) (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.2e+244) {
tmp = (-1.0 - x) / B;
} else if (F <= -9.2e-15) {
tmp = -1.0 / sin(B);
} else if (F <= 0.55) {
tmp = x / -B;
} else if (F <= 1.4e+168) {
tmp = 1.0 / sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8.2d+244)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-9.2d-15)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 0.55d0) then
tmp = x / -b
else if (f <= 1.4d+168) then
tmp = 1.0d0 / sin(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.2e+244) {
tmp = (-1.0 - x) / B;
} else if (F <= -9.2e-15) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 0.55) {
tmp = x / -B;
} else if (F <= 1.4e+168) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.2e+244: tmp = (-1.0 - x) / B elif F <= -9.2e-15: tmp = -1.0 / math.sin(B) elif F <= 0.55: tmp = x / -B elif F <= 1.4e+168: tmp = 1.0 / math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.2e+244) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -9.2e-15) tmp = Float64(-1.0 / sin(B)); elseif (F <= 0.55) tmp = Float64(x / Float64(-B)); elseif (F <= 1.4e+168) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.2e+244) tmp = (-1.0 - x) / B; elseif (F <= -9.2e-15) tmp = -1.0 / sin(B); elseif (F <= 0.55) tmp = x / -B; elseif (F <= 1.4e+168) tmp = 1.0 / sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.2e+244], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -9.2e-15], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.55], N[(x / (-B)), $MachinePrecision], If[LessEqual[F, 1.4e+168], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.2 \cdot 10^{+244}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -9.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.55:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{+168}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.19999999999999985e244Initial program 27.7%
Simplified53.8%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 67.6%
associate-*r/67.6%
neg-mul-167.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in x around 0 67.5%
associate-*r/67.5%
neg-mul-167.5%
div-sub67.6%
sub-neg67.6%
metadata-eval67.6%
+-commutative67.6%
unsub-neg67.6%
Simplified67.6%
if -8.19999999999999985e244 < F < -9.19999999999999961e-15Initial program 68.7%
Simplified77.8%
associate-*r/77.9%
fma-undefine77.9%
+-commutative77.9%
*-commutative77.9%
fma-define77.9%
metadata-eval77.9%
metadata-eval77.9%
fma-define77.9%
+-commutative77.9%
fma-define77.9%
metadata-eval77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in x around 0 32.7%
associate-*l/38.1%
*-lft-identity38.1%
times-frac38.0%
/-rgt-identity38.0%
+-commutative38.0%
unpow238.0%
fma-undefine38.0%
Simplified38.0%
Taylor expanded in F around -inf 58.4%
if -9.19999999999999961e-15 < F < 0.55000000000000004Initial program 99.5%
Simplified99.7%
Taylor expanded in F around -inf 41.5%
Taylor expanded in B around 0 18.7%
associate-*r/18.7%
neg-mul-118.7%
+-commutative18.7%
Simplified18.7%
Taylor expanded in x around inf 30.0%
associate-*r/30.0%
neg-mul-130.0%
Simplified30.0%
if 0.55000000000000004 < F < 1.39999999999999995e168Initial program 90.2%
Simplified94.9%
Taylor expanded in F around inf 99.2%
Taylor expanded in x around 0 60.3%
if 1.39999999999999995e168 < F Initial program 31.8%
Simplified54.2%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 59.1%
Final simplification47.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.14e+139)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -1.7e-194)
(- (/ -1.0 B) t_0)
(if (<= F -1.75e-290) (/ x (- B)) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.14e+139) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -1.7e-194) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -1.75e-290) {
tmp = x / -B;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.14d+139)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-1.7d-194)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-1.75d-290)) then
tmp = x / -b
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.14e+139) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -1.7e-194) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -1.75e-290) {
tmp = x / -B;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.14e+139: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -1.7e-194: tmp = (-1.0 / B) - t_0 elif F <= -1.75e-290: tmp = x / -B else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.14e+139) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -1.7e-194) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -1.75e-290) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.14e+139) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -1.7e-194) tmp = (-1.0 / B) - t_0; elseif (F <= -1.75e-290) tmp = x / -B; else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.14e+139], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.7e-194], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.75e-290], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.14 \cdot 10^{+139}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.7 \cdot 10^{-194}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -1.75 \cdot 10^{-290}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.13999999999999997e139Initial program 37.4%
Simplified53.6%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 78.7%
if -1.13999999999999997e139 < F < -1.70000000000000005e-194Initial program 94.7%
Simplified99.5%
Taylor expanded in F around -inf 71.1%
Taylor expanded in B around 0 71.7%
if -1.70000000000000005e-194 < F < -1.74999999999999991e-290Initial program 99.9%
Simplified99.8%
Taylor expanded in F around -inf 30.9%
Taylor expanded in B around 0 25.8%
associate-*r/25.8%
neg-mul-125.8%
+-commutative25.8%
Simplified25.8%
Taylor expanded in x around inf 60.9%
associate-*r/60.9%
neg-mul-160.9%
Simplified60.9%
if -1.74999999999999991e-290 < F Initial program 80.9%
Taylor expanded in B around 0 63.4%
neg-sub063.4%
div-inv63.5%
Applied egg-rr63.5%
neg-sub063.5%
distribute-neg-frac63.5%
Simplified63.5%
Taylor expanded in F around inf 61.9%
Final simplification67.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= x -8.6e-10)
t_0
(if (<= x -1.95e-175)
(/ 1.0 (sin B))
(if (<= x 2.5e-81) (/ -1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (x <= -8.6e-10) {
tmp = t_0;
} else if (x <= -1.95e-175) {
tmp = 1.0 / sin(B);
} else if (x <= 2.5e-81) {
tmp = -1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (x <= (-8.6d-10)) then
tmp = t_0
else if (x <= (-1.95d-175)) then
tmp = 1.0d0 / sin(b)
else if (x <= 2.5d-81) then
tmp = (-1.0d0) / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (x <= -8.6e-10) {
tmp = t_0;
} else if (x <= -1.95e-175) {
tmp = 1.0 / Math.sin(B);
} else if (x <= 2.5e-81) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if x <= -8.6e-10: tmp = t_0 elif x <= -1.95e-175: tmp = 1.0 / math.sin(B) elif x <= 2.5e-81: tmp = -1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (x <= -8.6e-10) tmp = t_0; elseif (x <= -1.95e-175) tmp = Float64(1.0 / sin(B)); elseif (x <= 2.5e-81) tmp = Float64(-1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (x <= -8.6e-10) tmp = t_0; elseif (x <= -1.95e-175) tmp = 1.0 / sin(B); elseif (x <= 2.5e-81) tmp = -1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.6e-10], t$95$0, If[LessEqual[x, -1.95e-175], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-81], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -8.6 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-175}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-81}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8.60000000000000029e-10 or 2.4999999999999999e-81 < x Initial program 83.5%
Simplified94.9%
Taylor expanded in F around -inf 86.8%
Taylor expanded in B around 0 89.9%
if -8.60000000000000029e-10 < x < -1.94999999999999999e-175Initial program 65.3%
Simplified73.2%
Taylor expanded in F around inf 41.0%
Taylor expanded in x around 0 40.4%
if -1.94999999999999999e-175 < x < 2.4999999999999999e-81Initial program 73.3%
Simplified74.7%
associate-*r/74.7%
fma-undefine74.7%
+-commutative74.7%
*-commutative74.7%
fma-define74.7%
metadata-eval74.7%
metadata-eval74.7%
fma-define74.7%
+-commutative74.7%
fma-define74.7%
metadata-eval74.7%
metadata-eval74.7%
Applied egg-rr74.7%
Taylor expanded in x around 0 60.0%
associate-*l/61.4%
*-lft-identity61.4%
times-frac61.3%
/-rgt-identity61.3%
+-commutative61.3%
unpow261.3%
fma-undefine61.3%
Simplified61.3%
Taylor expanded in F around -inf 30.8%
(FPCore (F B x)
:precision binary64
(if (<= F -6.2e+245)
(/ (- -1.0 x) B)
(if (<= F -9.2e-15)
(/ -1.0 (sin B))
(if (<= F 8.6e-107) (/ x (- B)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e+245) {
tmp = (-1.0 - x) / B;
} else if (F <= -9.2e-15) {
tmp = -1.0 / sin(B);
} else if (F <= 8.6e-107) {
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 <= (-6.2d+245)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-9.2d-15)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 8.6d-107) 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 <= -6.2e+245) {
tmp = (-1.0 - x) / B;
} else if (F <= -9.2e-15) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 8.6e-107) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e+245: tmp = (-1.0 - x) / B elif F <= -9.2e-15: tmp = -1.0 / math.sin(B) elif F <= 8.6e-107: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e+245) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -9.2e-15) tmp = Float64(-1.0 / sin(B)); elseif (F <= 8.6e-107) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.2e+245) tmp = (-1.0 - x) / B; elseif (F <= -9.2e-15) tmp = -1.0 / sin(B); elseif (F <= 8.6e-107) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e+245], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -9.2e-15], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.6e-107], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.2 \cdot 10^{+245}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -9.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8.6 \cdot 10^{-107}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.1999999999999998e245Initial program 27.7%
Simplified53.8%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 67.6%
associate-*r/67.6%
neg-mul-167.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in x around 0 67.5%
associate-*r/67.5%
neg-mul-167.5%
div-sub67.6%
sub-neg67.6%
metadata-eval67.6%
+-commutative67.6%
unsub-neg67.6%
Simplified67.6%
if -6.1999999999999998e245 < F < -9.19999999999999961e-15Initial program 68.7%
Simplified77.8%
associate-*r/77.9%
fma-undefine77.9%
+-commutative77.9%
*-commutative77.9%
fma-define77.9%
metadata-eval77.9%
metadata-eval77.9%
fma-define77.9%
+-commutative77.9%
fma-define77.9%
metadata-eval77.9%
metadata-eval77.9%
Applied egg-rr77.9%
Taylor expanded in x around 0 32.7%
associate-*l/38.1%
*-lft-identity38.1%
times-frac38.0%
/-rgt-identity38.0%
+-commutative38.0%
unpow238.0%
fma-undefine38.0%
Simplified38.0%
Taylor expanded in F around -inf 58.4%
if -9.19999999999999961e-15 < F < 8.5999999999999995e-107Initial program 99.5%
Simplified99.6%
Taylor expanded in F around -inf 43.0%
Taylor expanded in B around 0 17.5%
associate-*r/17.5%
neg-mul-117.5%
+-commutative17.5%
Simplified17.5%
Taylor expanded in x around inf 30.7%
associate-*r/30.7%
neg-mul-130.7%
Simplified30.7%
if 8.5999999999999995e-107 < F Initial program 72.4%
Simplified82.2%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 42.5%
Final simplification43.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.4e-76) (/ (- -1.0 x) B) (if (<= F 8.6e-107) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e-76) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.6e-107) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.4d-76)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8.6d-107) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e-76) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.6e-107) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.4e-76: tmp = (-1.0 - x) / B elif F <= 8.6e-107: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.4e-76) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.6e-107) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.4e-76) tmp = (-1.0 - x) / B; elseif (F <= 8.6e-107) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.4e-76], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.6e-107], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4 \cdot 10^{-76}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.6 \cdot 10^{-107}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.40000000000000005e-76Initial program 62.5%
Simplified74.6%
Taylor expanded in F around -inf 89.9%
Taylor expanded in B around 0 42.5%
associate-*r/42.5%
neg-mul-142.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in x around 0 42.5%
associate-*r/42.5%
neg-mul-142.5%
div-sub42.5%
sub-neg42.5%
metadata-eval42.5%
+-commutative42.5%
unsub-neg42.5%
Simplified42.5%
if -1.40000000000000005e-76 < F < 8.5999999999999995e-107Initial program 99.5%
Simplified99.7%
Taylor expanded in F around -inf 44.5%
Taylor expanded in B around 0 17.0%
associate-*r/17.0%
neg-mul-117.0%
+-commutative17.0%
Simplified17.0%
Taylor expanded in x around inf 32.1%
associate-*r/32.1%
neg-mul-132.1%
Simplified32.1%
if 8.5999999999999995e-107 < F Initial program 72.4%
Simplified82.2%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 42.5%
Final simplification39.3%
(FPCore (F B x) :precision binary64 (if (or (<= x -6.5e-146) (not (<= x 1.22e-21))) (/ x (- B)) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -6.5e-146) || !(x <= 1.22e-21)) {
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 <= (-6.5d-146)) .or. (.not. (x <= 1.22d-21))) 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 <= -6.5e-146) || !(x <= 1.22e-21)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -6.5e-146) or not (x <= 1.22e-21): tmp = x / -B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -6.5e-146) || !(x <= 1.22e-21)) tmp = Float64(x / Float64(-B)); else tmp = Float64(-1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -6.5e-146) || ~((x <= 1.22e-21))) tmp = x / -B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -6.5e-146], N[Not[LessEqual[x, 1.22e-21]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-146} \lor \neg \left(x \leq 1.22 \cdot 10^{-21}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -6.4999999999999999e-146 or 1.21999999999999991e-21 < x Initial program 82.4%
Simplified92.8%
Taylor expanded in F around -inf 79.4%
Taylor expanded in B around 0 37.4%
associate-*r/37.4%
neg-mul-137.4%
+-commutative37.4%
Simplified37.4%
Taylor expanded in x around inf 40.7%
associate-*r/40.7%
neg-mul-140.7%
Simplified40.7%
if -6.4999999999999999e-146 < x < 1.21999999999999991e-21Initial program 70.9%
Simplified74.7%
Taylor expanded in F around -inf 31.0%
Taylor expanded in B around 0 17.3%
associate-*r/17.3%
neg-mul-117.3%
+-commutative17.3%
Simplified17.3%
Taylor expanded in x around 0 17.3%
Final simplification30.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.22e-76) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.22e-76) {
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 <= (-1.22d-76)) 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 <= -1.22e-76) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.22e-76: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.22e-76) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.22e-76) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.22e-76], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.22 \cdot 10^{-76}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -1.22e-76Initial program 62.5%
Simplified74.6%
Taylor expanded in F around -inf 89.9%
Taylor expanded in B around 0 42.5%
associate-*r/42.5%
neg-mul-142.5%
+-commutative42.5%
Simplified42.5%
Taylor expanded in x around 0 42.5%
associate-*r/42.5%
neg-mul-142.5%
div-sub42.5%
sub-neg42.5%
metadata-eval42.5%
+-commutative42.5%
unsub-neg42.5%
Simplified42.5%
if -1.22e-76 < F Initial program 84.9%
Simplified90.3%
Taylor expanded in F around -inf 43.3%
Taylor expanded in B around 0 22.0%
associate-*r/22.0%
neg-mul-122.0%
+-commutative22.0%
Simplified22.0%
Taylor expanded in x around inf 29.3%
associate-*r/29.3%
neg-mul-129.3%
Simplified29.3%
Final simplification33.7%
(FPCore (F B x) :precision binary64 (if (<= F 3.2e-167) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 3.2e-167) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 3.2d-167) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 3.2e-167) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 3.2e-167: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 3.2e-167) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 3.2e-167) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 3.2e-167], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.2 \cdot 10^{-167}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 3.2000000000000002e-167Initial program 79.1%
Simplified85.8%
Taylor expanded in F around -inf 69.2%
Taylor expanded in B around 0 30.8%
associate-*r/30.8%
neg-mul-130.8%
+-commutative30.8%
Simplified30.8%
Taylor expanded in x around 0 15.0%
if 3.2000000000000002e-167 < F Initial program 75.1%
Taylor expanded in B around 0 55.8%
Taylor expanded in F around inf 49.4%
Taylor expanded in x around 0 17.6%
associate-/r*17.6%
Simplified17.6%
Taylor expanded in F around inf 16.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 77.5%
Simplified85.1%
Taylor expanded in F around -inf 58.8%
Taylor expanded in B around 0 28.8%
associate-*r/28.8%
neg-mul-128.8%
+-commutative28.8%
Simplified28.8%
Taylor expanded in x around 0 10.2%
herbie shell --seed 2024129
(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))))))