
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+59)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 15500000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4e+59) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 15500000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4e+59) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 15500000.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(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+59], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 15500000.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[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+59}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 15500000:\\
\;\;\;\;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}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.99999999999999989e59Initial program 57.8%
Taylor expanded in F around -inf 99.7%
+-commutative99.7%
unsub-neg99.7%
un-div-inv99.8%
Applied egg-rr99.8%
if -3.99999999999999989e59 < F < 1.55e7Initial program 99.3%
Simplified99.5%
if 1.55e7 < F Initial program 58.2%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.5e+59)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.3e+88)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.5e+59) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.3e+88) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2.5d+59)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.3d+88) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / 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 <= -2.5e+59) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.3e+88) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.5e+59: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.3e+88: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.5e+59) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.3e+88) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.5e+59) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.3e+88) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / 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, -2.5e+59], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.3e+88], 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] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.5 \cdot 10^{+59}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{+88}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.4999999999999999e59Initial program 57.8%
Taylor expanded in F around -inf 99.7%
+-commutative99.7%
unsub-neg99.7%
un-div-inv99.8%
Applied egg-rr99.8%
if -2.4999999999999999e59 < F < 1.3e88Initial program 99.3%
div-inv99.5%
Applied egg-rr99.5%
if 1.3e88 < F Initial program 44.9%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -16500.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.62)
(- (* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (* x 2.0))))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -16500.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.62) {
tmp = ((F / sin(B)) * (1.0 / sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-16500.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.62d0) then
tmp = ((f / sin(b)) * (1.0d0 / sqrt((2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / 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 <= -16500.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.62) {
tmp = ((F / Math.sin(B)) * (1.0 / Math.sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -16500.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.62: tmp = ((F / math.sin(B)) * (1.0 / math.sqrt((2.0 + (x * 2.0))))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -16500.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.62) tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -16500.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.62) tmp = ((F / sin(B)) * (1.0 / sqrt((2.0 + (x * 2.0))))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / 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, -16500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.62], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -16500:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.62:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -16500Initial program 62.3%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -16500 < F < 1.6200000000000001Initial program 99.2%
add-sqr-sqrt99.3%
unpow-prod-down99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
pow-sqr99.3%
metadata-eval99.3%
unpow-199.3%
Simplified99.3%
Taylor expanded in F around 0 98.9%
div-inv99.1%
Applied egg-rr99.1%
if 1.6200000000000001 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -16500.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.62)
(+ t_0 (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -16500.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.62) {
tmp = t_0 + (F / (sin(B) * sqrt((2.0 + (x * 2.0)))));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-16500.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.62d0) then
tmp = t_0 + (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0)))))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -16500.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.62) {
tmp = t_0 + (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0)))));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -16500.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.62: tmp = t_0 + (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -16500.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.62) tmp = Float64(t_0 + Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0)))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -16500.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.62) tmp = t_0 + (F / (sin(B) * sqrt((2.0 + (x * 2.0))))); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -16500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.62], N[(t$95$0 + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -16500:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.62:\\
\;\;\;\;t\_0 + \frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -16500Initial program 62.3%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -16500 < F < 1.6200000000000001Initial program 99.2%
associate-*l/99.3%
+-commutative99.3%
*-commutative99.3%
fma-undefine99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
associate-*r/99.3%
clear-num99.4%
un-div-inv99.3%
fma-define99.3%
fma-undefine99.3%
*-commutative99.3%
fma-define99.3%
fma-define99.3%
Applied egg-rr99.3%
Taylor expanded in F around 0 98.9%
if 1.6200000000000001 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.4)
(+ t_0 (* F (/ (sqrt 0.5) (sin B))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.4) {
tmp = t_0 + (F * (sqrt(0.5) / sin(B)));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.4d0) then
tmp = t_0 + (f * (sqrt(0.5d0) / sin(b)))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.4) {
tmp = t_0 + (F * (Math.sqrt(0.5) / Math.sin(B)));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -1.45: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.4: tmp = t_0 + (F * (math.sqrt(0.5) / math.sin(B))) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.4) tmp = Float64(t_0 + Float64(F * Float64(sqrt(0.5) / sin(B)))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -1.45) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.4) tmp = t_0 + (F * (sqrt(0.5) / sin(B))); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(t$95$0 + N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;t\_0 + F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 62.8%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.2%
add-sqr-sqrt99.3%
unpow-prod-down99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
pow-sqr99.3%
metadata-eval99.3%
unpow-199.3%
Simplified99.3%
Taylor expanded in F around 0 98.9%
Taylor expanded in x around 0 98.7%
associate-/l*98.7%
Simplified98.7%
if 1.3999999999999999 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification99.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (/ F (sin B)) (/ 1.0 (sqrt (+ 2.0 (* x 2.0))))) (/ x B))))
(if (<= F -0.0135)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -2.8e-135)
t_0
(if (<= F 1.18e-152)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 0.162) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * (1.0 / sqrt((2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -0.0135) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -2.8e-135) {
tmp = t_0;
} else if (F <= 1.18e-152) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 0.162) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: tmp
t_0 = ((f / sin(b)) * (1.0d0 / sqrt((2.0d0 + (x * 2.0d0))))) - (x / b)
if (f <= (-0.0135d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-2.8d-135)) then
tmp = t_0
else if (f <= 1.18d-152) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 0.162d0) then
tmp = t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * (1.0 / Math.sqrt((2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -0.0135) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -2.8e-135) {
tmp = t_0;
} else if (F <= 1.18e-152) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 0.162) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * (1.0 / math.sqrt((2.0 + (x * 2.0))))) - (x / B) tmp = 0 if F <= -0.0135: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -2.8e-135: tmp = t_0 elif F <= 1.18e-152: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 0.162: tmp = t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)) tmp = 0.0 if (F <= -0.0135) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -2.8e-135) tmp = t_0; elseif (F <= 1.18e-152) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 0.162) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (1.0 / sqrt((2.0 + (x * 2.0))))) - (x / B); tmp = 0.0; if (F <= -0.0135) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -2.8e-135) tmp = t_0; elseif (F <= 1.18e-152) tmp = (x * cos(B)) / -sin(B); elseif (F <= 0.162) tmp = t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0135], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.8e-135], t$95$0, If[LessEqual[F, 1.18e-152], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.162], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \frac{1}{\sqrt{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.0135:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -2.8 \cdot 10^{-135}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.18 \cdot 10^{-152}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 0.162:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.0134999999999999998Initial program 62.8%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -0.0134999999999999998 < F < -2.80000000000000023e-135 or 1.1799999999999999e-152 < F < 0.162000000000000005Initial program 99.1%
add-sqr-sqrt99.2%
unpow-prod-down99.2%
+-commutative99.2%
fma-define99.2%
fma-define99.2%
metadata-eval99.2%
metadata-eval99.2%
+-commutative99.2%
fma-define99.2%
fma-define99.2%
metadata-eval99.2%
metadata-eval99.2%
Applied egg-rr99.2%
pow-sqr99.3%
metadata-eval99.3%
unpow-199.3%
Simplified99.3%
Taylor expanded in F around 0 98.3%
Taylor expanded in B around 0 79.6%
if -2.80000000000000023e-135 < F < 1.1799999999999999e-152Initial program 99.3%
Taylor expanded in F around -inf 32.0%
Taylor expanded in x around inf 84.8%
if 0.162000000000000005 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification92.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))))
(if (<= F -0.015)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -3e-141)
t_0
(if (<= F 5.2e-152)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 0.042) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -0.015) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -3e-141) {
tmp = t_0;
} else if (F <= 5.2e-152) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 0.042) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: tmp
t_0 = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
if (f <= (-0.015d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-3d-141)) then
tmp = t_0
else if (f <= 5.2d-152) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 0.042d0) then
tmp = t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -0.015) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -3e-141) {
tmp = t_0;
} else if (F <= 5.2e-152) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 0.042) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) tmp = 0 if F <= -0.015: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -3e-141: tmp = t_0 elif F <= 5.2e-152: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 0.042: tmp = t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)) tmp = 0.0 if (F <= -0.015) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -3e-141) tmp = t_0; elseif (F <= 5.2e-152) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 0.042) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); tmp = 0.0; if (F <= -0.015) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -3e-141) tmp = t_0; elseif (F <= 5.2e-152) tmp = (x * cos(B)) / -sin(B); elseif (F <= 0.042) tmp = t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(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[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.015], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3e-141], t$95$0, If[LessEqual[F, 5.2e-152], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.042], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.015:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -3 \cdot 10^{-141}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{-152}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 0.042:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.014999999999999999Initial program 62.8%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -0.014999999999999999 < F < -2.99999999999999983e-141 or 5.20000000000000026e-152 < F < 0.0420000000000000026Initial program 99.1%
Taylor expanded in B around 0 80.4%
Taylor expanded in F around 0 79.4%
if -2.99999999999999983e-141 < F < 5.20000000000000026e-152Initial program 99.3%
Taylor expanded in F around -inf 32.0%
Taylor expanded in x around inf 84.8%
if 0.0420000000000000026 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification92.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -3200.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -2.3e-127)
(- (* (/ F (sin B)) t_0) (/ x B))
(if (<= F 24500.0)
(- (* t_0 (/ F B)) t_1)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -3200.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -2.3e-127) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else if (F <= 24500.0) {
tmp = (t_0 * (F / B)) - t_1;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = x / tan(b)
if (f <= (-3200.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-2.3d-127)) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else if (f <= 24500.0d0) then
tmp = (t_0 * (f / b)) - t_1
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -3200.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -2.3e-127) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else if (F <= 24500.0) {
tmp = (t_0 * (F / B)) - t_1;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) t_1 = x / math.tan(B) tmp = 0 if F <= -3200.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -2.3e-127: tmp = ((F / math.sin(B)) * t_0) - (x / B) elif F <= 24500.0: tmp = (t_0 * (F / B)) - t_1 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3200.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -2.3e-127) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); elseif (F <= 24500.0) tmp = Float64(Float64(t_0 * Float64(F / B)) - t_1); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; t_1 = x / tan(B); tmp = 0.0; if (F <= -3200.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -2.3e-127) tmp = ((F / sin(B)) * t_0) - (x / B); elseif (F <= 24500.0) tmp = (t_0 * (F / B)) - t_1; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3200.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2.3e-127], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 24500.0], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3200:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -2.3 \cdot 10^{-127}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 24500:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3200Initial program 62.8%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -3200 < F < -2.30000000000000019e-127Initial program 99.1%
Taylor expanded in B around 0 82.3%
if -2.30000000000000019e-127 < F < 24500Initial program 99.3%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 90.1%
if 24500 < F Initial program 58.2%
Taylor expanded in F around inf 99.8%
Final simplification94.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -9500.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.05e-129)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 0.45)
(+ t_0 (* (/ 1.0 (sqrt (+ 2.0 (* x 2.0)))) (/ F B)))
(+ t_0 (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -9500.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.05e-129) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 0.45) {
tmp = t_0 + ((1.0 / sqrt((2.0 + (x * 2.0)))) * (F / B));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-9500.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.05d-129)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 0.45d0) then
tmp = t_0 + ((1.0d0 / sqrt((2.0d0 + (x * 2.0d0)))) * (f / b))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -9500.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.05e-129) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 0.45) {
tmp = t_0 + ((1.0 / Math.sqrt((2.0 + (x * 2.0)))) * (F / B));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -9500.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.05e-129: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 0.45: tmp = t_0 + ((1.0 / math.sqrt((2.0 + (x * 2.0)))) * (F / B)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -9500.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.05e-129) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 0.45) tmp = Float64(t_0 + Float64(Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -9500.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.05e-129) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 0.45) tmp = t_0 + ((1.0 / sqrt((2.0 + (x * 2.0)))) * (F / B)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.05e-129], 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], If[LessEqual[F, 0.45], N[(t$95$0 + N[(N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -9500:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.05 \cdot 10^{-129}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 0.45:\\
\;\;\;\;t\_0 + \frac{1}{\sqrt{2 + x \cdot 2}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -9500Initial program 62.8%
Taylor expanded in F around -inf 99.5%
+-commutative99.5%
unsub-neg99.5%
un-div-inv99.6%
Applied egg-rr99.6%
if -9500 < F < -1.05e-129Initial program 99.1%
Taylor expanded in B around 0 82.3%
if -1.05e-129 < F < 0.450000000000000011Initial program 99.3%
add-sqr-sqrt99.3%
unpow-prod-down99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
pow-sqr99.3%
metadata-eval99.3%
unpow-199.3%
Simplified99.3%
Taylor expanded in F around 0 99.3%
Taylor expanded in B around 0 89.6%
if 0.450000000000000011 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification94.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -0.00075)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 0.78)
(+ t_0 (* (/ 1.0 (sqrt (+ 2.0 (* x 2.0)))) (/ F B)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -0.00075) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 0.78) {
tmp = t_0 + ((1.0 / sqrt((2.0 + (x * 2.0)))) * (F / B));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-0.00075d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 0.78d0) then
tmp = t_0 + ((1.0d0 / sqrt((2.0d0 + (x * 2.0d0)))) * (f / b))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -0.00075) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 0.78) {
tmp = t_0 + ((1.0 / Math.sqrt((2.0 + (x * 2.0)))) * (F / B));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -0.00075: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 0.78: tmp = t_0 + ((1.0 / math.sqrt((2.0 + (x * 2.0)))) * (F / B)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -0.00075) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 0.78) tmp = Float64(t_0 + Float64(Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -0.00075) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 0.78) tmp = t_0 + ((1.0 / sqrt((2.0 + (x * 2.0)))) * (F / B)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00075], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.78], N[(t$95$0 + N[(N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -0.00075:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.78:\\
\;\;\;\;t\_0 + \frac{1}{\sqrt{2 + x \cdot 2}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -7.5000000000000002e-4Initial program 63.3%
Taylor expanded in F around -inf 98.4%
+-commutative98.4%
unsub-neg98.4%
un-div-inv98.5%
Applied egg-rr98.5%
if -7.5000000000000002e-4 < F < 0.78000000000000003Initial program 99.2%
add-sqr-sqrt99.3%
unpow-prod-down99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
+-commutative99.3%
fma-define99.3%
fma-define99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
pow-sqr99.3%
metadata-eval99.3%
unpow-199.3%
Simplified99.3%
Taylor expanded in F around 0 99.3%
Taylor expanded in B around 0 85.0%
if 0.78000000000000003 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification92.8%
(FPCore (F B x)
:precision binary64
(if (<= F -6.4e-19)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 6.2e-138)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 26.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.4e-19) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 6.2e-138) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 26.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (x * (-1.0 / tan(B))) + (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 <= (-6.4d-19)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 6.2d-138) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 26.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.4e-19) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 6.2e-138) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 26.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.4e-19: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 6.2e-138: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 26.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.4e-19) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 6.2e-138) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 26.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.4e-19) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 6.2e-138) tmp = (x * cos(B)) / -sin(B); elseif (F <= 26.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.4e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e-138], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 26.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.4 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-138}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 26:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -6.39999999999999965e-19Initial program 63.8%
Taylor expanded in F around -inf 97.3%
+-commutative97.3%
unsub-neg97.3%
un-div-inv97.3%
Applied egg-rr97.3%
if -6.39999999999999965e-19 < F < 6.1999999999999996e-138Initial program 99.3%
Taylor expanded in F around -inf 31.2%
Taylor expanded in x around inf 72.0%
if 6.1999999999999996e-138 < F < 26Initial program 99.1%
Taylor expanded in B around 0 76.5%
Taylor expanded in B around 0 65.4%
if 26 < F Initial program 59.4%
Taylor expanded in F around inf 99.2%
Final simplification86.3%
(FPCore (F B x)
:precision binary64
(if (<= F -2.5e-12)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.18e-139)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 24500.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-12) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.18e-139) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 24500.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (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) :: tmp
if (f <= (-2.5d-12)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.18d-139) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 24500.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (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 tmp;
if (F <= -2.5e-12) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.18e-139) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 24500.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.5e-12: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.18e-139: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 24500.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.18e-139) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 24500.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.5e-12) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.18e-139) tmp = (x * cos(B)) / -sin(B); elseif (F <= 24500.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.18e-139], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 24500.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.18 \cdot 10^{-139}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 24500:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -2.49999999999999985e-12Initial program 63.8%
Taylor expanded in F around -inf 97.3%
+-commutative97.3%
unsub-neg97.3%
un-div-inv97.3%
Applied egg-rr97.3%
if -2.49999999999999985e-12 < F < 1.18e-139Initial program 99.3%
Taylor expanded in F around -inf 31.2%
Taylor expanded in x around inf 72.0%
if 1.18e-139 < F < 24500Initial program 99.1%
Taylor expanded in B around 0 74.7%
Taylor expanded in B around 0 64.4%
if 24500 < F Initial program 58.2%
Taylor expanded in B around 0 42.4%
Taylor expanded in F around inf 83.9%
Final simplification82.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+42)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 6.5e-137)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 24500.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+42) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 6.5e-137) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 24500.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (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) :: tmp
if (f <= (-1.3d+42)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 6.5d-137) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 24500.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (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 tmp;
if (F <= -1.3e+42) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 6.5e-137) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 24500.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e+42: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 6.5e-137: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 24500.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+42) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 6.5e-137) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 24500.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.3e+42) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 6.5e-137) tmp = (x * cos(B)) / -sin(B); elseif (F <= 24500.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-137], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 24500.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+42}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-137}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 24500:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.29999999999999995e42Initial program 60.2%
Taylor expanded in B around 0 41.3%
Taylor expanded in F around -inf 79.7%
mul-1-neg79.7%
distribute-neg-in79.7%
distribute-neg-frac79.7%
metadata-eval79.7%
unsub-neg79.7%
Simplified79.7%
if -1.29999999999999995e42 < F < 6.49999999999999991e-137Initial program 99.3%
Taylor expanded in F around -inf 34.3%
Taylor expanded in x around inf 70.7%
if 6.49999999999999991e-137 < F < 24500Initial program 99.1%
Taylor expanded in B around 0 74.7%
Taylor expanded in B around 0 64.4%
if 24500 < F Initial program 58.2%
Taylor expanded in B around 0 42.4%
Taylor expanded in F around inf 83.9%
Final simplification75.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+42)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1e-141)
(* x (/ (cos B) (- (sin B))))
(if (<= F 24500.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+42) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1e-141) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 24500.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (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) :: tmp
if (f <= (-1.3d+42)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1d-141) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 24500.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (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 tmp;
if (F <= -1.3e+42) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1e-141) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 24500.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e+42: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1e-141: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 24500.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+42) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1e-141) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 24500.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.3e+42) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1e-141) tmp = x * (cos(B) / -sin(B)); elseif (F <= 24500.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-141], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 24500.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+42}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 10^{-141}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 24500:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.29999999999999995e42Initial program 60.2%
Taylor expanded in B around 0 41.3%
Taylor expanded in F around -inf 79.7%
mul-1-neg79.7%
distribute-neg-in79.7%
distribute-neg-frac79.7%
metadata-eval79.7%
unsub-neg79.7%
Simplified79.7%
if -1.29999999999999995e42 < F < 1e-141Initial program 99.3%
Taylor expanded in F around -inf 34.3%
Taylor expanded in x around inf 70.7%
mul-1-neg70.7%
associate-/l*70.7%
distribute-lft-neg-in70.7%
Simplified70.7%
if 1e-141 < F < 24500Initial program 99.1%
Taylor expanded in B around 0 74.7%
Taylor expanded in B around 0 64.4%
if 24500 < F Initial program 58.2%
Taylor expanded in B around 0 42.4%
Taylor expanded in F around inf 83.9%
Final simplification75.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -0.07)
t_0
(if (<= F -6.8e-174)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 4.1e-140)
t_0
(if (<= F 55000.0)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= -0.07) {
tmp = t_0;
} else if (F <= -6.8e-174) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 4.1e-140) {
tmp = t_0;
} else if (F <= 55000.0) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (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 = ((-1.0d0) / b) - (x / tan(b))
if (f <= (-0.07d0)) then
tmp = t_0
else if (f <= (-6.8d-174)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 4.1d-140) then
tmp = t_0
else if (f <= 55000.0d0) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (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 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= -0.07) {
tmp = t_0;
} else if (F <= -6.8e-174) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 4.1e-140) {
tmp = t_0;
} else if (F <= 55000.0) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -0.07: tmp = t_0 elif F <= -6.8e-174: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 4.1e-140: tmp = t_0 elif F <= 55000.0: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= -0.07) tmp = t_0; elseif (F <= -6.8e-174) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 4.1e-140) tmp = t_0; elseif (F <= 55000.0) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / 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 <= -0.07) tmp = t_0; elseif (F <= -6.8e-174) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 4.1e-140) tmp = t_0; elseif (F <= 55000.0) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / sin(B)) - (x / 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, -0.07], t$95$0, If[LessEqual[F, -6.8e-174], 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, 4.1e-140], t$95$0, If[LessEqual[F, 55000.0], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.07:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -6.8 \cdot 10^{-174}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 4.1 \cdot 10^{-140}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 55000:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.070000000000000007 or -6.8000000000000004e-174 < F < 4.1000000000000001e-140Initial program 79.1%
Taylor expanded in F around -inf 69.7%
+-commutative69.7%
unsub-neg69.7%
un-div-inv69.7%
Applied egg-rr69.7%
Taylor expanded in B around 0 65.6%
if -0.070000000000000007 < F < -6.8000000000000004e-174Initial program 99.2%
Taylor expanded in B around 0 81.4%
Taylor expanded in B around 0 51.7%
Taylor expanded in F around 0 51.7%
if 4.1000000000000001e-140 < F < 55000Initial program 99.1%
Taylor expanded in B around 0 74.7%
Taylor expanded in B around 0 64.4%
if 55000 < F Initial program 58.2%
Taylor expanded in B around 0 42.4%
Taylor expanded in F around inf 83.9%
Final simplification68.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B))
(t_1 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -0.0013)
t_1
(if (<= F -8.5e-175)
t_0
(if (<= F 1.1e-146)
t_1
(if (<= F 0.92) 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 t_1 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= -0.0013) {
tmp = t_1;
} else if (F <= -8.5e-175) {
tmp = t_0;
} else if (F <= 1.1e-146) {
tmp = t_1;
} else if (F <= 0.92) {
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) :: t_1
real(8) :: tmp
t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
t_1 = ((-1.0d0) / b) - (x / tan(b))
if (f <= (-0.0013d0)) then
tmp = t_1
else if (f <= (-8.5d-175)) then
tmp = t_0
else if (f <= 1.1d-146) then
tmp = t_1
else if (f <= 0.92d0) 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 t_1 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= -0.0013) {
tmp = t_1;
} else if (F <= -8.5e-175) {
tmp = t_0;
} else if (F <= 1.1e-146) {
tmp = t_1;
} else if (F <= 0.92) {
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 t_1 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -0.0013: tmp = t_1 elif F <= -8.5e-175: tmp = t_0 elif F <= 1.1e-146: tmp = t_1 elif F <= 0.92: 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) t_1 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= -0.0013) tmp = t_1; elseif (F <= -8.5e-175) tmp = t_0; elseif (F <= 1.1e-146) tmp = t_1; elseif (F <= 0.92) 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; t_1 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= -0.0013) tmp = t_1; elseif (F <= -8.5e-175) tmp = t_0; elseif (F <= 1.1e-146) tmp = t_1; elseif (F <= 0.92) 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]}, Block[{t$95$1 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0013], t$95$1, If[LessEqual[F, -8.5e-175], t$95$0, If[LessEqual[F, 1.1e-146], t$95$1, If[LessEqual[F, 0.92], 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}\\
t_1 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.0013:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq -8.5 \cdot 10^{-175}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-146}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 0.92:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.0012999999999999999 or -8.5000000000000005e-175 < F < 1.1e-146Initial program 79.1%
Taylor expanded in F around -inf 69.7%
+-commutative69.7%
unsub-neg69.7%
un-div-inv69.7%
Applied egg-rr69.7%
Taylor expanded in B around 0 65.6%
if -0.0012999999999999999 < F < -8.5000000000000005e-175 or 1.1e-146 < F < 0.92000000000000004Initial program 99.2%
Taylor expanded in B around 0 79.0%
Taylor expanded in B around 0 58.4%
Taylor expanded in F around 0 58.4%
if 0.92000000000000004 < F Initial program 59.4%
Taylor expanded in B around 0 42.7%
Taylor expanded in F around inf 82.4%
Final simplification68.6%
(FPCore (F B x) :precision binary64 (if (<= F 520.0) (- (/ -1.0 B) (/ x (tan B))) (- (/ 1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= 520.0) {
tmp = (-1.0 / B) - (x / tan(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 <= 520.0d0) then
tmp = ((-1.0d0) / b) - (x / tan(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 <= 520.0) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 520.0: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 520.0) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(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 <= 520.0) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 520.0], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $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 520:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < 520Initial program 84.6%
Taylor expanded in F around -inf 58.7%
+-commutative58.7%
unsub-neg58.7%
un-div-inv58.8%
Applied egg-rr58.8%
Taylor expanded in B around 0 56.7%
if 520 < F Initial program 58.8%
Taylor expanded in B around 0 43.2%
Taylor expanded in F around inf 83.6%
(FPCore (F B x) :precision binary64 (if (<= F 7200.0) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 7200.0) {
tmp = (-1.0 / B) - (x / tan(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 <= 7200.0d0) then
tmp = ((-1.0d0) / b) - (x / tan(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 <= 7200.0) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 7200.0: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 7200.0) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(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 <= 7200.0) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 7200.0], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 7200:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 7200Initial program 84.6%
Taylor expanded in F around -inf 58.7%
+-commutative58.7%
unsub-neg58.7%
un-div-inv58.8%
Applied egg-rr58.8%
Taylor expanded in B around 0 56.7%
if 7200 < F Initial program 58.8%
Taylor expanded in B around 0 43.2%
Taylor expanded in B around 0 27.7%
Taylor expanded in F around inf 53.9%
div-sub53.9%
Simplified53.9%
(FPCore (F B x) :precision binary64 (if (<= F -2.05e-87) (/ (- -1.0 x) B) (if (<= F 0.00126) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.05e-87) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.00126) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.05d-87)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 0.00126d0) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.05e-87) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.00126) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.05e-87: tmp = (-1.0 - x) / B elif F <= 0.00126: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.05e-87) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 0.00126) 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 <= -2.05e-87) tmp = (-1.0 - x) / B; elseif (F <= 0.00126) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.05e-87], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.00126], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{-87}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 0.00126:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.05000000000000016e-87Initial program 70.1%
Taylor expanded in B around 0 49.1%
Taylor expanded in B around 0 45.5%
Taylor expanded in F around -inf 47.7%
if -2.05000000000000016e-87 < F < 0.00126000000000000005Initial program 99.2%
Taylor expanded in B around 0 57.1%
Taylor expanded in x around inf 31.8%
mul-1-neg31.8%
distribute-neg-frac231.8%
Simplified31.8%
if 0.00126000000000000005 < F Initial program 59.4%
Taylor expanded in B around 0 42.7%
Taylor expanded in B around 0 27.4%
Taylor expanded in F around inf 53.2%
div-sub53.2%
Simplified53.2%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.15e-9) (not (<= x 1.16e-234))) (/ x (- B)) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.15e-9) || !(x <= 1.16e-234)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.15d-9)) .or. (.not. (x <= 1.16d-234))) then
tmp = x / -b
else
tmp = (-1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1.15e-9) || !(x <= 1.16e-234)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1.15e-9) or not (x <= 1.16e-234): tmp = x / -B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1.15e-9) || !(x <= 1.16e-234)) tmp = Float64(x / Float64(-B)); else tmp = Float64(-1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1.15e-9) || ~((x <= 1.16e-234))) tmp = x / -B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.15e-9], N[Not[LessEqual[x, 1.16e-234]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{-9} \lor \neg \left(x \leq 1.16 \cdot 10^{-234}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -1.15e-9 or 1.16000000000000004e-234 < x Initial program 81.0%
Taylor expanded in B around 0 45.4%
Taylor expanded in x around inf 39.3%
mul-1-neg39.3%
distribute-neg-frac239.3%
Simplified39.3%
if -1.15e-9 < x < 1.16000000000000004e-234Initial program 72.5%
Taylor expanded in B around 0 58.6%
Taylor expanded in B around 0 37.7%
Taylor expanded in F around -inf 17.0%
Taylor expanded in x around 0 17.0%
Final simplification31.1%
(FPCore (F B x) :precision binary64 (if (<= F -7.2e-89) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-89) {
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 <= (-7.2d-89)) 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 <= -7.2e-89) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.2e-89: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.2e-89) 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 <= -7.2e-89) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.2e-89], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{-89}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -7.20000000000000014e-89Initial program 70.1%
Taylor expanded in B around 0 49.1%
Taylor expanded in B around 0 45.5%
Taylor expanded in F around -inf 47.7%
if -7.20000000000000014e-89 < F Initial program 82.4%
Taylor expanded in B around 0 51.0%
Taylor expanded in x around inf 27.6%
mul-1-neg27.6%
distribute-neg-frac227.6%
Simplified27.6%
(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.8%
Taylor expanded in B around 0 50.3%
Taylor expanded in B around 0 44.5%
Taylor expanded in F around -inf 28.7%
Taylor expanded in x around 0 10.0%
herbie shell --seed 2024101
(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))))))