
(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 -3.6e+36)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2750.0)
(- (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ (sin B) F)) 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 <= -3.6e+36) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2750.0) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / (sin(B) / F)) - 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 <= -3.6e+36) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2750.0) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / Float64(sin(B) / F)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(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, -3.6e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2750.0], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.6 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2750:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\frac{\sin B}{F}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\
\end{array}
\end{array}
if F < -3.5999999999999997e36Initial program 54.6%
Simplified67.7%
Taylor expanded in F around -inf 99.7%
if -3.5999999999999997e36 < F < 2750Initial program 99.4%
Simplified99.5%
associate-*r/99.6%
associate-*l/99.5%
*-commutative99.5%
clear-num99.5%
un-div-inv99.5%
fma-define99.5%
fma-undefine99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
Applied egg-rr99.5%
if 2750 < F Initial program 64.6%
Simplified80.7%
Taylor expanded in F around inf 99.7%
associate-/l*99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+37)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2750.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 <= -1e+37) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2750.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 <= -1e+37) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2750.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(x * Float64(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+37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2750.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[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+37}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2750:\\
\;\;\;\;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} - x \cdot \frac{\cos B}{\sin B}\\
\end{array}
\end{array}
if F < -9.99999999999999954e36Initial program 54.6%
Simplified67.7%
Taylor expanded in F around -inf 99.7%
if -9.99999999999999954e36 < F < 2750Initial program 99.4%
Simplified99.5%
if 2750 < F Initial program 64.6%
Simplified80.7%
Taylor expanded in F around inf 99.7%
associate-/l*99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -2e+38)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 2750.0)
(- (* F (* t_0 (sqrt (/ 1.0 (fma F F 2.0))))) t_1)
(- t_0 (* x (/ (cos B) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -2e+38) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 2750.0) {
tmp = (F * (t_0 * sqrt((1.0 / fma(F, F, 2.0))))) - t_1;
} else {
tmp = t_0 - (x * (cos(B) / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+38) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 2750.0) tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / fma(F, F, 2.0))))) - t_1); else tmp = Float64(t_0 - Float64(x * Float64(cos(B) / sin(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 2750.0], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+38}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 2750:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - x \cdot \frac{\cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.99999999999999995e38Initial program 54.6%
Simplified67.7%
Taylor expanded in F around -inf 99.7%
if -1.99999999999999995e38 < F < 2750Initial program 99.4%
Simplified99.5%
Taylor expanded in x around 0 99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
if 2750 < F Initial program 64.6%
Simplified80.7%
Taylor expanded in F around inf 99.7%
associate-/l*99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+37)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2750.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (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 <= -1e+37) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2750.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / 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 <= -1e+37) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2750.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(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+37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2750.0], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+37}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2750:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\
\end{array}
\end{array}
if F < -9.99999999999999954e36Initial program 54.6%
Simplified67.7%
Taylor expanded in F around -inf 99.7%
if -9.99999999999999954e36 < F < 2750Initial program 99.4%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
if 2750 < F Initial program 64.6%
Simplified80.7%
Taylor expanded in F around inf 99.7%
associate-/l*99.8%
Simplified99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -4.8e+36)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 2750.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) (* x (/ (cos B) (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.8e+36) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 2750.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - (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 <= (-4.8d+36)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 2750.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - (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 <= -4.8e+36) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 2750.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - (x * (Math.cos(B) / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.8e+36: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 2750.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - (x * (math.cos(B) / math.sin(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.8e+36) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 2750.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(cos(B) / sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.8e+36) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 2750.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - (x * (cos(B) / sin(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.8e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2750.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.8 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2750:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\
\end{array}
\end{array}
if F < -4.79999999999999985e36Initial program 54.6%
Simplified67.7%
Taylor expanded in F around -inf 99.7%
if -4.79999999999999985e36 < F < 2750Initial program 99.4%
metadata-eval99.4%
metadata-eval99.4%
Applied egg-rr99.4%
if 2750 < F Initial program 64.6%
Simplified80.7%
Taylor expanded in F around inf 99.7%
associate-/l*99.8%
Simplified99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.39)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.4e-156)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(if (<= F 2200.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(- (/ 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 <= -0.39) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.4e-156) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else if (F <= 2200.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / 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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.39d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.4d-156) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else if (f <= 2200.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / 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 t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.39) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.4e-156) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else if (F <= 2200.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x * (Math.cos(B) / Math.sin(B)));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.39: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.4e-156: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 elif F <= 2200.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 / math.sin(B)) - (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 <= -0.39) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.4e-156) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); elseif (F <= 2200.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(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 <= -0.39) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.4e-156) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; elseif (F <= 2200.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); 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, -0.39], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.4e-156], 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], If[LessEqual[F, 2200.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.39:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-156}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_0\\
\mathbf{elif}\;F \leq 2200:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\
\end{array}
\end{array}
if F < -0.39000000000000001Initial program 55.9%
Simplified68.6%
Taylor expanded in F around -inf 99.5%
if -0.39000000000000001 < F < 3.3999999999999999e-156Initial program 99.5%
Simplified99.5%
Taylor expanded in F around 0 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in B around 0 88.9%
if 3.3999999999999999e-156 < F < 2200Initial program 99.3%
Taylor expanded in B around 0 83.9%
associate-*r/83.9%
neg-mul-183.9%
Simplified83.9%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr83.9%
if 2200 < F Initial program 64.6%
Simplified80.7%
Taylor expanded in F around inf 99.7%
associate-/l*99.8%
Simplified99.8%
Final simplification93.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.6)
(- (/ (* F (sqrt 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 <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.6) {
tmp = ((F * sqrt(0.5)) / sin(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 <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.6d0) then
tmp = ((f * sqrt(0.5d0)) / sin(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 <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.6) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(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 <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.6: tmp = ((F * math.sqrt(0.5)) / math.sin(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 <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.6) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x * Float64(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 <= 0.6) tmp = ((F * sqrt(0.5)) / sin(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, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.6], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $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 0.6:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - x \cdot \frac{\cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 55.9%
Simplified68.6%
Taylor expanded in F around -inf 99.5%
if -1.3999999999999999 < F < 0.599999999999999978Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 98.9%
if 0.599999999999999978 < F Initial program 65.7%
Simplified81.3%
Taylor expanded in F around inf 98.5%
associate-/l*98.7%
Simplified98.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2.45e-79)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(if (<= F 6.5e-157)
(/ (* x (- (cos B))) (sin B))
(if (<= F 3.4e-6)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (sin 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 <= -1650000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2.45e-79) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 6.5e-157) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 3.4e-6) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(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 <= (-1650000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2.45d-79)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else if (f <= 6.5d-157) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 3.4d-6) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / sin(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 <= -1650000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2.45e-79) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 6.5e-157) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 3.4e-6) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / Math.sin(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 <= -1650000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2.45e-79: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B elif F <= 6.5e-157: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 3.4e-6: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / math.sin(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 <= -1650000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2.45e-79) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); elseif (F <= 6.5e-157) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 3.4e-6) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / sin(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 <= -1650000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2.45e-79) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; elseif (F <= 6.5e-157) tmp = (x * -cos(B)) / sin(B); elseif (F <= 3.4e-6) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(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, -1650000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.45e-79], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.5e-157], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e-6], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $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 -1650000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2.45 \cdot 10^{-79}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-157}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-6}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.65e6Initial program 55.2%
Simplified68.1%
Taylor expanded in F around -inf 99.7%
if -1.65e6 < F < -2.45e-79Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 99.2%
unpow299.2%
Applied egg-rr99.2%
if -2.45e-79 < F < 6.5000000000000002e-157Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
sqrt-div99.5%
metadata-eval99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 84.5%
mul-1-neg84.5%
Simplified84.5%
if 6.5000000000000002e-157 < F < 3.40000000000000006e-6Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 83.2%
if 3.40000000000000006e-6 < F Initial program 65.7%
Simplified81.3%
Taylor expanded in F around inf 98.7%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.47)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.2e-156)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(if (<= F 600.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.47) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.2e-156) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else if (F <= 600.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.47d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.2d-156) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else if (f <= 600.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.47) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.2e-156) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else if (F <= 600.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.47: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.2e-156: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 elif F <= 600.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.47) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.2e-156) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); elseif (F <= 600.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.47) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.2e-156) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; elseif (F <= 600.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.47], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.2e-156], 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], If[LessEqual[F, 600.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.47:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{-156}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_0\\
\mathbf{elif}\;F \leq 600:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.46999999999999997Initial program 55.9%
Simplified68.6%
Taylor expanded in F around -inf 99.5%
if -0.46999999999999997 < F < 2.1999999999999999e-156Initial program 99.5%
Simplified99.5%
Taylor expanded in F around 0 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in B around 0 88.9%
if 2.1999999999999999e-156 < F < 600Initial program 99.3%
Taylor expanded in B around 0 83.9%
associate-*r/83.9%
neg-mul-183.9%
Simplified83.9%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr83.9%
if 600 < F Initial program 64.6%
Simplified80.7%
Taylor expanded in F around inf 99.8%
Final simplification93.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -5.1e-79)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(if (<= F 2.2e-156)
(/ (* x (- (cos B))) (sin B))
(if (<= F 1.35e-5)
(* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.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 <= -1650000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -5.1e-79) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 2.2e-156) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 1.35e-5) {
tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1650000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-5.1d-79)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else if (f <= 2.2d-156) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 1.35d-5) then
tmp = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1650000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -5.1e-79) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 2.2e-156) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 1.35e-5) {
tmp = (F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.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 <= -1650000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -5.1e-79: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B elif F <= 2.2e-156: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 1.35e-5: tmp = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -5.1e-79) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); elseif (F <= 2.2e-156) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 1.35e-5) tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1650000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -5.1e-79) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; elseif (F <= 2.2e-156) tmp = (x * -cos(B)) / sin(B); elseif (F <= 1.35e-5) tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.1e-79], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e-156], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e-5], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(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 -1650000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -5.1 \cdot 10^{-79}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{-156}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.65e6Initial program 55.2%
Simplified68.1%
Taylor expanded in F around -inf 99.7%
if -1.65e6 < F < -5.0999999999999999e-79Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 99.2%
unpow299.2%
Applied egg-rr99.2%
if -5.0999999999999999e-79 < F < 2.1999999999999999e-156Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
sqrt-div99.5%
metadata-eval99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 84.5%
mul-1-neg84.5%
Simplified84.5%
if 2.1999999999999999e-156 < F < 1.3499999999999999e-5Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
sqrt-div99.1%
metadata-eval99.1%
+-commutative99.1%
*-commutative99.1%
fma-define99.1%
Applied egg-rr99.1%
Taylor expanded in F around inf 62.4%
if 1.3499999999999999e-5 < F Initial program 65.7%
Simplified81.3%
Taylor expanded in F around inf 98.7%
Final simplification89.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (t_1 (/ x (tan B))))
(if (<= F -0.43)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 4.8e-156)
(- (* F (* (/ 1.0 B) t_0)) t_1)
(if (<= F 0.105)
(- (* F (/ t_0 (sin B))) (/ x B))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / tan(B);
double tmp;
if (F <= -0.43) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 4.8e-156) {
tmp = (F * ((1.0 / B) * t_0)) - t_1;
} else if (F <= 0.105) {
tmp = (F * (t_0 / sin(B))) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = x / tan(b)
if (f <= (-0.43d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 4.8d-156) then
tmp = (f * ((1.0d0 / b) * t_0)) - t_1
else if (f <= 0.105d0) then
tmp = (f * (t_0 / sin(b))) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.43) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 4.8e-156) {
tmp = (F * ((1.0 / B) * t_0)) - t_1;
} else if (F <= 0.105) {
tmp = (F * (t_0 / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = x / math.tan(B) tmp = 0 if F <= -0.43: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 4.8e-156: tmp = (F * ((1.0 / B) * t_0)) - t_1 elif F <= 0.105: tmp = (F * (t_0 / math.sin(B))) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.43) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 4.8e-156) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * t_0)) - t_1); elseif (F <= 0.105) tmp = Float64(Float64(F * Float64(t_0 / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = x / tan(B); tmp = 0.0; if (F <= -0.43) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 4.8e-156) tmp = (F * ((1.0 / B) * t_0)) - t_1; elseif (F <= 0.105) tmp = (F * (t_0 / sin(B))) - (x / B); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 4.8e-156], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 0.105], N[(N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.43:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{-156}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot t\_0\right) - t\_1\\
\mathbf{elif}\;F \leq 0.105:\\
\;\;\;\;F \cdot \frac{t\_0}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -0.429999999999999993Initial program 55.9%
Simplified68.6%
Taylor expanded in F around -inf 99.5%
if -0.429999999999999993 < F < 4.8e-156Initial program 99.5%
Simplified99.5%
Taylor expanded in F around 0 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in B around 0 88.9%
if 4.8e-156 < F < 0.104999999999999996Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 83.2%
if 0.104999999999999996 < F Initial program 65.7%
Simplified81.3%
Taylor expanded in F around inf 98.7%
Final simplification93.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1650000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.12e-78)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(if (<= F 4.6e-156)
(/ (* x (- (cos B))) (sin B))
(if (<= F 0.0015)
(/ (* F (sqrt 0.5)) (sin B))
(- (/ 1.0 (sin B)) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1650000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.12e-78) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 4.6e-156) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 0.0015) {
tmp = (F * sqrt(0.5)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1650000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.12d-78)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else if (f <= 4.6d-156) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 0.0015d0) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1650000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.12e-78) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 4.6e-156) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 0.0015) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1650000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.12e-78: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B elif F <= 4.6e-156: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 0.0015: tmp = (F * math.sqrt(0.5)) / math.sin(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1650000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.12e-78) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); elseif (F <= 4.6e-156) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 0.0015) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1650000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.12e-78) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; elseif (F <= 4.6e-156) tmp = (x * -cos(B)) / sin(B); elseif (F <= 0.0015) tmp = (F * sqrt(0.5)) / sin(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1650000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.12e-78], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.6e-156], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0015], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1650000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.12 \cdot 10^{-78}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-156}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.0015:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.65e6Initial program 55.2%
Simplified68.1%
Taylor expanded in F around -inf 99.7%
if -1.65e6 < F < -1.12000000000000005e-78Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 99.2%
unpow299.2%
Applied egg-rr99.2%
if -1.12000000000000005e-78 < F < 4.5999999999999999e-156Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
sqrt-div99.5%
metadata-eval99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 84.5%
mul-1-neg84.5%
Simplified84.5%
if 4.5999999999999999e-156 < F < 0.0015Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
sqrt-div99.1%
metadata-eval99.1%
+-commutative99.1%
*-commutative99.1%
fma-define99.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 62.3%
if 0.0015 < F Initial program 65.7%
Simplified81.3%
Taylor expanded in F around inf 98.7%
Final simplification89.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1650000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -9.8e-79)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(if (<= F 4.8e-156)
(/ (* x (- (cos B))) (sin B))
(if (<= F 0.007)
(/ (* F (sqrt 0.5)) (sin B))
(- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1650000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -9.8e-79) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 4.8e-156) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 0.007) {
tmp = (F * sqrt(0.5)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1650000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-9.8d-79)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else if (f <= 4.8d-156) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 0.007d0) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1650000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -9.8e-79) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 4.8e-156) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 0.007) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1650000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -9.8e-79: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B elif F <= 4.8e-156: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 0.007: tmp = (F * math.sqrt(0.5)) / math.sin(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1650000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -9.8e-79) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); elseif (F <= 4.8e-156) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 0.007) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1650000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -9.8e-79) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; elseif (F <= 4.8e-156) tmp = (x * -cos(B)) / sin(B); elseif (F <= 0.007) tmp = (F * sqrt(0.5)) / sin(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1650000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.8e-79], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.8e-156], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.007], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1650000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -9.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{-156}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.007:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.65e6Initial program 55.2%
Simplified68.1%
Taylor expanded in F around -inf 99.7%
if -1.65e6 < F < -9.8000000000000001e-79Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 99.2%
unpow299.2%
Applied egg-rr99.2%
if -9.8000000000000001e-79 < F < 4.8e-156Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
sqrt-div99.5%
metadata-eval99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 84.5%
mul-1-neg84.5%
Simplified84.5%
if 4.8e-156 < F < 0.00700000000000000015Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
sqrt-div99.1%
metadata-eval99.1%
+-commutative99.1%
*-commutative99.1%
fma-define99.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 62.3%
if 0.00700000000000000015 < F Initial program 65.7%
Taylor expanded in B around 0 35.6%
associate-*r/35.6%
neg-mul-135.6%
Simplified35.6%
Taylor expanded in F around inf 68.7%
mul-1-neg68.7%
distribute-frac-neg68.7%
+-commutative68.7%
distribute-frac-neg68.7%
unsub-neg68.7%
Simplified68.7%
Final simplification81.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05e+43)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -8.5e-79)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(if (<= F 4.8e-156)
(/ (* x (- (cos B))) (sin B))
(if (<= F 0.000195)
(/ (* F (sqrt 0.5)) (sin B))
(- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e+43) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -8.5e-79) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 4.8e-156) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 0.000195) {
tmp = (F * sqrt(0.5)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.05d+43)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-8.5d-79)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else if (f <= 4.8d-156) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 0.000195d0) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e+43) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -8.5e-79) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else if (F <= 4.8e-156) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 0.000195) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.05e+43: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -8.5e-79: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B elif F <= 4.8e-156: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 0.000195: tmp = (F * math.sqrt(0.5)) / math.sin(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.05e+43) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -8.5e-79) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); elseif (F <= 4.8e-156) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 0.000195) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.05e+43) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -8.5e-79) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; elseif (F <= 4.8e-156) tmp = (x * -cos(B)) / sin(B); elseif (F <= 0.000195) tmp = (F * sqrt(0.5)) / sin(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.05e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.5e-79], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.8e-156], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.000195], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -8.5 \cdot 10^{-79}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{-156}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.000195:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.05000000000000001e43Initial program 54.5%
Simplified66.7%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 75.8%
if -1.05000000000000001e43 < F < -8.50000000000000029e-79Initial program 93.0%
Simplified99.6%
Taylor expanded in B around 0 92.3%
unpow292.3%
Applied egg-rr92.3%
if -8.50000000000000029e-79 < F < 4.8e-156Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
sqrt-div99.5%
metadata-eval99.5%
+-commutative99.5%
*-commutative99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 84.5%
mul-1-neg84.5%
Simplified84.5%
if 4.8e-156 < F < 1.94999999999999996e-4Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
sqrt-div99.1%
metadata-eval99.1%
+-commutative99.1%
*-commutative99.1%
fma-define99.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 62.3%
if 1.94999999999999996e-4 < F Initial program 65.7%
Taylor expanded in B around 0 35.6%
associate-*r/35.6%
neg-mul-135.6%
Simplified35.6%
Taylor expanded in F around inf 68.7%
mul-1-neg68.7%
distribute-frac-neg68.7%
+-commutative68.7%
distribute-frac-neg68.7%
unsub-neg68.7%
Simplified68.7%
Final simplification75.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
(if (<= F -0.39)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -2.8e-79)
(- (* t_0 (/ F B)) (/ x B))
(if (<= F 5.7e-140)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 4.2e-9)
(/ (- (* F t_0) x) B)
(- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double tmp;
if (F <= -0.39) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -2.8e-79) {
tmp = (t_0 * (F / B)) - (x / B);
} else if (F <= 5.7e-140) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 4.2e-9) {
tmp = ((F * t_0) - x) / B;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
if (f <= (-0.39d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-2.8d-79)) then
tmp = (t_0 * (f / b)) - (x / b)
else if (f <= 5.7d-140) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 4.2d-9) then
tmp = ((f * t_0) - x) / b
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double tmp;
if (F <= -0.39) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -2.8e-79) {
tmp = (t_0 * (F / B)) - (x / B);
} else if (F <= 5.7e-140) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 4.2e-9) {
tmp = ((F * t_0) - x) / B;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) tmp = 0 if F <= -0.39: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -2.8e-79: tmp = (t_0 * (F / B)) - (x / B) elif F <= 5.7e-140: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 4.2e-9: tmp = ((F * t_0) - x) / B else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) tmp = 0.0 if (F <= -0.39) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -2.8e-79) tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x / B)); elseif (F <= 5.7e-140) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 4.2e-9) tmp = Float64(Float64(Float64(F * t_0) - x) / B); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); tmp = 0.0; if (F <= -0.39) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -2.8e-79) tmp = (t_0 * (F / B)) - (x / B); elseif (F <= 5.7e-140) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 4.2e-9) tmp = ((F * t_0) - x) / B; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -0.39], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.8e-79], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.7e-140], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e-9], N[(N[(N[(F * t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{if}\;F \leq -0.39:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.8 \cdot 10^{-79}:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.7 \cdot 10^{-140}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{F \cdot t\_0 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.39000000000000001Initial program 55.9%
Simplified68.6%
Taylor expanded in F around -inf 99.5%
Taylor expanded in B around 0 75.5%
if -0.39000000000000001 < F < -2.80000000000000012e-79Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 99.3%
Taylor expanded in F around 0 91.9%
if -2.80000000000000012e-79 < F < 5.7e-140Initial program 99.5%
Simplified99.5%
Taylor expanded in F around -inf 45.5%
Taylor expanded in B around 0 60.3%
if 5.7e-140 < F < 4.20000000000000039e-9Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 57.5%
Taylor expanded in F around 0 57.5%
if 4.20000000000000039e-9 < F Initial program 66.7%
Taylor expanded in B around 0 37.6%
associate-*r/37.6%
neg-mul-137.6%
Simplified37.6%
Taylor expanded in F around inf 66.9%
mul-1-neg66.9%
distribute-frac-neg66.9%
+-commutative66.9%
distribute-frac-neg66.9%
unsub-neg66.9%
Simplified66.9%
Final simplification66.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)))
(if (<= F -0.39)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -1.7e-79)
t_0
(if (<= F 6e-141)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 4.2e-9) t_0 (- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double tmp;
if (F <= -0.39) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -1.7e-79) {
tmp = t_0;
} else if (F <= 6e-141) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 4.2e-9) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
if (f <= (-0.39d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-1.7d-79)) then
tmp = t_0
else if (f <= 6d-141) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 4.2d-9) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double tmp;
if (F <= -0.39) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -1.7e-79) {
tmp = t_0;
} else if (F <= 6e-141) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 4.2e-9) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B tmp = 0 if F <= -0.39: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -1.7e-79: tmp = t_0 elif F <= 6e-141: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 4.2e-9: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B) tmp = 0.0 if (F <= -0.39) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -1.7e-79) tmp = t_0; elseif (F <= 6e-141) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 4.2e-9) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; tmp = 0.0; if (F <= -0.39) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -1.7e-79) tmp = t_0; elseif (F <= 6e-141) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 4.2e-9) tmp = t_0; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -0.39], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.7e-79], t$95$0, If[LessEqual[F, 6e-141], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e-9], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{if}\;F \leq -0.39:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.7 \cdot 10^{-79}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-141}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.39000000000000001Initial program 55.9%
Simplified68.6%
Taylor expanded in F around -inf 99.5%
Taylor expanded in B around 0 75.5%
if -0.39000000000000001 < F < -1.69999999999999988e-79 or 5.99999999999999967e-141 < F < 4.20000000000000039e-9Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 67.0%
Taylor expanded in F around 0 65.3%
if -1.69999999999999988e-79 < F < 5.99999999999999967e-141Initial program 99.5%
Simplified99.5%
Taylor expanded in F around -inf 45.5%
Taylor expanded in B around 0 60.3%
if 4.20000000000000039e-9 < F Initial program 66.7%
Taylor expanded in B around 0 37.6%
associate-*r/37.6%
neg-mul-137.6%
Simplified37.6%
Taylor expanded in F around inf 66.9%
mul-1-neg66.9%
distribute-frac-neg66.9%
+-commutative66.9%
distribute-frac-neg66.9%
unsub-neg66.9%
Simplified66.9%
Final simplification66.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= x -6.6e-161)
t_0
(if (<= x 1.6e-266)
(/ -1.0 (sin B))
(if (<= x 1.8e-110) (- (/ 1.0 (sin B)) (/ 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 <= -6.6e-161) {
tmp = t_0;
} else if (x <= 1.6e-266) {
tmp = -1.0 / sin(B);
} else if (x <= 1.8e-110) {
tmp = (1.0 / sin(B)) - (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 <= (-6.6d-161)) then
tmp = t_0
else if (x <= 1.6d-266) then
tmp = (-1.0d0) / sin(b)
else if (x <= 1.8d-110) then
tmp = (1.0d0 / sin(b)) - (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 <= -6.6e-161) {
tmp = t_0;
} else if (x <= 1.6e-266) {
tmp = -1.0 / Math.sin(B);
} else if (x <= 1.8e-110) {
tmp = (1.0 / Math.sin(B)) - (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 <= -6.6e-161: tmp = t_0 elif x <= 1.6e-266: tmp = -1.0 / math.sin(B) elif x <= 1.8e-110: tmp = (1.0 / math.sin(B)) - (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 <= -6.6e-161) tmp = t_0; elseif (x <= 1.6e-266) tmp = Float64(-1.0 / sin(B)); elseif (x <= 1.8e-110) tmp = Float64(Float64(1.0 / sin(B)) - 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 <= -6.6e-161) tmp = t_0; elseif (x <= 1.6e-266) tmp = -1.0 / sin(B); elseif (x <= 1.8e-110) tmp = (1.0 / sin(B)) - (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, -6.6e-161], t$95$0, If[LessEqual[x, 1.6e-266], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e-110], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / 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 -6.6 \cdot 10^{-161}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-266}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-110}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.5999999999999997e-161 or 1.79999999999999997e-110 < x Initial program 85.1%
Simplified93.7%
Taylor expanded in F around -inf 76.2%
Taylor expanded in B around 0 78.1%
if -6.5999999999999997e-161 < x < 1.6e-266Initial program 74.0%
Simplified77.3%
Taylor expanded in F around -inf 32.6%
*-commutative32.6%
Simplified32.6%
Taylor expanded in x around 0 32.8%
if 1.6e-266 < x < 1.79999999999999997e-110Initial program 62.2%
Taylor expanded in B around 0 56.9%
associate-*r/56.9%
neg-mul-156.9%
Simplified56.9%
Taylor expanded in F around inf 41.7%
mul-1-neg41.7%
distribute-frac-neg41.7%
+-commutative41.7%
distribute-frac-neg41.7%
unsub-neg41.7%
Simplified41.7%
(FPCore (F B x) :precision binary64 (if (<= B 1.5e-22) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B) (- (/ -1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.5e-22) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (-1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 1.5d-22) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = ((-1.0d0) / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 1.5e-22) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (-1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 1.5e-22: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (-1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 1.5e-22) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); else tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 1.5e-22) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (-1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 1.5e-22], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 1.5e-22Initial program 76.6%
Simplified86.9%
Taylor expanded in B around 0 53.5%
unpow253.5%
Applied egg-rr53.5%
if 1.5e-22 < B Initial program 86.3%
Simplified86.2%
Taylor expanded in F around -inf 56.0%
Taylor expanded in B around 0 53.9%
Final simplification53.6%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.05e-159) (not (<= x 1.05e-150))) (- (/ -1.0 B) (/ x (tan B))) (/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.05e-159) || !(x <= 1.05e-150)) {
tmp = (-1.0 / B) - (x / tan(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 ((x <= (-2.05d-159)) .or. (.not. (x <= 1.05d-150))) then
tmp = ((-1.0d0) / b) - (x / tan(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 ((x <= -2.05e-159) || !(x <= 1.05e-150)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = -1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.05e-159) or not (x <= 1.05e-150): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = -1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.05e-159) || !(x <= 1.05e-150)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(-1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -2.05e-159) || ~((x <= 1.05e-150))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = -1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.05e-159], N[Not[LessEqual[x, 1.05e-150]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{-159} \lor \neg \left(x \leq 1.05 \cdot 10^{-150}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if x < -2.05000000000000007e-159 or 1.0500000000000001e-150 < x Initial program 83.6%
Simplified91.8%
Taylor expanded in F around -inf 73.1%
Taylor expanded in B around 0 75.4%
if -2.05000000000000007e-159 < x < 1.0500000000000001e-150Initial program 70.5%
Simplified76.1%
Taylor expanded in F around -inf 27.6%
*-commutative27.6%
Simplified27.6%
Taylor expanded in x around 0 27.8%
Final simplification60.0%
(FPCore (F B x) :precision binary64 (if (<= F -0.0102) (/ -1.0 (sin B)) (if (<= F 6.2e-25) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0102) {
tmp = -1.0 / sin(B);
} else if (F <= 6.2e-25) {
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 <= (-0.0102d0)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 6.2d-25) 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 <= -0.0102) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 6.2e-25) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.0102: tmp = -1.0 / math.sin(B) elif F <= 6.2e-25: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.0102) tmp = Float64(-1.0 / sin(B)); elseif (F <= 6.2e-25) 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 <= -0.0102) tmp = -1.0 / sin(B); elseif (F <= 6.2e-25) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.0102], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e-25], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0102:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.010200000000000001Initial program 56.5%
Simplified69.1%
Taylor expanded in F around -inf 98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in x around 0 55.9%
if -0.010200000000000001 < F < 6.19999999999999989e-25Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 48.3%
Taylor expanded in F around 0 32.0%
associate-*r/32.0%
neg-mul-132.0%
Simplified32.0%
if 6.19999999999999989e-25 < F Initial program 68.6%
Simplified82.9%
Taylor expanded in B around 0 35.1%
Taylor expanded in F around inf 36.8%
Final simplification39.8%
(FPCore (F B x) :precision binary64 (if (<= F -6.2e-57) (/ (- -1.0 x) B) (if (<= F 7.8e-25) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.8e-25) {
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-57)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7.8d-25) 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-57) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.8e-25) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e-57: tmp = (-1.0 - x) / B elif F <= 7.8e-25: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e-57) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7.8e-25) 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-57) tmp = (-1.0 - x) / B; elseif (F <= 7.8e-25) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e-57], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.8e-25], 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^{-57}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.19999999999999952e-57Initial program 59.3%
Simplified71.1%
Taylor expanded in B around 0 38.0%
Taylor expanded in F around -inf 44.7%
if -6.19999999999999952e-57 < F < 7.8e-25Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 46.0%
Taylor expanded in F around 0 32.5%
associate-*r/32.5%
neg-mul-132.5%
Simplified32.5%
if 7.8e-25 < F Initial program 68.6%
Simplified82.9%
Taylor expanded in B around 0 35.1%
Taylor expanded in F around inf 36.8%
Final simplification37.2%
(FPCore (F B x) :precision binary64 (if (<= F -1.55e-60) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.55e-60) {
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.55d-60)) 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.55e-60) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.55e-60: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.55e-60) 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.55e-60) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.55e-60], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{-60}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -1.54999999999999994e-60Initial program 59.3%
Simplified71.1%
Taylor expanded in B around 0 38.0%
Taylor expanded in F around -inf 44.7%
if -1.54999999999999994e-60 < F Initial program 87.7%
Simplified93.2%
Taylor expanded in B around 0 41.8%
Taylor expanded in F around 0 28.6%
associate-*r/28.6%
neg-mul-128.6%
Simplified28.6%
Final simplification33.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.9e+174) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.9e+174) {
tmp = -1.0 / 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.9d+174)) then
tmp = (-1.0d0) / 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.9e+174) {
tmp = -1.0 / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.9e+174: tmp = -1.0 / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.9e+174) tmp = Float64(-1.0 / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.9e+174) tmp = -1.0 / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.9e+174], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.9 \cdot 10^{+174}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -1.9000000000000001e174Initial program 35.4%
Simplified45.2%
Taylor expanded in B around 0 12.4%
Taylor expanded in F around -inf 39.5%
Taylor expanded in x around 0 28.3%
if -1.9000000000000001e174 < F Initial program 85.7%
Simplified92.6%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around 0 28.3%
associate-*r/28.3%
neg-mul-128.3%
Simplified28.3%
Final simplification28.3%
(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 79.4%
Simplified86.7%
Taylor expanded in B around 0 40.7%
Taylor expanded in F around -inf 26.8%
Taylor expanded in x around 0 9.9%
herbie shell --seed 2024177
(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))))))