
(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 21 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 (/ -1.0 (sin B))))
(if (<= F -3.15e+162)
(- t_0 (/ x (tan B)))
(if (<= F 1.0)
(+ (* x (/ -1.0 (tan B))) (/ F (* (sin B) (sqrt (fma F F 2.0)))))
(- (/ x (- (tan B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double tmp;
if (F <= -3.15e+162) {
tmp = t_0 - (x / tan(B));
} else if (F <= 1.0) {
tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt(fma(F, F, 2.0))));
} else {
tmp = (x / -tan(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -3.15e+162) tmp = Float64(t_0 - Float64(x / tan(B))); elseif (F <= 1.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0))))); else tmp = Float64(Float64(x / Float64(-tan(B))) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.15e+162], N[(t$95$0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -3.15 \cdot 10^{+162}:\\
\;\;\;\;t\_0 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_0\\
\end{array}
\end{array}
if F < -3.15e162Initial program 30.7%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -3.15e162 < F < 1Initial program 98.4%
associate-*l/99.5%
+-commutative99.5%
*-commutative99.5%
fma-undefine99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.5%
clear-num99.6%
un-div-inv99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
if 1 < F Initial program 51.2%
Taylor expanded in F around -inf 47.2%
div-inv47.3%
Applied egg-rr47.3%
div-inv47.3%
mul-1-neg47.3%
rgt-mult-inverse47.3%
associate-*l/33.6%
add-sqr-sqrt13.9%
sqrt-unprod51.7%
associate-*l/51.7%
rgt-mult-inverse51.7%
associate-*l/56.4%
rgt-mult-inverse56.4%
frac-times56.4%
metadata-eval56.4%
metadata-eval56.4%
frac-times56.4%
sqrt-unprod54.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -145000000.0)
(- t_0 t_1)
(if (<= F 120000000.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_1)
(- (/ x (- (tan B))) t_0)))))
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 <= -145000000.0) {
tmp = t_0 - t_1;
} else if (F <= 120000000.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_1;
} else {
tmp = (x / -tan(B)) - t_0;
}
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 <= -145000000.0) tmp = Float64(t_0 - t_1); elseif (F <= 120000000.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_1); else tmp = Float64(Float64(x / Float64(-tan(B))) - t_0); 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, -145000000.0], N[(t$95$0 - t$95$1), $MachinePrecision], If[LessEqual[F, 120000000.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$1), $MachinePrecision], N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -145000000:\\
\;\;\;\;t\_0 - t\_1\\
\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_0\\
\end{array}
\end{array}
if F < -1.45e8Initial program 60.4%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -1.45e8 < F < 1.2e8Initial program 99.5%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
if 1.2e8 < F Initial program 51.2%
Taylor expanded in F around -inf 47.2%
div-inv47.3%
Applied egg-rr47.3%
div-inv47.3%
mul-1-neg47.3%
rgt-mult-inverse47.3%
associate-*l/33.6%
add-sqr-sqrt13.9%
sqrt-unprod51.7%
associate-*l/51.7%
rgt-mult-inverse51.7%
associate-*l/56.4%
rgt-mult-inverse56.4%
frac-times56.4%
metadata-eval56.4%
metadata-eval56.4%
frac-times56.4%
sqrt-unprod54.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))))
(if (<= F -1.9e+63)
(- t_0 (/ x (tan B)))
(if (<= F 12500000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ x (- (tan B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double tmp;
if (F <= -1.9e+63) {
tmp = t_0 - (x / tan(B));
} else if (F <= 12500000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (x / -tan(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 = (-1.0d0) / sin(b)
if (f <= (-1.9d+63)) then
tmp = t_0 - (x / tan(b))
else if (f <= 12500000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (x / -tan(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 / Math.sin(B);
double tmp;
if (F <= -1.9e+63) {
tmp = t_0 - (x / Math.tan(B));
} else if (F <= 12500000000.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 = (x / -Math.tan(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / math.sin(B) tmp = 0 if F <= -1.9e+63: tmp = t_0 - (x / math.tan(B)) elif F <= 12500000000.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 = (x / -math.tan(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -1.9e+63) tmp = Float64(t_0 - Float64(x / tan(B))); elseif (F <= 12500000000.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(x / Float64(-tan(B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / sin(B); tmp = 0.0; if (F <= -1.9e+63) tmp = t_0 - (x / tan(B)); elseif (F <= 12500000000.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (x / -tan(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.9e+63], N[(t$95$0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 12500000000.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[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -1.9 \cdot 10^{+63}:\\
\;\;\;\;t\_0 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 12500000000:\\
\;\;\;\;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{x}{-\tan B} - t\_0\\
\end{array}
\end{array}
if F < -1.9000000000000001e63Initial program 55.7%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -1.9000000000000001e63 < F < 1.25e10Initial program 99.5%
if 1.25e10 < F Initial program 51.2%
Taylor expanded in F around -inf 47.2%
div-inv47.3%
Applied egg-rr47.3%
div-inv47.3%
mul-1-neg47.3%
rgt-mult-inverse47.3%
associate-*l/33.6%
add-sqr-sqrt13.9%
sqrt-unprod51.7%
associate-*l/51.7%
rgt-mult-inverse51.7%
associate-*l/56.4%
rgt-mult-inverse56.4%
frac-times56.4%
metadata-eval56.4%
metadata-eval56.4%
frac-times56.4%
sqrt-unprod54.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))))
(if (<= F -3900000.0)
(- t_0 (/ x (tan B)))
(if (<= F 1.36)
(+ (* x (/ -1.0 (tan B))) (/ F (* (sin B) (sqrt 2.0))))
(- (/ x (- (tan B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double tmp;
if (F <= -3900000.0) {
tmp = t_0 - (x / tan(B));
} else if (F <= 1.36) {
tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt(2.0)));
} else {
tmp = (x / -tan(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 = (-1.0d0) / sin(b)
if (f <= (-3900000.0d0)) then
tmp = t_0 - (x / tan(b))
else if (f <= 1.36d0) then
tmp = (x * ((-1.0d0) / tan(b))) + (f / (sin(b) * sqrt(2.0d0)))
else
tmp = (x / -tan(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 / Math.sin(B);
double tmp;
if (F <= -3900000.0) {
tmp = t_0 - (x / Math.tan(B));
} else if (F <= 1.36) {
tmp = (x * (-1.0 / Math.tan(B))) + (F / (Math.sin(B) * Math.sqrt(2.0)));
} else {
tmp = (x / -Math.tan(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / math.sin(B) tmp = 0 if F <= -3900000.0: tmp = t_0 - (x / math.tan(B)) elif F <= 1.36: tmp = (x * (-1.0 / math.tan(B))) + (F / (math.sin(B) * math.sqrt(2.0))) else: tmp = (x / -math.tan(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -3900000.0) tmp = Float64(t_0 - Float64(x / tan(B))); elseif (F <= 1.36) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) * sqrt(2.0)))); else tmp = Float64(Float64(x / Float64(-tan(B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / sin(B); tmp = 0.0; if (F <= -3900000.0) tmp = t_0 - (x / tan(B)); elseif (F <= 1.36) tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt(2.0))); else tmp = (x / -tan(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3900000.0], N[(t$95$0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.36], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -3900000:\\
\;\;\;\;t\_0 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.36:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_0\\
\end{array}
\end{array}
if F < -3.9e6Initial program 60.4%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -3.9e6 < F < 1.3600000000000001Initial program 99.5%
associate-*l/99.5%
+-commutative99.5%
*-commutative99.5%
fma-undefine99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-*r/99.5%
clear-num99.5%
un-div-inv99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.0%
*-commutative98.0%
Simplified98.0%
if 1.3600000000000001 < F Initial program 51.2%
Taylor expanded in F around -inf 47.2%
div-inv47.3%
Applied egg-rr47.3%
div-inv47.3%
mul-1-neg47.3%
rgt-mult-inverse47.3%
associate-*l/33.6%
add-sqr-sqrt13.9%
sqrt-unprod51.7%
associate-*l/51.7%
rgt-mult-inverse51.7%
associate-*l/56.4%
rgt-mult-inverse56.4%
frac-times56.4%
metadata-eval56.4%
metadata-eval56.4%
frac-times56.4%
sqrt-unprod54.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -3900000.0)
(- t_0 t_1)
(if (<= F 1.4)
(- (* F (/ (sqrt 0.5) (sin B))) t_1)
(- (/ x (- (tan B))) t_0)))))
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 <= -3900000.0) {
tmp = t_0 - t_1;
} else if (F <= 1.4) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_1;
} else {
tmp = (x / -tan(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) :: t_1
real(8) :: tmp
t_0 = (-1.0d0) / sin(b)
t_1 = x / tan(b)
if (f <= (-3900000.0d0)) then
tmp = t_0 - t_1
else if (f <= 1.4d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_1
else
tmp = (x / -tan(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -3900000.0) {
tmp = t_0 - t_1;
} else if (F <= 1.4) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_1;
} else {
tmp = (x / -Math.tan(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -3900000.0: tmp = t_0 - t_1 elif F <= 1.4: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_1 else: tmp = (x / -math.tan(B)) - t_0 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 <= -3900000.0) tmp = Float64(t_0 - t_1); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_1); else tmp = Float64(Float64(x / Float64(-tan(B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -3900000.0) tmp = t_0 - t_1; elseif (F <= 1.4) tmp = (F * (sqrt(0.5) / sin(B))) - t_1; else tmp = (x / -tan(B)) - t_0; end tmp_2 = 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, -3900000.0], N[(t$95$0 - t$95$1), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3900000:\\
\;\;\;\;t\_0 - t\_1\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_0\\
\end{array}
\end{array}
if F < -3.9e6Initial program 60.4%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -3.9e6 < F < 1.3999999999999999Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 97.9%
Taylor expanded in x around 0 97.9%
if 1.3999999999999999 < F Initial program 51.2%
Taylor expanded in F around -inf 47.2%
div-inv47.3%
Applied egg-rr47.3%
div-inv47.3%
mul-1-neg47.3%
rgt-mult-inverse47.3%
associate-*l/33.6%
add-sqr-sqrt13.9%
sqrt-unprod51.7%
associate-*l/51.7%
rgt-mult-inverse51.7%
associate-*l/56.4%
rgt-mult-inverse56.4%
frac-times56.4%
metadata-eval56.4%
metadata-eval56.4%
frac-times56.4%
sqrt-unprod54.6%
add-sqr-sqrt99.8%
Applied egg-rr99.8%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (t_1 (/ -1.0 (sin B))))
(if (<= F -2.7e+19)
(- t_1 (/ x (tan B)))
(if (<= F -3.7e-47)
(- (* (/ F (sin B)) t_0) (/ x B))
(if (<= F 0.9)
(+ (* x (/ -1.0 (tan B))) (* t_0 (/ F B)))
(- (/ x (- (tan B))) t_1))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = -1.0 / sin(B);
double tmp;
if (F <= -2.7e+19) {
tmp = t_1 - (x / tan(B));
} else if (F <= -3.7e-47) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else if (F <= 0.9) {
tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B));
} else {
tmp = (x / -tan(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 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = (-1.0d0) / sin(b)
if (f <= (-2.7d+19)) then
tmp = t_1 - (x / tan(b))
else if (f <= (-3.7d-47)) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else if (f <= 0.9d0) then
tmp = (x * ((-1.0d0) / tan(b))) + (t_0 * (f / b))
else
tmp = (x / -tan(b)) - t_1
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 = -1.0 / Math.sin(B);
double tmp;
if (F <= -2.7e+19) {
tmp = t_1 - (x / Math.tan(B));
} else if (F <= -3.7e-47) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else if (F <= 0.9) {
tmp = (x * (-1.0 / Math.tan(B))) + (t_0 * (F / B));
} else {
tmp = (x / -Math.tan(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) t_1 = -1.0 / math.sin(B) tmp = 0 if F <= -2.7e+19: tmp = t_1 - (x / math.tan(B)) elif F <= -3.7e-47: tmp = ((F / math.sin(B)) * t_0) - (x / B) elif F <= 0.9: tmp = (x * (-1.0 / math.tan(B))) + (t_0 * (F / B)) else: tmp = (x / -math.tan(B)) - t_1 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(-1.0 / sin(B)) tmp = 0.0 if (F <= -2.7e+19) tmp = Float64(t_1 - Float64(x / tan(B))); elseif (F <= -3.7e-47) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); elseif (F <= 0.9) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_0 * Float64(F / B))); else tmp = Float64(Float64(x / Float64(-tan(B))) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; t_1 = -1.0 / sin(B); tmp = 0.0; if (F <= -2.7e+19) tmp = t_1 - (x / tan(B)); elseif (F <= -3.7e-47) tmp = ((F / sin(B)) * t_0) - (x / B); elseif (F <= 0.9) tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B)); else tmp = (x / -tan(B)) - t_1; 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[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.7e+19], N[(t$95$1 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.7e-47], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.9], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$1), $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{-1}{\sin B}\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+19}:\\
\;\;\;\;t\_1 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -3.7 \cdot 10^{-47}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 0.9:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0 \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_1\\
\end{array}
\end{array}
if F < -2.7e19Initial program 59.3%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -2.7e19 < F < -3.7e-47Initial program 99.3%
Taylor expanded in B around 0 90.9%
if -3.7e-47 < F < 0.900000000000000022Initial program 99.6%
Taylor expanded in B around 0 82.2%
if 0.900000000000000022 < F Initial program 52.0%
Taylor expanded in F around -inf 46.5%
div-inv46.5%
Applied egg-rr46.5%
div-inv46.5%
mul-1-neg46.5%
rgt-mult-inverse46.5%
associate-*l/33.1%
add-sqr-sqrt13.7%
sqrt-unprod50.9%
associate-*l/50.9%
rgt-mult-inverse50.9%
associate-*l/55.5%
rgt-mult-inverse55.5%
frac-times55.5%
metadata-eval55.5%
metadata-eval55.5%
frac-times55.5%
sqrt-unprod53.7%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
Final simplification91.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
(t_1 (/ -1.0 (sin B))))
(if (<= F -1.0)
(- t_1 (/ x (tan B)))
(if (<= F -2.35e-89)
t_0
(if (<= F 5.4e-82)
(* x (/ (cos B) (- (sin B))))
(if (<= F 4.5e-33) t_0 (- (/ x (- (tan B))) t_1)))))))
double code(double F, double B, double x) {
double t_0 = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = -1.0 / sin(B);
double tmp;
if (F <= -1.0) {
tmp = t_1 - (x / tan(B));
} else if (F <= -2.35e-89) {
tmp = t_0;
} else if (F <= 5.4e-82) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 4.5e-33) {
tmp = t_0;
} else {
tmp = (x / -tan(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 = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = (-1.0d0) / sin(b)
if (f <= (-1.0d0)) then
tmp = t_1 - (x / tan(b))
else if (f <= (-2.35d-89)) then
tmp = t_0
else if (f <= 5.4d-82) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 4.5d-33) then
tmp = t_0
else
tmp = (x / -tan(b)) - t_1
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))));
double t_1 = -1.0 / Math.sin(B);
double tmp;
if (F <= -1.0) {
tmp = t_1 - (x / Math.tan(B));
} else if (F <= -2.35e-89) {
tmp = t_0;
} else if (F <= 5.4e-82) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 4.5e-33) {
tmp = t_0;
} else {
tmp = (x / -Math.tan(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = -1.0 / math.sin(B) tmp = 0 if F <= -1.0: tmp = t_1 - (x / math.tan(B)) elif F <= -2.35e-89: tmp = t_0 elif F <= 5.4e-82: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 4.5e-33: tmp = t_0 else: tmp = (x / -math.tan(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) t_1 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -1.0) tmp = Float64(t_1 - Float64(x / tan(B))); elseif (F <= -2.35e-89) tmp = t_0; elseif (F <= 5.4e-82) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 4.5e-33) tmp = t_0; else tmp = Float64(Float64(x / Float64(-tan(B))) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = -1.0 / sin(B); tmp = 0.0; if (F <= -1.0) tmp = t_1 - (x / tan(B)); elseif (F <= -2.35e-89) tmp = t_0; elseif (F <= 5.4e-82) tmp = x * (cos(B) / -sin(B)); elseif (F <= 4.5e-33) tmp = t_0; else tmp = (x / -tan(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.0], N[(t$95$1 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.35e-89], t$95$0, If[LessEqual[F, 5.4e-82], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e-33], t$95$0, N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -1:\\
\;\;\;\;t\_1 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -2.35 \cdot 10^{-89}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-82}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-33}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_1\\
\end{array}
\end{array}
if F < -1Initial program 60.9%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -1 < F < -2.34999999999999998e-89 or 5.4000000000000003e-82 < F < 4.49999999999999991e-33Initial program 99.4%
Simplified99.4%
Taylor expanded in F around 0 96.7%
Taylor expanded in F around inf 70.8%
if -2.34999999999999998e-89 < F < 5.4000000000000003e-82Initial program 99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
Taylor expanded in F around 0 74.2%
mul-1-neg74.2%
associate-/l*74.2%
distribute-rgt-neg-in74.2%
distribute-neg-frac274.2%
Simplified74.2%
if 4.49999999999999991e-33 < F Initial program 56.2%
Taylor expanded in F around -inf 48.3%
div-inv48.3%
Applied egg-rr48.3%
div-inv48.3%
mul-1-neg48.3%
rgt-mult-inverse48.3%
associate-*l/36.0%
add-sqr-sqrt15.4%
sqrt-unprod50.8%
associate-*l/50.8%
rgt-mult-inverse50.8%
associate-*l/55.0%
rgt-mult-inverse55.0%
frac-times55.0%
metadata-eval55.0%
metadata-eval55.0%
frac-times55.0%
sqrt-unprod51.9%
add-sqr-sqrt96.1%
Applied egg-rr96.1%
Final simplification87.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(t_1 (/ -1.0 (sin B)))
(t_2 (/ x (tan B))))
(if (<= F -1.0)
(- t_1 t_2)
(if (<= F -4.4e-51)
(* (/ F (sin B)) t_0)
(if (<= F 0.1) (- (* (/ F B) t_0) t_2) (- (/ x (- (tan 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 = -1.0 / sin(B);
double t_2 = x / tan(B);
double tmp;
if (F <= -1.0) {
tmp = t_1 - t_2;
} else if (F <= -4.4e-51) {
tmp = (F / sin(B)) * t_0;
} else if (F <= 0.1) {
tmp = ((F / B) * t_0) - t_2;
} else {
tmp = (x / -tan(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) :: t_2
real(8) :: tmp
t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = (-1.0d0) / sin(b)
t_2 = x / tan(b)
if (f <= (-1.0d0)) then
tmp = t_1 - t_2
else if (f <= (-4.4d-51)) then
tmp = (f / sin(b)) * t_0
else if (f <= 0.1d0) then
tmp = ((f / b) * t_0) - t_2
else
tmp = (x / -tan(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 = -1.0 / Math.sin(B);
double t_2 = x / Math.tan(B);
double tmp;
if (F <= -1.0) {
tmp = t_1 - t_2;
} else if (F <= -4.4e-51) {
tmp = (F / Math.sin(B)) * t_0;
} else if (F <= 0.1) {
tmp = ((F / B) * t_0) - t_2;
} else {
tmp = (x / -Math.tan(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = -1.0 / math.sin(B) t_2 = x / math.tan(B) tmp = 0 if F <= -1.0: tmp = t_1 - t_2 elif F <= -4.4e-51: tmp = (F / math.sin(B)) * t_0 elif F <= 0.1: tmp = ((F / B) * t_0) - t_2 else: tmp = (x / -math.tan(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(-1.0 / sin(B)) t_2 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.0) tmp = Float64(t_1 - t_2); elseif (F <= -4.4e-51) tmp = Float64(Float64(F / sin(B)) * t_0); elseif (F <= 0.1) tmp = Float64(Float64(Float64(F / B) * t_0) - t_2); else tmp = Float64(Float64(x / Float64(-tan(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 = -1.0 / sin(B); t_2 = x / tan(B); tmp = 0.0; if (F <= -1.0) tmp = t_1 - t_2; elseif (F <= -4.4e-51) tmp = (F / sin(B)) * t_0; elseif (F <= 0.1) tmp = ((F / B) * t_0) - t_2; else tmp = (x / -tan(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[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.0], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[F, -4.4e-51], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[F, 0.1], N[(N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision] - t$95$2), $MachinePrecision], N[(N[(x / (-N[Tan[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{-1}{\sin B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1:\\
\;\;\;\;t\_1 - t\_2\\
\mathbf{elif}\;F \leq -4.4 \cdot 10^{-51}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0\\
\mathbf{elif}\;F \leq 0.1:\\
\;\;\;\;\frac{F}{B} \cdot t\_0 - t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_1\\
\end{array}
\end{array}
if F < -1Initial program 60.9%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -1 < F < -4.4e-51Initial program 99.1%
Simplified99.5%
Taylor expanded in F around 0 92.8%
Taylor expanded in F around inf 74.3%
if -4.4e-51 < F < 0.10000000000000001Initial program 99.6%
Simplified99.6%
Taylor expanded in F around 0 99.2%
Taylor expanded in B around 0 81.8%
if 0.10000000000000001 < F Initial program 52.0%
Taylor expanded in F around -inf 46.5%
div-inv46.5%
Applied egg-rr46.5%
div-inv46.5%
mul-1-neg46.5%
rgt-mult-inverse46.5%
associate-*l/33.1%
add-sqr-sqrt13.7%
sqrt-unprod50.9%
associate-*l/50.9%
rgt-mult-inverse50.9%
associate-*l/55.5%
rgt-mult-inverse55.5%
frac-times55.5%
metadata-eval55.5%
metadata-eval55.5%
frac-times55.5%
sqrt-unprod53.7%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
Final simplification90.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -2.7e+19)
(- t_0 t_1)
(if (<= F -8.2e-52)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 0.145)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_1)
(- (/ x (- (tan B))) t_0))))))
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 <= -2.7e+19) {
tmp = t_0 - t_1;
} else if (F <= -8.2e-52) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 0.145) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1;
} else {
tmp = (x / -tan(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) :: t_1
real(8) :: tmp
t_0 = (-1.0d0) / sin(b)
t_1 = x / tan(b)
if (f <= (-2.7d+19)) then
tmp = t_0 - t_1
else if (f <= (-8.2d-52)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 0.145d0) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_1
else
tmp = (x / -tan(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -2.7e+19) {
tmp = t_0 - t_1;
} else if (F <= -8.2e-52) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 0.145) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1;
} else {
tmp = (x / -Math.tan(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -2.7e+19: tmp = t_0 - t_1 elif F <= -8.2e-52: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 0.145: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1 else: tmp = (x / -math.tan(B)) - t_0 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 <= -2.7e+19) tmp = Float64(t_0 - t_1); elseif (F <= -8.2e-52) 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.145) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_1); else tmp = Float64(Float64(x / Float64(-tan(B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -2.7e+19) tmp = t_0 - t_1; elseif (F <= -8.2e-52) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 0.145) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1; else tmp = (x / -tan(B)) - t_0; end tmp_2 = 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, -2.7e+19], N[(t$95$0 - t$95$1), $MachinePrecision], If[LessEqual[F, -8.2e-52], 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.145], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+19}:\\
\;\;\;\;t\_0 - t\_1\\
\mathbf{elif}\;F \leq -8.2 \cdot 10^{-52}:\\
\;\;\;\;\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.145:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_0\\
\end{array}
\end{array}
if F < -2.7e19Initial program 59.3%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
Applied egg-rr99.8%
if -2.7e19 < F < -8.19999999999999977e-52Initial program 99.3%
Taylor expanded in B around 0 90.9%
if -8.19999999999999977e-52 < F < 0.14499999999999999Initial program 99.6%
Simplified99.6%
Taylor expanded in F around 0 99.2%
Taylor expanded in B around 0 81.8%
if 0.14499999999999999 < F Initial program 52.0%
Taylor expanded in F around -inf 46.5%
div-inv46.5%
Applied egg-rr46.5%
div-inv46.5%
mul-1-neg46.5%
rgt-mult-inverse46.5%
associate-*l/33.1%
add-sqr-sqrt13.7%
sqrt-unprod50.9%
associate-*l/50.9%
rgt-mult-inverse50.9%
associate-*l/55.5%
rgt-mult-inverse55.5%
frac-times55.5%
metadata-eval55.5%
metadata-eval55.5%
frac-times55.5%
sqrt-unprod53.7%
add-sqr-sqrt98.6%
Applied egg-rr98.6%
Final simplification91.6%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e+232)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F -1.55e+24)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -2.85e-78)
(- (/ -1.0 B) (* x (/ 1.0 (tan B))))
(if (<= F 0.000245)
(* x (/ (cos B) (- (sin B))))
(- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e+232) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= -1.55e+24) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -2.85e-78) {
tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
} else if (F <= 0.000245) {
tmp = x * (cos(B) / -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 <= (-5.2d+232)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= (-1.55d+24)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-2.85d-78)) then
tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
else if (f <= 0.000245d0) then
tmp = x * (cos(b) / -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 <= -5.2e+232) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= -1.55e+24) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -2.85e-78) {
tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
} else if (F <= 0.000245) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.2e+232: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= -1.55e+24: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -2.85e-78: tmp = (-1.0 / B) - (x * (1.0 / math.tan(B))) elif F <= 0.000245: tmp = x * (math.cos(B) / -math.sin(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.2e+232) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= -1.55e+24) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -2.85e-78) tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 0.000245) tmp = Float64(x * Float64(cos(B) / Float64(-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 <= -5.2e+232) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= -1.55e+24) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -2.85e-78) tmp = (-1.0 / B) - (x * (1.0 / tan(B))); elseif (F <= 0.000245) tmp = x * (cos(B) / -sin(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.2e+232], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.55e+24], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.85e-78], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.000245], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[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 -5.2 \cdot 10^{+232}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.55 \cdot 10^{+24}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.85 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 0.000245:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.19999999999999947e232Initial program 42.9%
Taylor expanded in F around -inf 99.6%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in B around 0 90.5%
if -5.19999999999999947e232 < F < -1.55000000000000005e24Initial program 63.9%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 83.9%
+-commutative83.9%
unsub-neg83.9%
Applied egg-rr83.9%
if -1.55000000000000005e24 < F < -2.8499999999999999e-78Initial program 99.5%
Taylor expanded in F around -inf 47.1%
Taylor expanded in B around 0 48.5%
if -2.8499999999999999e-78 < F < 2.4499999999999999e-4Initial program 99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around 0 67.7%
mul-1-neg67.7%
associate-/l*67.7%
distribute-rgt-neg-in67.7%
distribute-neg-frac267.7%
Simplified67.7%
if 2.4499999999999999e-4 < F Initial program 52.7%
Taylor expanded in B around 0 35.4%
Taylor expanded in F around inf 78.5%
Final simplification73.6%
(FPCore (F B x)
:precision binary64
(if (<= F -6e+232)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F -2.15e+24)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -3.3e-78)
(- (/ -1.0 B) (* x (/ 1.0 (tan B))))
(if (<= F 0.00077)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e+232) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= -2.15e+24) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -3.3e-78) {
tmp = (-1.0 / B) - (x * (1.0 / tan(B)));
} else if (F <= 0.00077) {
tmp = (x * cos(B)) / -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 <= (-6d+232)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= (-2.15d+24)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-3.3d-78)) then
tmp = ((-1.0d0) / b) - (x * (1.0d0 / tan(b)))
else if (f <= 0.00077d0) then
tmp = (x * cos(b)) / -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 <= -6e+232) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= -2.15e+24) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -3.3e-78) {
tmp = (-1.0 / B) - (x * (1.0 / Math.tan(B)));
} else if (F <= 0.00077) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e+232: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= -2.15e+24: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -3.3e-78: tmp = (-1.0 / B) - (x * (1.0 / math.tan(B))) elif F <= 0.00077: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e+232) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= -2.15e+24) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -3.3e-78) tmp = Float64(Float64(-1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 0.00077) tmp = Float64(Float64(x * cos(B)) / Float64(-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 <= -6e+232) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= -2.15e+24) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -3.3e-78) tmp = (-1.0 / B) - (x * (1.0 / tan(B))); elseif (F <= 0.00077) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e+232], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.15e+24], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.3e-78], N[(N[(-1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00077], N[(N[(x * N[Cos[B], $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 -6 \cdot 10^{+232}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -2.15 \cdot 10^{+24}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -3.3 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 0.00077:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.00000000000000006e232Initial program 42.9%
Taylor expanded in F around -inf 99.6%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in B around 0 90.5%
if -6.00000000000000006e232 < F < -2.14999999999999994e24Initial program 63.9%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 83.9%
+-commutative83.9%
unsub-neg83.9%
Applied egg-rr83.9%
if -2.14999999999999994e24 < F < -3.29999999999999982e-78Initial program 99.5%
Taylor expanded in F around -inf 47.1%
Taylor expanded in B around 0 48.5%
if -3.29999999999999982e-78 < F < 7.6999999999999996e-4Initial program 99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around 0 67.7%
if 7.6999999999999996e-4 < F Initial program 52.7%
Taylor expanded in B around 0 35.4%
Taylor expanded in F around inf 78.5%
Final simplification73.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))))
(if (<= F -9.6e-29)
(- t_0 (/ x (tan B)))
(if (<= F 4.7e-40)
(/ (* x (cos B)) (- (sin B)))
(- (/ x (- (tan B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double tmp;
if (F <= -9.6e-29) {
tmp = t_0 - (x / tan(B));
} else if (F <= 4.7e-40) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (x / -tan(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 = (-1.0d0) / sin(b)
if (f <= (-9.6d-29)) then
tmp = t_0 - (x / tan(b))
else if (f <= 4.7d-40) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (x / -tan(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 / Math.sin(B);
double tmp;
if (F <= -9.6e-29) {
tmp = t_0 - (x / Math.tan(B));
} else if (F <= 4.7e-40) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (x / -Math.tan(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / math.sin(B) tmp = 0 if F <= -9.6e-29: tmp = t_0 - (x / math.tan(B)) elif F <= 4.7e-40: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (x / -math.tan(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -9.6e-29) tmp = Float64(t_0 - Float64(x / tan(B))); elseif (F <= 4.7e-40) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(x / Float64(-tan(B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / sin(B); tmp = 0.0; if (F <= -9.6e-29) tmp = t_0 - (x / tan(B)); elseif (F <= 4.7e-40) tmp = (x * cos(B)) / -sin(B); else tmp = (x / -tan(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9.6e-29], N[(t$95$0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.7e-40], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -9.6 \cdot 10^{-29}:\\
\;\;\;\;t\_0 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.7 \cdot 10^{-40}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B} - t\_0\\
\end{array}
\end{array}
if F < -9.59999999999999968e-29Initial program 65.0%
Taylor expanded in F around -inf 91.4%
div-inv91.4%
Applied egg-rr91.4%
if -9.59999999999999968e-29 < F < 4.6999999999999999e-40Initial program 99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around 0 65.8%
if 4.6999999999999999e-40 < F Initial program 56.8%
Taylor expanded in F around -inf 47.6%
div-inv47.6%
Applied egg-rr47.6%
div-inv47.6%
mul-1-neg47.6%
rgt-mult-inverse47.6%
associate-*l/35.5%
add-sqr-sqrt15.2%
sqrt-unprod50.1%
associate-*l/50.1%
rgt-mult-inverse50.1%
associate-*l/54.3%
rgt-mult-inverse54.3%
frac-times54.3%
metadata-eval54.3%
metadata-eval54.3%
frac-times54.3%
sqrt-unprod51.2%
add-sqr-sqrt94.8%
Applied egg-rr94.8%
Final simplification82.2%
(FPCore (F B x)
:precision binary64
(if (<= F -7.5e-30)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 0.0007)
(/ (* x (cos B)) (- (sin B)))
(if (or (<= F 1.2e+177) (not (<= F 2.3e+238)))
(- (/ 1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-30) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 0.0007) {
tmp = (x * cos(B)) / -sin(B);
} else if ((F <= 1.2e+177) || !(F <= 2.3e+238)) {
tmp = (1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-7.5d-30)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 0.0007d0) then
tmp = (x * cos(b)) / -sin(b)
else if ((f <= 1.2d+177) .or. (.not. (f <= 2.3d+238))) then
tmp = (1.0d0 / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-30) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 0.0007) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if ((F <= 1.2e+177) || !(F <= 2.3e+238)) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.5e-30: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 0.0007: tmp = (x * math.cos(B)) / -math.sin(B) elif (F <= 1.2e+177) or not (F <= 2.3e+238): tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.5e-30) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 0.0007) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif ((F <= 1.2e+177) || !(F <= 2.3e+238)) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.5e-30) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 0.0007) tmp = (x * cos(B)) / -sin(B); elseif ((F <= 1.2e+177) || ~((F <= 2.3e+238))) tmp = (1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.5e-30], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0007], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 1.2e+177], N[Not[LessEqual[F, 2.3e+238]], $MachinePrecision]], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.0007:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+177} \lor \neg \left(F \leq 2.3 \cdot 10^{+238}\right):\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -7.5000000000000006e-30Initial program 65.0%
Taylor expanded in F around -inf 91.4%
div-inv91.4%
Applied egg-rr91.4%
if -7.5000000000000006e-30 < F < 6.99999999999999993e-4Initial program 99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around 0 65.9%
if 6.99999999999999993e-4 < F < 1.2e177 or 2.30000000000000003e238 < F Initial program 51.5%
Taylor expanded in B around 0 41.5%
Taylor expanded in F around inf 86.7%
if 1.2e177 < F < 2.30000000000000003e238Initial program 56.7%
Taylor expanded in F around inf 74.1%
un-div-inv74.2%
Applied egg-rr74.2%
Taylor expanded in B around 0 89.7%
Final simplification79.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -5.6e+232)
t_0
(if (<= F -1.1e+28)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -3.8e-193)
t_0
(if (<= F 0.9)
(+ (* x (/ -1.0 (tan B))) (/ (/ F B) F))
(- (/ 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 <= -5.6e+232) {
tmp = t_0;
} else if (F <= -1.1e+28) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -3.8e-193) {
tmp = t_0;
} else if (F <= 0.9) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) / F);
} 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 <= (-5.6d+232)) then
tmp = t_0
else if (f <= (-1.1d+28)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-3.8d-193)) then
tmp = t_0
else if (f <= 0.9d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / b) / f)
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 <= -5.6e+232) {
tmp = t_0;
} else if (F <= -1.1e+28) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -3.8e-193) {
tmp = t_0;
} else if (F <= 0.9) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / B) / F);
} 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 <= -5.6e+232: tmp = t_0 elif F <= -1.1e+28: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -3.8e-193: tmp = t_0 elif F <= 0.9: tmp = (x * (-1.0 / math.tan(B))) + ((F / B) / F) 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 <= -5.6e+232) tmp = t_0; elseif (F <= -1.1e+28) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -3.8e-193) tmp = t_0; elseif (F <= 0.9) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) / F)); 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 <= -5.6e+232) tmp = t_0; elseif (F <= -1.1e+28) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -3.8e-193) tmp = t_0; elseif (F <= 0.9) tmp = (x * (-1.0 / tan(B))) + ((F / B) / F); 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, -5.6e+232], t$95$0, If[LessEqual[F, -1.1e+28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.8e-193], t$95$0, If[LessEqual[F, 0.9], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] / F), $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 -5.6 \cdot 10^{+232}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -1.1 \cdot 10^{+28}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 0.9:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\frac{F}{B}}{F}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.5999999999999998e232 or -1.09999999999999993e28 < F < -3.80000000000000004e-193Initial program 80.9%
Taylor expanded in F around -inf 59.3%
div-inv59.3%
Applied egg-rr59.3%
Taylor expanded in B around 0 62.5%
if -5.5999999999999998e232 < F < -1.09999999999999993e28Initial program 63.9%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 83.9%
+-commutative83.9%
unsub-neg83.9%
Applied egg-rr83.9%
if -3.80000000000000004e-193 < F < 0.900000000000000022Initial program 99.6%
Taylor expanded in F around inf 35.6%
un-div-inv35.6%
Applied egg-rr35.6%
Taylor expanded in B around 0 52.2%
if 0.900000000000000022 < F Initial program 52.0%
Taylor expanded in B around 0 34.4%
Taylor expanded in F around inf 79.6%
Final simplification67.6%
(FPCore (F B x)
:precision binary64
(if (<= x -1.65e-41)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= x 2.7e-167)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= x 3.2e-100)
(+ (/ -1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.65e-41) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (x <= 2.7e-167) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (x <= 3.2e-100) {
tmp = (-1.0 / sin(B)) + (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / 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 (x <= (-1.65d-41)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (x <= 2.7d-167) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (x <= 3.2d-100) then
tmp = ((-1.0d0) / sin(b)) + (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (x <= -1.65e-41) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (x <= 2.7e-167) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (x <= 3.2e-100) {
tmp = (-1.0 / Math.sin(B)) + (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if x <= -1.65e-41: tmp = (-1.0 / B) - (x / math.tan(B)) elif x <= 2.7e-167: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif x <= 3.2e-100: tmp = (-1.0 / math.sin(B)) + (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (x <= -1.65e-41) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (x <= 2.7e-167) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (x <= 3.2e-100) tmp = Float64(Float64(-1.0 / sin(B)) + Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (x <= -1.65e-41) tmp = (-1.0 / B) - (x / tan(B)); elseif (x <= 2.7e-167) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (x <= 3.2e-100) tmp = (-1.0 / sin(B)) + (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[x, -1.65e-41], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-167], 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], If[LessEqual[x, 3.2e-100], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.65 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-167}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{-100}:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if x < -1.65000000000000012e-41Initial program 62.3%
Taylor expanded in F around -inf 85.3%
div-inv85.3%
Applied egg-rr85.3%
Taylor expanded in B around 0 88.9%
if -1.65000000000000012e-41 < x < 2.7000000000000001e-167Initial program 80.3%
Taylor expanded in B around 0 67.8%
Taylor expanded in B around 0 42.6%
if 2.7000000000000001e-167 < x < 3.20000000000000017e-100Initial program 59.7%
Taylor expanded in F around -inf 59.4%
Taylor expanded in B around 0 59.4%
add-sqr-sqrt46.7%
sqrt-unprod37.4%
frac-times37.4%
metadata-eval37.4%
metadata-eval37.4%
frac-times37.4%
sqrt-unprod2.0%
add-sqr-sqrt14.4%
*-un-lft-identity14.4%
metadata-eval14.4%
cancel-sign-sub-inv14.4%
div-inv14.4%
*-un-lft-identity14.4%
sub-neg14.4%
add-sqr-sqrt13.0%
sqrt-unprod14.4%
sqr-neg14.4%
sqrt-unprod8.0%
add-sqr-sqrt14.4%
distribute-frac-neg214.4%
metadata-eval14.4%
Applied egg-rr59.4%
*-lft-identity59.4%
+-commutative59.4%
Simplified59.4%
if 3.20000000000000017e-100 < x Initial program 81.8%
Taylor expanded in F around inf 69.6%
un-div-inv69.7%
Applied egg-rr69.7%
Taylor expanded in B around 0 84.3%
Final simplification67.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -5e+232)
t_0
(if (<= F -1.05e+32)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 0.0007) t_0 (- (/ 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 <= -5e+232) {
tmp = t_0;
} else if (F <= -1.05e+32) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 0.0007) {
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 = ((-1.0d0) / b) - (x / tan(b))
if (f <= (-5d+232)) then
tmp = t_0
else if (f <= (-1.05d+32)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 0.0007d0) 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 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= -5e+232) {
tmp = t_0;
} else if (F <= -1.05e+32) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 0.0007) {
tmp = t_0;
} 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 <= -5e+232: tmp = t_0 elif F <= -1.05e+32: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 0.0007: tmp = t_0 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 <= -5e+232) tmp = t_0; elseif (F <= -1.05e+32) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 0.0007) 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 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= -5e+232) tmp = t_0; elseif (F <= -1.05e+32) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 0.0007) 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[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+232], t$95$0, If[LessEqual[F, -1.05e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0007], 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{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+232}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -1.05 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 0.0007:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.99999999999999987e232 or -1.05e32 < F < 6.99999999999999993e-4Initial program 91.2%
Taylor expanded in F around -inf 45.8%
div-inv45.8%
Applied egg-rr45.8%
Taylor expanded in B around 0 53.1%
if -4.99999999999999987e232 < F < -1.05e32Initial program 63.9%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 83.9%
+-commutative83.9%
unsub-neg83.9%
Applied egg-rr83.9%
if 6.99999999999999993e-4 < F Initial program 52.7%
Taylor expanded in B around 0 35.4%
Taylor expanded in F around inf 78.5%
Final simplification65.3%
(FPCore (F B x) :precision binary64 (if (<= F -5.8e-79) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 1.25e-108) (/ (- x) B) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.8e-79) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.25e-108) {
tmp = -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 <= (-5.8d-79)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.25d-108) then
tmp = -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 <= -5.8e-79) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.25e-108) {
tmp = -x / B;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.8e-79: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.25e-108: tmp = -x / B else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.8e-79) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.25e-108) tmp = Float64(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 <= -5.8e-79) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.25e-108) tmp = -x / B; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.8e-79], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.25e-108], N[((-x) / B), $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 -5.8 \cdot 10^{-79}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{-108}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.8000000000000001e-79Initial program 68.6%
Taylor expanded in F around -inf 85.4%
Taylor expanded in B around 0 63.2%
+-commutative63.2%
unsub-neg63.2%
Applied egg-rr63.2%
if -5.8000000000000001e-79 < F < 1.25e-108Initial program 99.5%
Taylor expanded in F around -inf 32.2%
Taylor expanded in B around 0 15.7%
Taylor expanded in x around inf 30.8%
associate-*r/30.8%
neg-mul-130.8%
Simplified30.8%
if 1.25e-108 < F Initial program 62.1%
Taylor expanded in B around 0 43.9%
Taylor expanded in F around inf 68.8%
Final simplification54.7%
(FPCore (F B x) :precision binary64 (if (<= F -4.3e-86) (- (/ -1.0 (sin B)) (/ x B)) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.3e-86) {
tmp = (-1.0 / sin(B)) - (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 <= (-4.3d-86)) then
tmp = ((-1.0d0) / sin(b)) - (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 <= -4.3e-86) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.3e-86: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.3e-86) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.3e-86) tmp = (-1.0 / sin(B)) - (x / B); else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.3e-86], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-86}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -4.30000000000000013e-86Initial program 68.6%
Taylor expanded in F around -inf 85.4%
Taylor expanded in B around 0 63.2%
+-commutative63.2%
unsub-neg63.2%
Applied egg-rr63.2%
if -4.30000000000000013e-86 < F Initial program 81.0%
Taylor expanded in F around -inf 38.8%
Taylor expanded in B around 0 22.0%
Taylor expanded in x around inf 30.3%
associate-*r/30.3%
neg-mul-130.3%
Simplified30.3%
Final simplification42.5%
(FPCore (F B x) :precision binary64 (if (<= F -3.2e-78) (- (/ -1.0 B) (/ x B)) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-78) {
tmp = (-1.0 / B) - (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 <= (-3.2d-78)) then
tmp = ((-1.0d0) / b) - (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 <= -3.2e-78) {
tmp = (-1.0 / B) - (x / B);
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.2e-78: tmp = (-1.0 / B) - (x / B) else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.2e-78) tmp = Float64(Float64(-1.0 / B) - Float64(x / B)); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.2e-78) tmp = (-1.0 / B) - (x / B); else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-78], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -3.2e-78Initial program 68.3%
Taylor expanded in F around -inf 86.3%
Taylor expanded in B around 0 63.8%
Taylor expanded in B around 0 47.3%
if -3.2e-78 < F Initial program 81.1%
Taylor expanded in F around -inf 38.6%
Taylor expanded in B around 0 21.9%
Taylor expanded in x around inf 30.2%
associate-*r/30.2%
neg-mul-130.2%
Simplified30.2%
Final simplification36.4%
(FPCore (F B x) :precision binary64 (if (<= F -4.6e-78) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-78) {
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 <= (-4.6d-78)) 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 <= -4.6e-78) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.6e-78: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.6e-78) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.6e-78) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.6e-78], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.6 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -4.6000000000000004e-78Initial program 68.3%
Taylor expanded in F around -inf 86.3%
Taylor expanded in B around 0 63.8%
Taylor expanded in B around 0 47.2%
mul-1-neg47.2%
distribute-neg-frac247.2%
Simplified47.2%
if -4.6000000000000004e-78 < F Initial program 81.1%
Taylor expanded in F around -inf 38.6%
Taylor expanded in B around 0 21.9%
Taylor expanded in x around inf 30.2%
associate-*r/30.2%
neg-mul-130.2%
Simplified30.2%
Final simplification36.4%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 76.4%
Taylor expanded in F around -inf 56.1%
Taylor expanded in B around 0 37.3%
Taylor expanded in x around inf 29.4%
associate-*r/29.4%
neg-mul-129.4%
Simplified29.4%
Final simplification29.4%
herbie shell --seed 2024079
(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))))))