
(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 26 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 -1e+32)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1050.0)
(-
(* F (pow (/ (sin B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) -1.0))
t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+32) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1050.0) {
tmp = (F * pow((sin(B) / pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)), -1.0)) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+32) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1050.0) tmp = Float64(Float64(F * (Float64(sin(B) / (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) ^ -1.0)) - t_0); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1050.0], N[(N[(F * N[Power[N[(N[Sin[B], $MachinePrecision] / N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1050:\\
\;\;\;\;F \cdot {\left(\frac{\sin B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}\right)}^{-1} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.00000000000000005e32Initial program 59.3%
Simplified71.2%
clear-num71.3%
inv-pow71.3%
fma-def71.3%
fma-udef71.3%
*-commutative71.3%
fma-def71.3%
fma-def71.3%
Applied egg-rr71.3%
Taylor expanded in F around -inf 99.8%
if -1.00000000000000005e32 < F < 1050Initial program 99.5%
Simplified99.6%
clear-num99.7%
inv-pow99.7%
fma-def99.7%
fma-udef99.7%
*-commutative99.7%
fma-def99.7%
fma-def99.7%
Applied egg-rr99.7%
if 1050 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+32)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5.3e+20)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+32) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5.3e+20) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+32) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5.3e+20) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.3e+20], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 5.3 \cdot 10^{+20}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.00000000000000005e32Initial program 59.3%
Simplified71.2%
clear-num71.3%
inv-pow71.3%
fma-def71.3%
fma-udef71.3%
*-commutative71.3%
fma-def71.3%
fma-def71.3%
Applied egg-rr71.3%
Taylor expanded in F around -inf 99.8%
if -1.00000000000000005e32 < F < 5.3e20Initial program 99.5%
Simplified99.6%
if 5.3e20 < F Initial program 52.5%
Simplified74.3%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))))
(if (<= F -50000000000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1050.0)
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ t_0 (sin B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double tmp;
if (F <= -50000000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1050.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (t_0 / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * cos(b)
if (f <= (-50000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1050.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (t_0 / sin(b))
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * Math.cos(B);
double tmp;
if (F <= -50000000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1050.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (t_0 / Math.sin(B));
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x * math.cos(B) tmp = 0 if F <= -50000000000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1050.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (t_0 / math.sin(B)) else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x * cos(B)) tmp = 0.0 if (F <= -50000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1050.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(t_0 / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * cos(B); tmp = 0.0; if (F <= -50000000000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1050.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (t_0 / sin(B)); else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -50000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1050.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[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
\mathbf{if}\;F \leq -50000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1050:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{t_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t_0}{\sin B}\\
\end{array}
\end{array}
if F < -5e10Initial program 60.6%
Simplified72.1%
clear-num72.2%
inv-pow72.2%
fma-def72.2%
fma-udef72.2%
*-commutative72.2%
fma-def72.2%
fma-def72.2%
Applied egg-rr72.2%
Taylor expanded in F around -inf 99.8%
if -5e10 < F < 1050Initial program 99.5%
Taylor expanded in x around 0 99.5%
if 1050 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3.4e+27)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1050.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e+27) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1050.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.4d+27)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1050.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e+27) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1050.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 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.4e+27: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1050.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 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.4e+27) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1050.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 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.4e+27) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1050.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B))); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.4e+27], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1050.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[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.4 \cdot 10^{+27}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1050:\\
\;\;\;\;\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 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -3.4e27Initial program 59.3%
Simplified71.2%
clear-num71.3%
inv-pow71.3%
fma-def71.3%
fma-udef71.3%
*-commutative71.3%
fma-def71.3%
fma-def71.3%
Applied egg-rr71.3%
Taylor expanded in F around -inf 99.8%
if -3.4e27 < F < 1050Initial program 99.5%
if 1050 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+16)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1050.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ -1.0 (/ (tan B) x)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+16) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1050.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (-1.0 / (tan(B) / x));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1d+16)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1050.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + ((-1.0d0) / (tan(b) / x))
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1e+16) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1050.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 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1e+16: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1050.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 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1e+16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1050.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 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1e+16) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1050.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (-1.0 / (tan(B) / x)); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1e+16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1050.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[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1050:\\
\;\;\;\;\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 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1e16Initial program 60.6%
Simplified72.1%
clear-num72.2%
inv-pow72.2%
fma-def72.2%
fma-udef72.2%
*-commutative72.2%
fma-def72.2%
fma-def72.2%
Applied egg-rr72.2%
Taylor expanded in F around -inf 99.8%
if -1e16 < F < 1050Initial program 99.5%
div-inv99.6%
clear-num99.5%
Applied egg-rr99.5%
if 1050 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 62.4%
Simplified73.3%
clear-num73.4%
inv-pow73.4%
fma-def73.4%
fma-udef73.4%
*-commutative73.4%
fma-def73.4%
fma-def73.4%
Applied egg-rr73.4%
Taylor expanded in F around -inf 98.1%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.2%
Taylor expanded in x around 0 99.2%
if 1.44999999999999996 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification99.1%
(FPCore (F B x)
:precision binary64
(if (<= F -205000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 52.0)
(+
(/ -1.0 (/ (tan B) x))
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -205000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 52.0) {
tmp = (-1.0 / (tan(B) / x)) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-205000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 52.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b))
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -205000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 52.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -205000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 52.0: tmp = (-1.0 / (math.tan(B) / x)) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -205000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 52.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -205000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 52.0) tmp = (-1.0 / (tan(B) / x)) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -205000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 52.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + 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]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -205000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 52:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -205000Initial program 60.6%
Simplified72.1%
clear-num72.2%
inv-pow72.2%
fma-def72.2%
fma-udef72.2%
*-commutative72.2%
fma-def72.2%
fma-def72.2%
Applied egg-rr72.2%
Taylor expanded in F around -inf 99.8%
if -205000 < F < 52Initial program 99.5%
div-inv99.6%
clear-num99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 85.3%
if 52 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification92.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e-11)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.6)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e-11) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.6) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2d-11)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.6d0) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2e-11) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.6) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2e-11: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.6: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e-11) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.6) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2e-11) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.6) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.6], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.6:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.99999999999999988e-11Initial program 63.5%
Simplified74.1%
clear-num74.2%
inv-pow74.2%
fma-def74.2%
fma-udef74.2%
*-commutative74.2%
fma-def74.2%
fma-def74.2%
Applied egg-rr74.2%
Taylor expanded in F around -inf 95.6%
if -1.99999999999999988e-11 < F < 0.599999999999999978Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.2%
Taylor expanded in B around 0 86.0%
if 0.599999999999999978 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification92.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e-11)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.27)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e-11) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.27) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2d-11)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.27d0) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2e-11) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.27) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2e-11: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.27: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e-11) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.27) 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 - 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 <= -2e-11) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.27) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.27], 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[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.27:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.99999999999999988e-11Initial program 63.5%
Simplified74.1%
clear-num74.2%
inv-pow74.2%
fma-def74.2%
fma-udef74.2%
*-commutative74.2%
fma-def74.2%
fma-def74.2%
Applied egg-rr74.2%
Taylor expanded in F around -inf 95.6%
if -1.99999999999999988e-11 < F < 0.27000000000000002Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.2%
Taylor expanded in B around 0 86.0%
if 0.27000000000000002 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Final simplification92.4%
(FPCore (F B x)
:precision binary64
(if (<= F -3.4e-58)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.8e-73)
(/ (- x) (/ (sin B) (cos B)))
(if (<= F 5.2e-30)
(/ F (/ (sin B) (sqrt 0.5)))
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e-58) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.8e-73) {
tmp = -x / (sin(B) / cos(B));
} else if (F <= 5.2e-30) {
tmp = F / (sin(B) / sqrt(0.5));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.4d-58)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.8d-73) then
tmp = -x / (sin(b) / cos(b))
else if (f <= 5.2d-30) then
tmp = f / (sin(b) / sqrt(0.5d0))
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e-58) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.8e-73) {
tmp = -x / (Math.sin(B) / Math.cos(B));
} else if (F <= 5.2e-30) {
tmp = F / (Math.sin(B) / Math.sqrt(0.5));
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.4e-58: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.8e-73: tmp = -x / (math.sin(B) / math.cos(B)) elif F <= 5.2e-30: tmp = F / (math.sin(B) / math.sqrt(0.5)) else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.4e-58) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.8e-73) tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B))); elseif (F <= 5.2e-30) tmp = Float64(F / Float64(sin(B) / sqrt(0.5))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.4e-58) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.8e-73) tmp = -x / (sin(B) / cos(B)); elseif (F <= 5.2e-30) tmp = F / (sin(B) / sqrt(0.5)); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.4e-58], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-73], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e-30], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.4 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -3.39999999999999973e-58Initial program 67.2%
Simplified76.8%
clear-num76.9%
inv-pow76.9%
fma-def76.9%
fma-udef76.9%
*-commutative76.9%
fma-def76.9%
fma-def76.9%
Applied egg-rr76.9%
Taylor expanded in F around -inf 91.2%
if -3.39999999999999973e-58 < F < 1.8e-73Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 89.6%
Taylor expanded in F around 0 76.8%
mul-1-neg76.8%
associate-/l*76.8%
distribute-neg-frac76.8%
Simplified76.8%
if 1.8e-73 < F < 5.19999999999999973e-30Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.4%
Taylor expanded in x around 0 99.1%
associate-/l*99.7%
Simplified99.7%
if 5.19999999999999973e-30 < F Initial program 59.1%
Simplified77.8%
Taylor expanded in F around inf 96.2%
associate-/r*96.2%
Simplified96.2%
Taylor expanded in F around 0 96.4%
div-sub96.4%
Simplified96.4%
Final simplification87.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2.3e-18)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 5.5e-72)
(* x (/ (- (cos B)) (sin B)))
(if (<= F 5.6e-30)
(/ F (/ (sin B) (sqrt 0.5)))
(if (<= F 1.6e+96)
(- (/ 1.0 B) (/ x (tan B)))
(/ (- 1.0 x) (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-18) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5.5e-72) {
tmp = x * (-cos(B) / sin(B));
} else if (F <= 5.6e-30) {
tmp = F / (sin(B) / sqrt(0.5));
} else if (F <= 1.6e+96) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 - 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 <= (-2.3d-18)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5.5d-72) then
tmp = x * (-cos(b) / sin(b))
else if (f <= 5.6d-30) then
tmp = f / (sin(b) / sqrt(0.5d0))
else if (f <= 1.6d+96) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-18) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5.5e-72) {
tmp = x * (-Math.cos(B) / Math.sin(B));
} else if (F <= 5.6e-30) {
tmp = F / (Math.sin(B) / Math.sqrt(0.5));
} else if (F <= 1.6e+96) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e-18: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5.5e-72: tmp = x * (-math.cos(B) / math.sin(B)) elif F <= 5.6e-30: tmp = F / (math.sin(B) / math.sqrt(0.5)) elif F <= 1.6e+96: tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e-18) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5.5e-72) tmp = Float64(x * Float64(Float64(-cos(B)) / sin(B))); elseif (F <= 5.6e-30) tmp = Float64(F / Float64(sin(B) / sqrt(0.5))); elseif (F <= 1.6e+96) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.3e-18) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5.5e-72) tmp = x * (-cos(B) / sin(B)); elseif (F <= 5.6e-30) tmp = F / (sin(B) / sqrt(0.5)); elseif (F <= 1.6e+96) tmp = (1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.5e-72], N[(x * N[((-N[Cos[B], $MachinePrecision]) / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-30], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e+96], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-72}:\\
\;\;\;\;x \cdot \frac{-\cos B}{\sin B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-30}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{+96}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -2.3000000000000001e-18Initial program 64.0%
Taylor expanded in F around -inf 94.2%
Taylor expanded in B around 0 72.4%
if -2.3000000000000001e-18 < F < 5.49999999999999994e-72Initial program 99.5%
Taylor expanded in F around -inf 35.8%
Taylor expanded in x around inf 75.5%
mul-1-neg75.5%
associate-*r/75.5%
distribute-rgt-neg-in75.5%
Simplified75.5%
if 5.49999999999999994e-72 < F < 5.59999999999999977e-30Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.4%
Taylor expanded in x around 0 99.1%
associate-/l*99.7%
Simplified99.7%
if 5.59999999999999977e-30 < F < 1.60000000000000003e96Initial program 92.5%
Simplified99.5%
Taylor expanded in F around inf 90.0%
associate-/r*90.0%
Simplified90.0%
Taylor expanded in B around 0 72.5%
if 1.60000000000000003e96 < F Initial program 40.7%
Simplified65.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 85.9%
Final simplification76.9%
(FPCore (F B x)
:precision binary64
(if (<= F -2.3e-18)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.08e-72)
(/ (- x) (/ (sin B) (cos B)))
(if (<= F 5.2e-30)
(/ F (/ (sin B) (sqrt 0.5)))
(if (<= F 1.6e+96)
(- (/ 1.0 B) (/ x (tan B)))
(/ (- 1.0 x) (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-18) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.08e-72) {
tmp = -x / (sin(B) / cos(B));
} else if (F <= 5.2e-30) {
tmp = F / (sin(B) / sqrt(0.5));
} else if (F <= 1.6e+96) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 - 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 <= (-2.3d-18)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.08d-72) then
tmp = -x / (sin(b) / cos(b))
else if (f <= 5.2d-30) then
tmp = f / (sin(b) / sqrt(0.5d0))
else if (f <= 1.6d+96) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-18) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.08e-72) {
tmp = -x / (Math.sin(B) / Math.cos(B));
} else if (F <= 5.2e-30) {
tmp = F / (Math.sin(B) / Math.sqrt(0.5));
} else if (F <= 1.6e+96) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e-18: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.08e-72: tmp = -x / (math.sin(B) / math.cos(B)) elif F <= 5.2e-30: tmp = F / (math.sin(B) / math.sqrt(0.5)) elif F <= 1.6e+96: tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e-18) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.08e-72) tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B))); elseif (F <= 5.2e-30) tmp = Float64(F / Float64(sin(B) / sqrt(0.5))); elseif (F <= 1.6e+96) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.3e-18) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.08e-72) tmp = -x / (sin(B) / cos(B)); elseif (F <= 5.2e-30) tmp = F / (sin(B) / sqrt(0.5)); elseif (F <= 1.6e+96) tmp = (1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.08e-72], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e-30], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e+96], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.08 \cdot 10^{-72}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{+96}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -2.3000000000000001e-18Initial program 64.0%
Taylor expanded in F around -inf 94.2%
Taylor expanded in B around 0 72.4%
if -2.3000000000000001e-18 < F < 1.07999999999999998e-72Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 88.4%
Taylor expanded in F around 0 75.5%
mul-1-neg75.5%
associate-/l*75.5%
distribute-neg-frac75.5%
Simplified75.5%
if 1.07999999999999998e-72 < F < 5.19999999999999973e-30Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.4%
Taylor expanded in x around 0 99.1%
associate-/l*99.7%
Simplified99.7%
if 5.19999999999999973e-30 < F < 1.60000000000000003e96Initial program 92.5%
Simplified99.5%
Taylor expanded in F around inf 90.0%
associate-/r*90.0%
Simplified90.0%
Taylor expanded in B around 0 72.5%
if 1.60000000000000003e96 < F Initial program 40.7%
Simplified65.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 85.9%
Final simplification76.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.2e-58)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4e-74)
(/ (- x) (/ (sin B) (cos B)))
(if (<= F 4.9e-30)
(/ F (/ (sin B) (sqrt 0.5)))
(if (<= F 1.65e+96) (- (/ 1.0 B) t_0) (/ (- 1.0 x) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.2e-58) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4e-74) {
tmp = -x / (sin(B) / cos(B));
} else if (F <= 4.9e-30) {
tmp = F / (sin(B) / sqrt(0.5));
} else if (F <= 1.65e+96) {
tmp = (1.0 / B) - t_0;
} else {
tmp = (1.0 - 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 <= (-3.2d-58)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d-74) then
tmp = -x / (sin(b) / cos(b))
else if (f <= 4.9d-30) then
tmp = f / (sin(b) / sqrt(0.5d0))
else if (f <= 1.65d+96) then
tmp = (1.0d0 / b) - t_0
else
tmp = (1.0d0 - 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 <= -3.2e-58) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4e-74) {
tmp = -x / (Math.sin(B) / Math.cos(B));
} else if (F <= 4.9e-30) {
tmp = F / (Math.sin(B) / Math.sqrt(0.5));
} else if (F <= 1.65e+96) {
tmp = (1.0 / B) - t_0;
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.2e-58: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4e-74: tmp = -x / (math.sin(B) / math.cos(B)) elif F <= 4.9e-30: tmp = F / (math.sin(B) / math.sqrt(0.5)) elif F <= 1.65e+96: tmp = (1.0 / B) - t_0 else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.2e-58) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4e-74) tmp = Float64(Float64(-x) / Float64(sin(B) / cos(B))); elseif (F <= 4.9e-30) tmp = Float64(F / Float64(sin(B) / sqrt(0.5))); elseif (F <= 1.65e+96) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3.2e-58) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4e-74) tmp = -x / (sin(B) / cos(B)); elseif (F <= 4.9e-30) tmp = F / (sin(B) / sqrt(0.5)); elseif (F <= 1.65e+96) tmp = (1.0 / B) - t_0; else tmp = (1.0 - 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, -3.2e-58], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4e-74], N[((-x) / N[(N[Sin[B], $MachinePrecision] / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.9e-30], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e+96], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-74}:\\
\;\;\;\;\frac{-x}{\frac{\sin B}{\cos B}}\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{-30}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{+96}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -3.2000000000000001e-58Initial program 67.2%
Simplified76.8%
clear-num76.9%
inv-pow76.9%
fma-def76.9%
fma-udef76.9%
*-commutative76.9%
fma-def76.9%
fma-def76.9%
Applied egg-rr76.9%
Taylor expanded in F around -inf 91.2%
if -3.2000000000000001e-58 < F < 1.39999999999999994e-74Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 89.6%
Taylor expanded in F around 0 76.8%
mul-1-neg76.8%
associate-/l*76.8%
distribute-neg-frac76.8%
Simplified76.8%
if 1.39999999999999994e-74 < F < 4.89999999999999971e-30Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.4%
Taylor expanded in x around 0 99.1%
associate-/l*99.7%
Simplified99.7%
if 4.89999999999999971e-30 < F < 1.64999999999999992e96Initial program 92.5%
Simplified99.5%
Taylor expanded in F around inf 90.0%
associate-/r*90.0%
Simplified90.0%
Taylor expanded in B around 0 72.5%
if 1.64999999999999992e96 < F Initial program 40.7%
Simplified65.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 85.9%
Final simplification82.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+88)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -8.6e-280)
(- (/ -1.0 B) (* x (/ 1.0 (tan B))))
(if (<= F 780.0)
(-
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B))
(+ (/ x B) (* -0.3333333333333333 (* B x))))
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+88) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -8.6e-280) {
tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
} else if (F <= 780.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
} else {
tmp = (1.0 - 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 <= (-2d+88)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-8.6d-280)) then
tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
else if (f <= 780.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2e+88) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -8.6e-280) {
tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
} else if (F <= 780.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e+88: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -8.6e-280: tmp = (-1.0 / B) - (x * (1.0 / math.tan(B))) elif F <= 780.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (B * x))) else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e+88) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -8.6e-280) tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 780.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2e+88) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -8.6e-280) tmp = (-1.0 / B) - (x * (1.0 / tan(B))); elseif (F <= 780.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (B * x))); else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e+88], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.6e-280], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 780.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[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+88}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -8.6 \cdot 10^{-280}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 780:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1.99999999999999992e88Initial program 52.4%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 79.9%
if -1.99999999999999992e88 < F < -8.5999999999999997e-280Initial program 99.5%
Taylor expanded in F around -inf 52.9%
Taylor expanded in B around 0 60.7%
if -8.5999999999999997e-280 < F < 780Initial program 99.4%
Taylor expanded in B around 0 63.0%
Taylor expanded in B around 0 58.4%
if 780 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 81.9%
Final simplification69.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.8e+88)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -9e-280)
(- (/ -1.0 B) (* x (/ 1.0 (tan B))))
(if (<= F 0.125)
(-
(+
(* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(* (* B x) 0.3333333333333333))
(/ x B))
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e+88) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -9e-280) {
tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
} else if (F <= 0.125) {
tmp = (((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) + ((B * x) * 0.3333333333333333)) - (x / B);
} else {
tmp = (1.0 - 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 <= (-3.8d+88)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-9d-280)) then
tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
else if (f <= 0.125d0) then
tmp = (((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) + ((b * x) * 0.3333333333333333d0)) - (x / b)
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e+88) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -9e-280) {
tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
} else if (F <= 0.125) {
tmp = (((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) + ((B * x) * 0.3333333333333333)) - (x / B);
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.8e+88: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -9e-280: tmp = (-1.0 / B) - (x * (1.0 / math.tan(B))) elif F <= 0.125: tmp = (((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) + ((B * x) * 0.3333333333333333)) - (x / B) else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.8e+88) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -9e-280) tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 0.125) tmp = Float64(Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) + Float64(Float64(B * x) * 0.3333333333333333)) - Float64(x / B)); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.8e+88) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -9e-280) tmp = (-1.0 / B) - (x * (1.0 / tan(B))); elseif (F <= 0.125) tmp = (((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) + ((B * x) * 0.3333333333333333)) - (x / B); else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.8e+88], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9e-280], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.125], N[(N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(B * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.8 \cdot 10^{+88}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -9 \cdot 10^{-280}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 0.125:\\
\;\;\;\;\left(\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} + \left(B \cdot x\right) \cdot 0.3333333333333333\right) - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -3.7999999999999997e88Initial program 52.4%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 79.9%
if -3.7999999999999997e88 < F < -8.9999999999999991e-280Initial program 99.5%
Taylor expanded in F around -inf 52.9%
Taylor expanded in B around 0 60.7%
if -8.9999999999999991e-280 < F < 0.125Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 98.9%
Taylor expanded in B around 0 85.9%
Taylor expanded in B around 0 57.5%
if 0.125 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 81.9%
Final simplification69.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2.2e+88)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1e-276)
(- (/ -1.0 B) (* x (/ 1.0 (tan B))))
(if (<= F 0.2)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.2e+88) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1e-276) {
tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
} else if (F <= 0.2) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 - 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 <= (-2.2d+88)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1d-276) then
tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
else if (f <= 0.2d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.2e+88) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1e-276) {
tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
} else if (F <= 0.2) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.2e+88: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1e-276: tmp = (-1.0 / B) - (x * (1.0 / math.tan(B))) elif F <= 0.2: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.2e+88) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1e-276) tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 0.2) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.2e+88) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1e-276) tmp = (-1.0 / B) - (x * (1.0 / tan(B))); elseif (F <= 0.2) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.2e+88], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-276], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.2], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.2 \cdot 10^{+88}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 10^{-276}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 0.2:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -2.20000000000000009e88Initial program 52.4%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 79.9%
if -2.20000000000000009e88 < F < 1e-276Initial program 99.5%
Taylor expanded in F around -inf 48.0%
Taylor expanded in B around 0 58.9%
if 1e-276 < F < 0.20000000000000001Initial program 99.3%
Simplified99.7%
Taylor expanded in F around 0 98.6%
Taylor expanded in B around 0 58.4%
if 0.20000000000000001 < F Initial program 54.5%
Simplified75.4%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 81.9%
Final simplification69.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ 1.0 B) (/ x (tan B)))))
(if (<= F -2.3e-18)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.2e-276)
t_0
(if (<= F 1e-192)
(* x (+ (* B 0.3333333333333333) (/ -1.0 B)))
(if (<= F 1.7e+96) t_0 (/ (- 1.0 x) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = (1.0 / B) - (x / tan(B));
double tmp;
if (F <= -2.3e-18) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.2e-276) {
tmp = t_0;
} else if (F <= 1e-192) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
} else if (F <= 1.7e+96) {
tmp = t_0;
} else {
tmp = (1.0 - 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 = (1.0d0 / b) - (x / tan(b))
if (f <= (-2.3d-18)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.2d-276) then
tmp = t_0
else if (f <= 1d-192) then
tmp = x * ((b * 0.3333333333333333d0) + ((-1.0d0) / b))
else if (f <= 1.7d+96) then
tmp = t_0
else
tmp = (1.0d0 - x) / 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 <= -2.3e-18) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.2e-276) {
tmp = t_0;
} else if (F <= 1e-192) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
} else if (F <= 1.7e+96) {
tmp = t_0;
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = (1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -2.3e-18: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.2e-276: tmp = t_0 elif F <= 1e-192: tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)) elif F <= 1.7e+96: tmp = t_0 else: tmp = (1.0 - x) / 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 <= -2.3e-18) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.2e-276) tmp = t_0; elseif (F <= 1e-192) tmp = Float64(x * Float64(Float64(B * 0.3333333333333333) + Float64(-1.0 / B))); elseif (F <= 1.7e+96) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / 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 <= -2.3e-18) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.2e-276) tmp = t_0; elseif (F <= 1e-192) tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)); elseif (F <= 1.7e+96) tmp = t_0; else tmp = (1.0 - x) / 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, -2.3e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e-276], t$95$0, If[LessEqual[F, 1e-192], N[(x * N[(N[(B * 0.3333333333333333), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e+96], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-276}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 10^{-192}:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333 + \frac{-1}{B}\right)\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{+96}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -2.3000000000000001e-18Initial program 64.0%
Taylor expanded in F around -inf 94.2%
Taylor expanded in B around 0 72.4%
if -2.3000000000000001e-18 < F < 1.19999999999999991e-276 or 1.0000000000000001e-192 < F < 1.7e96Initial program 97.8%
Simplified99.6%
Taylor expanded in F around inf 43.8%
associate-/r*43.8%
Simplified43.8%
Taylor expanded in B around 0 56.5%
if 1.19999999999999991e-276 < F < 1.0000000000000001e-192Initial program 99.6%
Taylor expanded in B around 0 70.4%
Taylor expanded in F around inf 9.6%
Taylor expanded in x around -inf 64.7%
if 1.7e96 < F Initial program 40.7%
Simplified65.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 85.9%
Final simplification67.2%
(FPCore (F B x)
:precision binary64
(if (<= F -3.8e+88)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -3e-279)
(- (/ -1.0 B) (* x (/ 1.0 (tan B))))
(if (<= F 6e-193)
(* x (+ (* B 0.3333333333333333) (/ -1.0 B)))
(if (<= F 1.7e+96)
(- (/ 1.0 B) (/ x (tan B)))
(/ (- 1.0 x) (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e+88) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -3e-279) {
tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
} else if (F <= 6e-193) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
} else if (F <= 1.7e+96) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 - 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 <= (-3.8d+88)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-3d-279)) then
tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
else if (f <= 6d-193) then
tmp = x * ((b * 0.3333333333333333d0) + ((-1.0d0) / b))
else if (f <= 1.7d+96) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e+88) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -3e-279) {
tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
} else if (F <= 6e-193) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
} else if (F <= 1.7e+96) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.8e+88: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -3e-279: tmp = (-1.0 / B) - (x * (1.0 / math.tan(B))) elif F <= 6e-193: tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)) elif F <= 1.7e+96: tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.8e+88) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -3e-279) tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 6e-193) tmp = Float64(x * Float64(Float64(B * 0.3333333333333333) + Float64(-1.0 / B))); elseif (F <= 1.7e+96) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.8e+88) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -3e-279) tmp = (-1.0 / B) - (x * (1.0 / tan(B))); elseif (F <= 6e-193) tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)); elseif (F <= 1.7e+96) tmp = (1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.8e+88], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3e-279], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-193], N[(x * N[(N[(B * 0.3333333333333333), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e+96], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.8 \cdot 10^{+88}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -3 \cdot 10^{-279}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-193}:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333 + \frac{-1}{B}\right)\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{+96}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -3.7999999999999997e88Initial program 52.4%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 79.9%
if -3.7999999999999997e88 < F < -3e-279Initial program 99.5%
Taylor expanded in F around -inf 52.9%
Taylor expanded in B around 0 60.7%
if -3e-279 < F < 5.9999999999999998e-193Initial program 99.6%
Taylor expanded in B around 0 61.1%
Taylor expanded in F around inf 12.2%
Taylor expanded in x around -inf 58.1%
if 5.9999999999999998e-193 < F < 1.7e96Initial program 95.8%
Simplified99.5%
Taylor expanded in F around inf 60.4%
associate-/r*60.4%
Simplified60.4%
Taylor expanded in B around 0 56.4%
if 1.7e96 < F Initial program 40.7%
Simplified65.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in F around 0 99.8%
div-sub99.8%
Simplified99.8%
Taylor expanded in B around 0 85.9%
Final simplification68.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ 1.0 B) (/ x (tan B)))))
(if (<= x -1.35e-132)
t_0
(if (<= x 4.8e-149)
(/ 1.0 (sin B))
(if (<= x 0.00025) (/ (- x) B) t_0)))))
double code(double F, double B, double x) {
double t_0 = (1.0 / B) - (x / tan(B));
double tmp;
if (x <= -1.35e-132) {
tmp = t_0;
} else if (x <= 4.8e-149) {
tmp = 1.0 / sin(B);
} else if (x <= 0.00025) {
tmp = -x / 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 <= (-1.35d-132)) then
tmp = t_0
else if (x <= 4.8d-149) then
tmp = 1.0d0 / sin(b)
else if (x <= 0.00025d0) then
tmp = -x / 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 <= -1.35e-132) {
tmp = t_0;
} else if (x <= 4.8e-149) {
tmp = 1.0 / Math.sin(B);
} else if (x <= 0.00025) {
tmp = -x / 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 <= -1.35e-132: tmp = t_0 elif x <= 4.8e-149: tmp = 1.0 / math.sin(B) elif x <= 0.00025: tmp = -x / 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 <= -1.35e-132) tmp = t_0; elseif (x <= 4.8e-149) tmp = Float64(1.0 / sin(B)); elseif (x <= 0.00025) tmp = Float64(Float64(-x) / 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 <= -1.35e-132) tmp = t_0; elseif (x <= 4.8e-149) tmp = 1.0 / sin(B); elseif (x <= 0.00025) tmp = -x / 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, -1.35e-132], t$95$0, If[LessEqual[x, 4.8e-149], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00025], N[((-x) / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.35 \cdot 10^{-132}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{elif}\;x \leq 0.00025:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -1.34999999999999995e-132 or 2.5000000000000001e-4 < x Initial program 80.0%
Simplified94.1%
Taylor expanded in F around inf 74.3%
associate-/r*74.3%
Simplified74.3%
Taylor expanded in B around 0 83.5%
if -1.34999999999999995e-132 < x < 4.8000000000000002e-149Initial program 71.6%
Taylor expanded in B around 0 52.7%
Taylor expanded in F around inf 30.1%
Taylor expanded in x around 0 35.6%
if 4.8000000000000002e-149 < x < 2.5000000000000001e-4Initial program 81.0%
Simplified81.6%
Taylor expanded in F around inf 12.7%
associate-/r*12.5%
Simplified12.5%
Taylor expanded in B around 0 7.7%
Taylor expanded in x around inf 40.0%
neg-mul-140.0%
distribute-neg-frac40.0%
Simplified40.0%
Final simplification61.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.4e-57) (/ (- -1.0 x) B) (if (<= F 7.4e-75) (/ (- x) B) (/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.4e-75) {
tmp = -x / B;
} else {
tmp = (1.0 - 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.4d-57)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7.4d-75) then
tmp = -x / b
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.4e-75) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.4e-57: tmp = (-1.0 - x) / B elif F <= 7.4e-75: tmp = -x / B else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.4e-57) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7.4e-75) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.4e-57) tmp = (-1.0 - x) / B; elseif (F <= 7.4e-75) tmp = -x / B; else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.4e-57], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.4e-75], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7.4 \cdot 10^{-75}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1.4e-57Initial program 66.8%
Taylor expanded in F around -inf 92.2%
Taylor expanded in B around 0 43.3%
associate-*r/43.3%
mul-1-neg43.3%
Simplified43.3%
if -1.4e-57 < F < 7.40000000000000047e-75Initial program 99.5%
Simplified99.6%
Taylor expanded in F around inf 24.3%
associate-/r*24.3%
Simplified24.3%
Taylor expanded in B around 0 18.6%
Taylor expanded in x around inf 41.1%
neg-mul-141.1%
distribute-neg-frac41.1%
Simplified41.1%
if 7.40000000000000047e-75 < F Initial program 61.9%
Simplified79.4%
Taylor expanded in F around inf 91.1%
associate-/r*91.0%
Simplified91.0%
Taylor expanded in F around 0 91.2%
div-sub91.2%
Simplified91.2%
Taylor expanded in B around 0 73.8%
Final simplification52.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.8e-109)
(/ (- -1.0 x) B)
(if (<= F 11500.0)
(* x (+ (* B 0.3333333333333333) (/ -1.0 B)))
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 11500.0) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.8d-109)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 11500.0d0) then
tmp = x * ((b * 0.3333333333333333d0) + ((-1.0d0) / b))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 11500.0) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.8e-109: tmp = (-1.0 - x) / B elif F <= 11500.0: tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.8e-109) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 11500.0) tmp = Float64(x * Float64(Float64(B * 0.3333333333333333) + Float64(-1.0 / B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.8e-109) tmp = (-1.0 - x) / B; elseif (F <= 11500.0) tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.8e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 11500.0], N[(x * N[(N[(B * 0.3333333333333333), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 11500:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333 + \frac{-1}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.79999999999999979e-109Initial program 70.0%
Taylor expanded in F around -inf 85.5%
Taylor expanded in B around 0 40.7%
associate-*r/40.7%
mul-1-neg40.7%
Simplified40.7%
if -2.79999999999999979e-109 < F < 11500Initial program 99.5%
Taylor expanded in B around 0 60.1%
Taylor expanded in F around inf 21.4%
Taylor expanded in x around -inf 42.2%
if 11500 < F Initial program 53.9%
Taylor expanded in B around 0 28.2%
Taylor expanded in F around inf 64.3%
Taylor expanded in x around 0 58.4%
Final simplification46.2%
(FPCore (F B x)
:precision binary64
(if (<= F -2.8e-109)
(/ (- -1.0 x) B)
(if (<= F 1.4e-15)
(* x (+ (* B 0.3333333333333333) (/ -1.0 B)))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.8e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-15) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / 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.8d-109)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.4d-15) then
tmp = x * ((b * 0.3333333333333333d0) + ((-1.0d0) / 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.8e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-15) {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.8e-109: tmp = (-1.0 - x) / B elif F <= 1.4e-15: tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.8e-109) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4e-15) tmp = Float64(x * Float64(Float64(B * 0.3333333333333333) + Float64(-1.0 / 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.8e-109) tmp = (-1.0 - x) / B; elseif (F <= 1.4e-15) tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.8e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4e-15], N[(x * N[(N[(B * 0.3333333333333333), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333 + \frac{-1}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.79999999999999979e-109Initial program 70.0%
Taylor expanded in F around -inf 85.5%
Taylor expanded in B around 0 40.7%
associate-*r/40.7%
mul-1-neg40.7%
Simplified40.7%
if -2.79999999999999979e-109 < F < 1.40000000000000007e-15Initial program 99.5%
Taylor expanded in B around 0 59.5%
Taylor expanded in F around inf 20.1%
Taylor expanded in x around -inf 41.9%
if 1.40000000000000007e-15 < F Initial program 56.3%
Simplified76.4%
Taylor expanded in F around inf 98.4%
associate-/r*98.4%
Simplified98.4%
Taylor expanded in B around 0 46.6%
Final simplification42.9%
(FPCore (F B x) :precision binary64 (if (<= F -3.9e-58) (/ (- -1.0 x) B) (if (<= F 1.1e-62) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.9e-58) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.1e-62) {
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 <= (-3.9d-58)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.1d-62) 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 <= -3.9e-58) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.1e-62) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.9e-58: tmp = (-1.0 - x) / B elif F <= 1.1e-62: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.9e-58) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.1e-62) 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 <= -3.9e-58) tmp = (-1.0 - x) / B; elseif (F <= 1.1e-62) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.9e-58], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.1e-62], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.9 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-62}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.89999999999999992e-58Initial program 66.8%
Taylor expanded in F around -inf 92.2%
Taylor expanded in B around 0 43.3%
associate-*r/43.3%
mul-1-neg43.3%
Simplified43.3%
if -3.89999999999999992e-58 < F < 1.10000000000000009e-62Initial program 99.5%
Simplified99.6%
Taylor expanded in F around inf 24.9%
associate-/r*24.9%
Simplified24.9%
Taylor expanded in B around 0 18.3%
Taylor expanded in x around inf 40.3%
neg-mul-140.3%
distribute-neg-frac40.3%
Simplified40.3%
if 1.10000000000000009e-62 < F Initial program 61.0%
Simplified78.9%
Taylor expanded in F around inf 92.0%
associate-/r*91.9%
Simplified91.9%
Taylor expanded in B around 0 45.2%
Final simplification42.8%
(FPCore (F B x) :precision binary64 (if (<= F 3.1e-63) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 3.1e-63) {
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 <= 3.1d-63) 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 <= 3.1e-63) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 3.1e-63: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 3.1e-63) 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 <= 3.1e-63) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 3.1e-63], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.1 \cdot 10^{-63}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 3.09999999999999984e-63Initial program 85.3%
Simplified89.6%
Taylor expanded in F around inf 34.0%
associate-/r*34.0%
Simplified34.0%
Taylor expanded in B around 0 19.9%
Taylor expanded in x around inf 32.6%
neg-mul-132.6%
distribute-neg-frac32.6%
Simplified32.6%
if 3.09999999999999984e-63 < F Initial program 61.0%
Simplified78.9%
Taylor expanded in F around inf 92.0%
associate-/r*91.9%
Simplified91.9%
Taylor expanded in B around 0 45.2%
Final simplification36.7%
(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 77.4%
Simplified86.1%
Taylor expanded in F around inf 52.8%
associate-/r*52.8%
Simplified52.8%
Taylor expanded in B around 0 28.1%
Taylor expanded in x around inf 30.9%
neg-mul-130.9%
distribute-neg-frac30.9%
Simplified30.9%
Final simplification30.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 77.4%
Simplified86.1%
Taylor expanded in F around inf 52.8%
associate-/r*52.8%
Simplified52.8%
Taylor expanded in B around 0 28.1%
Taylor expanded in x around 0 8.7%
Final simplification8.7%
herbie shell --seed 2024011
(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))))))