
(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 (/ x (tan B))))
(if (<= F -1e+65)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 40000000.0)
(-
(* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)))
(* (/ x (sin B)) (cos B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+65) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 40000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - ((x / sin(B)) * cos(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+65) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 40000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - Float64(Float64(x / sin(B)) * cos(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+65], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 40000000.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] - N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+65}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\sin B} \cdot \cos B\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -9.9999999999999999e64Initial program 61.4%
Taylor expanded in F around -inf 99.9%
add-sqr-sqrt54.2%
sqrt-unprod63.7%
frac-times63.6%
metadata-eval63.6%
metadata-eval63.6%
frac-times63.7%
rgt-mult-inverse63.7%
associate-*l/59.5%
rgt-mult-inverse59.5%
associate-*l/59.5%
sqrt-unprod15.3%
add-sqr-sqrt36.9%
associate-*l/39.5%
rgt-mult-inverse39.5%
*-un-lft-identity39.5%
metadata-eval39.5%
cancel-sign-sub-inv39.5%
div-inv39.5%
Applied egg-rr99.9%
neg-sub099.9%
distribute-neg-in99.9%
distribute-neg-frac299.9%
distribute-neg-frac99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
distribute-frac-neg299.9%
unsub-neg99.9%
Applied egg-rr99.9%
if -9.9999999999999999e64 < F < 4e7Initial program 99.5%
Simplified99.6%
tan-quot99.6%
associate-/r/99.7%
Applied egg-rr99.7%
if 4e7 < F Initial program 48.1%
Taylor expanded in F around -inf 43.4%
+-commutative43.4%
unsub-neg43.4%
add-sqr-sqrt16.7%
sqrt-unprod47.7%
frac-times47.7%
metadata-eval47.7%
metadata-eval47.7%
frac-times47.7%
rgt-mult-inverse47.6%
associate-*l/39.4%
rgt-mult-inverse39.4%
associate-*l/39.4%
sqrt-unprod27.6%
add-sqr-sqrt70.2%
associate-*l/99.7%
rgt-mult-inverse99.8%
un-div-inv99.9%
Applied egg-rr99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8.8e+62)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 40000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ (* x (cos B)) (sin B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8.8e+62) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 40000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - ((x * cos(B)) / sin(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-8.8d+62)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 40000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - ((x * cos(b)) / sin(b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -8.8e+62) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 40000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - ((x * Math.cos(B)) / Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -8.8e+62: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 40000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - ((x * math.cos(B)) / math.sin(B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8.8e+62) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 40000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(Float64(x * cos(B)) / sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -8.8e+62) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 40000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - ((x * cos(B)) / sin(B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.8e+62], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 40000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{+62}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x \cdot \cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8.80000000000000058e62Initial program 63.0%
Taylor expanded in F around -inf 99.9%
add-sqr-sqrt53.3%
sqrt-unprod62.4%
frac-times62.3%
metadata-eval62.3%
metadata-eval62.3%
frac-times62.4%
rgt-mult-inverse62.4%
associate-*l/58.4%
rgt-mult-inverse58.3%
associate-*l/58.3%
sqrt-unprod14.7%
add-sqr-sqrt35.3%
associate-*l/37.9%
rgt-mult-inverse37.9%
*-un-lft-identity37.9%
metadata-eval37.9%
cancel-sign-sub-inv37.9%
div-inv37.9%
Applied egg-rr99.9%
neg-sub099.9%
distribute-neg-in99.9%
distribute-neg-frac299.9%
distribute-neg-frac99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
distribute-frac-neg299.9%
unsub-neg99.9%
Applied egg-rr99.9%
if -8.80000000000000058e62 < F < 4e7Initial program 99.5%
Taylor expanded in x around 0 99.7%
if 4e7 < F Initial program 48.1%
Taylor expanded in F around -inf 43.4%
+-commutative43.4%
unsub-neg43.4%
add-sqr-sqrt16.7%
sqrt-unprod47.7%
frac-times47.7%
metadata-eval47.7%
metadata-eval47.7%
frac-times47.7%
rgt-mult-inverse47.6%
associate-*l/39.4%
rgt-mult-inverse39.4%
associate-*l/39.4%
sqrt-unprod27.6%
add-sqr-sqrt70.2%
associate-*l/99.7%
rgt-mult-inverse99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-4d+17)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -4e+17) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(B)));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -4e+17: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -4e+17) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4e17Initial program 69.6%
Taylor expanded in F around -inf 99.9%
add-sqr-sqrt55.6%
sqrt-unprod60.9%
frac-times60.9%
metadata-eval60.9%
metadata-eval60.9%
frac-times60.9%
rgt-mult-inverse60.9%
associate-*l/57.6%
rgt-mult-inverse57.6%
associate-*l/57.6%
sqrt-unprod13.3%
add-sqr-sqrt36.2%
associate-*l/39.5%
rgt-mult-inverse39.5%
*-un-lft-identity39.5%
metadata-eval39.5%
cancel-sign-sub-inv39.5%
div-inv39.5%
Applied egg-rr99.9%
neg-sub099.9%
distribute-neg-in99.9%
distribute-neg-frac299.9%
distribute-neg-frac99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
distribute-frac-neg299.9%
unsub-neg99.9%
Applied egg-rr99.9%
if -4e17 < F < 2Initial program 99.5%
if 2 < F Initial program 48.1%
Taylor expanded in F around -inf 43.4%
+-commutative43.4%
unsub-neg43.4%
add-sqr-sqrt16.7%
sqrt-unprod47.7%
frac-times47.7%
metadata-eval47.7%
metadata-eval47.7%
frac-times47.7%
rgt-mult-inverse47.6%
associate-*l/39.4%
rgt-mult-inverse39.4%
associate-*l/39.4%
sqrt-unprod27.6%
add-sqr-sqrt70.2%
associate-*l/99.7%
rgt-mult-inverse99.8%
un-div-inv99.9%
Applied egg-rr99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -1.75)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.42e-12)
(- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_1)
(- t_0 t_1)))))
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 <= -1.75) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.42e-12) {
tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - 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 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-1.75d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.42d-12) then
tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_1
else
tmp = t_0 - t_1
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 <= -1.75) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.42e-12) {
tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -1.75: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.42e-12: tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1 else: tmp = t_0 - t_1 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 <= -1.75) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.42e-12) tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_1); else tmp = Float64(t_0 - t_1); 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 <= -1.75) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.42e-12) tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1; else tmp = t_0 - t_1; 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, -1.75], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.42e-12], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.75:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -1.75Initial program 71.0%
Taylor expanded in F around -inf 99.4%
add-sqr-sqrt55.4%
sqrt-unprod60.5%
frac-times60.4%
metadata-eval60.4%
metadata-eval60.4%
frac-times60.5%
rgt-mult-inverse60.5%
associate-*l/57.3%
rgt-mult-inverse57.3%
associate-*l/57.2%
sqrt-unprod12.7%
add-sqr-sqrt34.7%
associate-*l/37.8%
rgt-mult-inverse37.8%
*-un-lft-identity37.8%
metadata-eval37.8%
cancel-sign-sub-inv37.8%
div-inv37.8%
Applied egg-rr99.5%
neg-sub099.5%
distribute-neg-in99.5%
distribute-neg-frac299.5%
distribute-neg-frac99.5%
metadata-eval99.5%
Simplified99.5%
+-commutative99.5%
distribute-frac-neg299.5%
unsub-neg99.5%
Applied egg-rr99.5%
if -1.75 < F < 1.42e-12Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
if 1.42e-12 < F Initial program 49.8%
Taylor expanded in F around -inf 43.6%
+-commutative43.6%
unsub-neg43.6%
add-sqr-sqrt16.2%
sqrt-unprod46.4%
frac-times46.4%
metadata-eval46.4%
metadata-eval46.4%
frac-times46.4%
rgt-mult-inverse46.4%
associate-*l/38.5%
rgt-mult-inverse38.5%
associate-*l/38.4%
sqrt-unprod28.6%
add-sqr-sqrt69.9%
associate-*l/98.4%
rgt-mult-inverse98.5%
un-div-inv98.6%
Applied egg-rr98.6%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.42e-12)
(- (/ (* F (sqrt 0.5)) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.42d-12) then
tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.42e-12: tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.42e-12) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.42e-12) tmp = ((F * sqrt(0.5)) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42e-12], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 71.0%
Taylor expanded in F around -inf 99.4%
add-sqr-sqrt55.4%
sqrt-unprod60.5%
frac-times60.4%
metadata-eval60.4%
metadata-eval60.4%
frac-times60.5%
rgt-mult-inverse60.5%
associate-*l/57.3%
rgt-mult-inverse57.3%
associate-*l/57.2%
sqrt-unprod12.7%
add-sqr-sqrt34.7%
associate-*l/37.8%
rgt-mult-inverse37.8%
*-un-lft-identity37.8%
metadata-eval37.8%
cancel-sign-sub-inv37.8%
div-inv37.8%
Applied egg-rr99.5%
neg-sub099.5%
distribute-neg-in99.5%
distribute-neg-frac299.5%
distribute-neg-frac99.5%
metadata-eval99.5%
Simplified99.5%
+-commutative99.5%
distribute-frac-neg299.5%
unsub-neg99.5%
Applied egg-rr99.5%
if -1.4199999999999999 < F < 1.42e-12Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in x around 0 99.6%
if 1.42e-12 < F Initial program 49.8%
Taylor expanded in F around -inf 43.6%
+-commutative43.6%
unsub-neg43.6%
add-sqr-sqrt16.2%
sqrt-unprod46.4%
frac-times46.4%
metadata-eval46.4%
metadata-eval46.4%
frac-times46.4%
rgt-mult-inverse46.4%
associate-*l/38.5%
rgt-mult-inverse38.5%
associate-*l/38.4%
sqrt-unprod28.6%
add-sqr-sqrt69.9%
associate-*l/98.4%
rgt-mult-inverse98.5%
un-div-inv98.6%
Applied egg-rr98.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.42e-12)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.42d-12) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.42e-12: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.42e-12) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.42e-12) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42e-12], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 71.0%
Taylor expanded in F around -inf 99.4%
add-sqr-sqrt55.4%
sqrt-unprod60.5%
frac-times60.4%
metadata-eval60.4%
metadata-eval60.4%
frac-times60.5%
rgt-mult-inverse60.5%
associate-*l/57.3%
rgt-mult-inverse57.3%
associate-*l/57.2%
sqrt-unprod12.7%
add-sqr-sqrt34.7%
associate-*l/37.8%
rgt-mult-inverse37.8%
*-un-lft-identity37.8%
metadata-eval37.8%
cancel-sign-sub-inv37.8%
div-inv37.8%
Applied egg-rr99.5%
neg-sub099.5%
distribute-neg-in99.5%
distribute-neg-frac299.5%
distribute-neg-frac99.5%
metadata-eval99.5%
Simplified99.5%
+-commutative99.5%
distribute-frac-neg299.5%
unsub-neg99.5%
Applied egg-rr99.5%
if -1.4199999999999999 < F < 1.42e-12Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in x around 0 99.6%
if 1.42e-12 < F Initial program 49.8%
Taylor expanded in F around -inf 43.6%
+-commutative43.6%
unsub-neg43.6%
add-sqr-sqrt16.2%
sqrt-unprod46.4%
frac-times46.4%
metadata-eval46.4%
metadata-eval46.4%
frac-times46.4%
rgt-mult-inverse46.4%
associate-*l/38.5%
rgt-mult-inverse38.5%
associate-*l/38.4%
sqrt-unprod28.6%
add-sqr-sqrt69.9%
associate-*l/98.4%
rgt-mult-inverse98.5%
un-div-inv98.6%
Applied egg-rr98.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.8e-6)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -7.5e-78)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 1.42e-12)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) t_0)
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.8e-6) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -7.5e-78) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 1.42e-12) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.8d-6)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-7.5d-78)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 1.42d-12) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.8e-6) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -7.5e-78) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 1.42e-12) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.8e-6: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -7.5e-78: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 1.42e-12: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.8e-6) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -7.5e-78) 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 <= 1.42e-12) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.8e-6) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -7.5e-78) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 1.42e-12) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.8e-6], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -7.5e-78], 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, 1.42e-12], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-78}:\\
\;\;\;\;\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 1.42 \cdot 10^{-12}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.79999999999999992e-6Initial program 71.3%
Taylor expanded in F around -inf 99.4%
add-sqr-sqrt54.7%
sqrt-unprod60.9%
frac-times60.8%
metadata-eval60.8%
metadata-eval60.8%
frac-times60.9%
rgt-mult-inverse60.9%
associate-*l/57.8%
rgt-mult-inverse57.7%
associate-*l/57.7%
sqrt-unprod13.7%
add-sqr-sqrt35.4%
associate-*l/38.5%
rgt-mult-inverse38.5%
*-un-lft-identity38.5%
metadata-eval38.5%
cancel-sign-sub-inv38.5%
div-inv38.5%
Applied egg-rr99.4%
neg-sub099.4%
distribute-neg-in99.4%
distribute-neg-frac299.4%
distribute-neg-frac99.4%
metadata-eval99.4%
Simplified99.4%
+-commutative99.4%
distribute-frac-neg299.4%
unsub-neg99.4%
Applied egg-rr99.4%
if -1.79999999999999992e-6 < F < -7.50000000000000041e-78Initial program 99.2%
Taylor expanded in B around 0 99.5%
if -7.50000000000000041e-78 < F < 1.42e-12Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 92.2%
if 1.42e-12 < F Initial program 49.8%
Taylor expanded in F around -inf 43.6%
+-commutative43.6%
unsub-neg43.6%
add-sqr-sqrt16.2%
sqrt-unprod46.4%
frac-times46.4%
metadata-eval46.4%
metadata-eval46.4%
frac-times46.4%
rgt-mult-inverse46.4%
associate-*l/38.5%
rgt-mult-inverse38.5%
associate-*l/38.4%
sqrt-unprod28.6%
add-sqr-sqrt69.9%
associate-*l/98.4%
rgt-mult-inverse98.5%
un-div-inv98.6%
Applied egg-rr98.6%
Final simplification96.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.8e-41)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.42e-12)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.8e-41) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-7.8d-41)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.42d-12) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -7.8e-41) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -7.8e-41: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.42e-12: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.8e-41) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.42e-12) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -7.8e-41) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.42e-12) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.8e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42e-12], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.8 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7.79999999999999982e-41Initial program 72.5%
Taylor expanded in F around -inf 97.5%
add-sqr-sqrt53.6%
sqrt-unprod60.6%
frac-times60.5%
metadata-eval60.5%
metadata-eval60.5%
frac-times60.6%
rgt-mult-inverse60.6%
associate-*l/57.6%
rgt-mult-inverse57.5%
associate-*l/57.5%
sqrt-unprod14.1%
add-sqr-sqrt36.0%
associate-*l/39.0%
rgt-mult-inverse39.0%
*-un-lft-identity39.0%
metadata-eval39.0%
cancel-sign-sub-inv39.0%
div-inv39.0%
Applied egg-rr97.5%
neg-sub097.5%
distribute-neg-in97.5%
distribute-neg-frac297.5%
distribute-neg-frac97.5%
metadata-eval97.5%
Simplified97.5%
+-commutative97.5%
distribute-frac-neg297.5%
unsub-neg97.5%
Applied egg-rr97.5%
if -7.79999999999999982e-41 < F < 1.42e-12Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 89.1%
if 1.42e-12 < F Initial program 49.8%
Taylor expanded in F around -inf 43.6%
+-commutative43.6%
unsub-neg43.6%
add-sqr-sqrt16.2%
sqrt-unprod46.4%
frac-times46.4%
metadata-eval46.4%
metadata-eval46.4%
frac-times46.4%
rgt-mult-inverse46.4%
associate-*l/38.5%
rgt-mult-inverse38.5%
associate-*l/38.4%
sqrt-unprod28.6%
add-sqr-sqrt69.9%
associate-*l/98.4%
rgt-mult-inverse98.5%
un-div-inv98.6%
Applied egg-rr98.6%
Final simplification94.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))) (t_1 (- (/ -1.0 (sin B)) (/ x B))))
(if (<= F -8.2e+133)
t_1
(if (<= F -7e+99)
(+ t_0 (/ -1.0 B))
(if (<= F -182.0)
t_1
(if (<= F 1.7e-145)
(* (/ x (sin B)) (- (cos B)))
(+ t_0 (/ 1.0 B))))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = (-1.0 / sin(B)) - (x / B);
double tmp;
if (F <= -8.2e+133) {
tmp = t_1;
} else if (F <= -7e+99) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -182.0) {
tmp = t_1;
} else if (F <= 1.7e-145) {
tmp = (x / sin(B)) * -cos(B);
} else {
tmp = t_0 + (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
t_1 = ((-1.0d0) / sin(b)) - (x / b)
if (f <= (-8.2d+133)) then
tmp = t_1
else if (f <= (-7d+99)) then
tmp = t_0 + ((-1.0d0) / b)
else if (f <= (-182.0d0)) then
tmp = t_1
else if (f <= 1.7d-145) then
tmp = (x / sin(b)) * -cos(b)
else
tmp = t_0 + (1.0d0 / 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 t_1 = (-1.0 / Math.sin(B)) - (x / B);
double tmp;
if (F <= -8.2e+133) {
tmp = t_1;
} else if (F <= -7e+99) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -182.0) {
tmp = t_1;
} else if (F <= 1.7e-145) {
tmp = (x / Math.sin(B)) * -Math.cos(B);
} else {
tmp = t_0 + (1.0 / B);
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) t_1 = (-1.0 / math.sin(B)) - (x / B) tmp = 0 if F <= -8.2e+133: tmp = t_1 elif F <= -7e+99: tmp = t_0 + (-1.0 / B) elif F <= -182.0: tmp = t_1 elif F <= 1.7e-145: tmp = (x / math.sin(B)) * -math.cos(B) else: tmp = t_0 + (1.0 / B) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)) tmp = 0.0 if (F <= -8.2e+133) tmp = t_1; elseif (F <= -7e+99) tmp = Float64(t_0 + Float64(-1.0 / B)); elseif (F <= -182.0) tmp = t_1; elseif (F <= 1.7e-145) tmp = Float64(Float64(x / sin(B)) * Float64(-cos(B))); else tmp = Float64(t_0 + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); t_1 = (-1.0 / sin(B)) - (x / B); tmp = 0.0; if (F <= -8.2e+133) tmp = t_1; elseif (F <= -7e+99) tmp = t_0 + (-1.0 / B); elseif (F <= -182.0) tmp = t_1; elseif (F <= 1.7e-145) tmp = (x / sin(B)) * -cos(B); else tmp = t_0 + (1.0 / 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]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.2e+133], t$95$1, If[LessEqual[F, -7e+99], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -182.0], t$95$1, If[LessEqual[F, 1.7e-145], N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * (-N[Cos[B], $MachinePrecision])), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -8.2 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq -7 \cdot 10^{+99}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -182:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-145}:\\
\;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{B}\\
\end{array}
\end{array}
if F < -8.20000000000000008e133 or -6.9999999999999995e99 < F < -182Initial program 69.4%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 83.4%
if -8.20000000000000008e133 < F < -6.9999999999999995e99Initial program 82.1%
Taylor expanded in F around -inf 99.9%
Taylor expanded in B around 0 98.7%
if -182 < F < 1.6999999999999999e-145Initial program 99.5%
Taylor expanded in F around -inf 32.8%
Taylor expanded in x around inf 78.7%
*-commutative78.7%
*-un-lft-identity78.7%
times-frac78.8%
Applied egg-rr78.8%
Taylor expanded in B around inf 78.7%
associate-*l/78.8%
*-commutative78.8%
Simplified78.8%
if 1.6999999999999999e-145 < F Initial program 63.0%
Taylor expanded in F around inf 66.9%
*-commutative66.9%
clear-num66.9%
un-div-inv72.6%
Applied egg-rr72.6%
Taylor expanded in B around 0 75.1%
Final simplification79.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.8e-41)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.42e-12)
(- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.8e-41) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-7.8d-41)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.42d-12) then
tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -7.8e-41) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.42e-12) {
tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -7.8e-41: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.42e-12: tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.8e-41) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.42e-12) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -7.8e-41) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.42e-12) tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.8e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42e-12], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.8 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{-12}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7.79999999999999982e-41Initial program 72.5%
Taylor expanded in F around -inf 97.5%
add-sqr-sqrt53.6%
sqrt-unprod60.6%
frac-times60.5%
metadata-eval60.5%
metadata-eval60.5%
frac-times60.6%
rgt-mult-inverse60.6%
associate-*l/57.6%
rgt-mult-inverse57.5%
associate-*l/57.5%
sqrt-unprod14.1%
add-sqr-sqrt36.0%
associate-*l/39.0%
rgt-mult-inverse39.0%
*-un-lft-identity39.0%
metadata-eval39.0%
cancel-sign-sub-inv39.0%
div-inv39.0%
Applied egg-rr97.5%
neg-sub097.5%
distribute-neg-in97.5%
distribute-neg-frac297.5%
distribute-neg-frac97.5%
metadata-eval97.5%
Simplified97.5%
+-commutative97.5%
distribute-frac-neg297.5%
unsub-neg97.5%
Applied egg-rr97.5%
if -7.79999999999999982e-41 < F < 1.42e-12Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 89.1%
if 1.42e-12 < F Initial program 49.8%
Taylor expanded in F around -inf 43.6%
+-commutative43.6%
unsub-neg43.6%
add-sqr-sqrt16.2%
sqrt-unprod46.4%
frac-times46.4%
metadata-eval46.4%
metadata-eval46.4%
frac-times46.4%
rgt-mult-inverse46.4%
associate-*l/38.5%
rgt-mult-inverse38.5%
associate-*l/38.4%
sqrt-unprod28.6%
add-sqr-sqrt69.9%
associate-*l/98.4%
rgt-mult-inverse98.5%
un-div-inv98.6%
Applied egg-rr98.6%
Final simplification94.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.4e-77)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2e-39)
(/ (/ x (sin B)) (/ -1.0 (cos B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.4e-77) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2e-39) {
tmp = (x / sin(B)) / (-1.0 / cos(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2.4d-77)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2d-39) then
tmp = (x / sin(b)) / ((-1.0d0) / cos(b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2.4e-77) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2e-39) {
tmp = (x / Math.sin(B)) / (-1.0 / Math.cos(B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.4e-77: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2e-39: tmp = (x / math.sin(B)) / (-1.0 / math.cos(B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.4e-77) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2e-39) tmp = Float64(Float64(x / sin(B)) / Float64(-1.0 / cos(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.4e-77) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2e-39) tmp = (x / sin(B)) / (-1.0 / cos(B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.4e-77], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2e-39], N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(-1.0 / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.4 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-39}:\\
\;\;\;\;\frac{\frac{x}{\sin B}}{\frac{-1}{\cos B}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.3999999999999999e-77Initial program 74.6%
Taylor expanded in F around -inf 91.2%
add-sqr-sqrt49.6%
sqrt-unprod57.0%
frac-times57.0%
metadata-eval57.0%
metadata-eval57.0%
frac-times57.0%
rgt-mult-inverse57.0%
associate-*l/54.3%
rgt-mult-inverse54.2%
associate-*l/54.2%
sqrt-unprod14.0%
add-sqr-sqrt34.2%
associate-*l/37.0%
rgt-mult-inverse37.0%
*-un-lft-identity37.0%
metadata-eval37.0%
cancel-sign-sub-inv37.0%
div-inv37.0%
Applied egg-rr91.3%
neg-sub091.3%
distribute-neg-in91.3%
distribute-neg-frac291.3%
distribute-neg-frac91.3%
metadata-eval91.3%
Simplified91.3%
+-commutative91.3%
distribute-frac-neg291.3%
unsub-neg91.3%
Applied egg-rr91.3%
if -2.3999999999999999e-77 < F < 1.99999999999999986e-39Initial program 99.5%
Taylor expanded in F around -inf 38.2%
Taylor expanded in x around inf 84.7%
*-commutative84.7%
*-un-lft-identity84.7%
times-frac84.7%
Applied egg-rr84.7%
clear-num84.7%
associate-*l/84.8%
*-un-lft-identity84.8%
Applied egg-rr84.8%
if 1.99999999999999986e-39 < F Initial program 54.2%
Taylor expanded in F around -inf 42.8%
+-commutative42.8%
unsub-neg42.8%
add-sqr-sqrt16.3%
sqrt-unprod43.9%
frac-times43.9%
metadata-eval43.9%
metadata-eval43.9%
frac-times43.9%
rgt-mult-inverse43.9%
associate-*l/36.7%
rgt-mult-inverse36.7%
associate-*l/36.7%
sqrt-unprod27.7%
add-sqr-sqrt67.2%
associate-*l/93.1%
rgt-mult-inverse93.2%
un-div-inv93.3%
Applied egg-rr93.3%
Final simplification89.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3e-79)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.5e-39)
(* (/ x (sin B)) (- (cos B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3e-79) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.5e-39) {
tmp = (x / sin(B)) * -cos(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-3d-79)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.5d-39) then
tmp = (x / sin(b)) * -cos(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -3e-79) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.5e-39) {
tmp = (x / Math.sin(B)) * -Math.cos(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3e-79: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.5e-39: tmp = (x / math.sin(B)) * -math.cos(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3e-79) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.5e-39) tmp = Float64(Float64(x / sin(B)) * Float64(-cos(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3e-79) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.5e-39) tmp = (x / sin(B)) * -cos(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3e-79], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.5e-39], N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * (-N[Cos[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3 \cdot 10^{-79}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-39}:\\
\;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3e-79Initial program 74.8%
Taylor expanded in F around -inf 91.3%
add-sqr-sqrt49.1%
sqrt-unprod57.4%
frac-times57.4%
metadata-eval57.4%
metadata-eval57.4%
frac-times57.4%
rgt-mult-inverse57.4%
associate-*l/54.7%
rgt-mult-inverse54.7%
associate-*l/54.7%
sqrt-unprod14.9%
add-sqr-sqrt34.9%
associate-*l/37.6%
rgt-mult-inverse37.6%
*-un-lft-identity37.6%
metadata-eval37.6%
cancel-sign-sub-inv37.6%
div-inv37.6%
Applied egg-rr91.3%
neg-sub091.3%
distribute-neg-in91.3%
distribute-neg-frac291.3%
distribute-neg-frac91.3%
metadata-eval91.3%
Simplified91.3%
+-commutative91.3%
distribute-frac-neg291.3%
unsub-neg91.3%
Applied egg-rr91.3%
if -3e-79 < F < 3.5e-39Initial program 99.5%
Taylor expanded in F around -inf 37.5%
Taylor expanded in x around inf 84.5%
*-commutative84.5%
*-un-lft-identity84.5%
times-frac84.6%
Applied egg-rr84.6%
Taylor expanded in B around inf 84.5%
associate-*l/84.6%
*-commutative84.6%
Simplified84.6%
if 3.5e-39 < F Initial program 54.2%
Taylor expanded in F around -inf 42.8%
+-commutative42.8%
unsub-neg42.8%
add-sqr-sqrt16.3%
sqrt-unprod43.9%
frac-times43.9%
metadata-eval43.9%
metadata-eval43.9%
frac-times43.9%
rgt-mult-inverse43.9%
associate-*l/36.7%
rgt-mult-inverse36.7%
associate-*l/36.7%
sqrt-unprod27.7%
add-sqr-sqrt67.2%
associate-*l/93.1%
rgt-mult-inverse93.2%
un-div-inv93.3%
Applied egg-rr93.3%
Final simplification89.6%
(FPCore (F B x)
:precision binary64
(if (<= F -5.6e-79)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.7e-145)
(* (/ x (sin B)) (- (cos B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-79) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.7e-145) {
tmp = (x / sin(B)) * -cos(B);
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-5.6d-79)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.7d-145) then
tmp = (x / sin(b)) * -cos(b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-79) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.7e-145) {
tmp = (x / Math.sin(B)) * -Math.cos(B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.6e-79: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.7e-145: tmp = (x / math.sin(B)) * -math.cos(B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.6e-79) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.7e-145) tmp = Float64(Float64(x / sin(B)) * Float64(-cos(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.6e-79) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.7e-145) tmp = (x / sin(B)) * -cos(B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.6e-79], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-145], N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * (-N[Cos[B], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-79}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-145}:\\
\;\;\;\;\frac{x}{\sin B} \cdot \left(-\cos B\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -5.60000000000000023e-79Initial program 74.8%
Taylor expanded in F around -inf 91.3%
add-sqr-sqrt49.1%
sqrt-unprod57.4%
frac-times57.4%
metadata-eval57.4%
metadata-eval57.4%
frac-times57.4%
rgt-mult-inverse57.4%
associate-*l/54.7%
rgt-mult-inverse54.7%
associate-*l/54.7%
sqrt-unprod14.9%
add-sqr-sqrt34.9%
associate-*l/37.6%
rgt-mult-inverse37.6%
*-un-lft-identity37.6%
metadata-eval37.6%
cancel-sign-sub-inv37.6%
div-inv37.6%
Applied egg-rr91.3%
neg-sub091.3%
distribute-neg-in91.3%
distribute-neg-frac291.3%
distribute-neg-frac91.3%
metadata-eval91.3%
Simplified91.3%
+-commutative91.3%
distribute-frac-neg291.3%
unsub-neg91.3%
Applied egg-rr91.3%
if -5.60000000000000023e-79 < F < 1.6999999999999999e-145Initial program 99.5%
Taylor expanded in F around -inf 31.3%
Taylor expanded in x around inf 86.6%
*-commutative86.6%
*-un-lft-identity86.6%
times-frac86.8%
Applied egg-rr86.8%
Taylor expanded in B around inf 86.6%
associate-*l/86.8%
*-commutative86.8%
Simplified86.8%
if 1.6999999999999999e-145 < F Initial program 63.0%
Taylor expanded in F around inf 66.9%
*-commutative66.9%
clear-num66.9%
un-div-inv72.6%
Applied egg-rr72.6%
Taylor expanded in B around 0 75.1%
Final simplification84.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))) (t_1 (- (/ -1.0 (sin B)) (/ x B))))
(if (<= F -4.8e+127)
t_1
(if (<= F -7.5e+99)
(+ t_0 (/ -1.0 B))
(if (<= F -2.15)
t_1
(if (<= F 1.3e-145) (/ x (- (tan B))) (+ t_0 (/ 1.0 B))))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = (-1.0 / sin(B)) - (x / B);
double tmp;
if (F <= -4.8e+127) {
tmp = t_1;
} else if (F <= -7.5e+99) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -2.15) {
tmp = t_1;
} else if (F <= 1.3e-145) {
tmp = x / -tan(B);
} else {
tmp = t_0 + (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
t_1 = ((-1.0d0) / sin(b)) - (x / b)
if (f <= (-4.8d+127)) then
tmp = t_1
else if (f <= (-7.5d+99)) then
tmp = t_0 + ((-1.0d0) / b)
else if (f <= (-2.15d0)) then
tmp = t_1
else if (f <= 1.3d-145) then
tmp = x / -tan(b)
else
tmp = t_0 + (1.0d0 / 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 t_1 = (-1.0 / Math.sin(B)) - (x / B);
double tmp;
if (F <= -4.8e+127) {
tmp = t_1;
} else if (F <= -7.5e+99) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -2.15) {
tmp = t_1;
} else if (F <= 1.3e-145) {
tmp = x / -Math.tan(B);
} else {
tmp = t_0 + (1.0 / B);
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) t_1 = (-1.0 / math.sin(B)) - (x / B) tmp = 0 if F <= -4.8e+127: tmp = t_1 elif F <= -7.5e+99: tmp = t_0 + (-1.0 / B) elif F <= -2.15: tmp = t_1 elif F <= 1.3e-145: tmp = x / -math.tan(B) else: tmp = t_0 + (1.0 / B) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)) tmp = 0.0 if (F <= -4.8e+127) tmp = t_1; elseif (F <= -7.5e+99) tmp = Float64(t_0 + Float64(-1.0 / B)); elseif (F <= -2.15) tmp = t_1; elseif (F <= 1.3e-145) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(t_0 + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); t_1 = (-1.0 / sin(B)) - (x / B); tmp = 0.0; if (F <= -4.8e+127) tmp = t_1; elseif (F <= -7.5e+99) tmp = t_0 + (-1.0 / B); elseif (F <= -2.15) tmp = t_1; elseif (F <= 1.3e-145) tmp = x / -tan(B); else tmp = t_0 + (1.0 / 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]}, Block[{t$95$1 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.8e+127], t$95$1, If[LessEqual[F, -7.5e+99], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.15], t$95$1, If[LessEqual[F, 1.3e-145], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -4.8 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{+99}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -2.15:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-145}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{B}\\
\end{array}
\end{array}
if F < -4.8000000000000004e127 or -7.49999999999999963e99 < F < -2.14999999999999991Initial program 69.4%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 83.4%
if -4.8000000000000004e127 < F < -7.49999999999999963e99Initial program 82.1%
Taylor expanded in F around -inf 99.9%
Taylor expanded in B around 0 98.7%
if -2.14999999999999991 < F < 1.3e-145Initial program 99.5%
Taylor expanded in F around -inf 32.8%
Taylor expanded in x around inf 78.7%
associate-/l*78.5%
clear-num78.5%
tan-quot78.5%
Applied egg-rr78.5%
associate-*r/78.8%
*-rgt-identity78.8%
Simplified78.8%
if 1.3e-145 < F Initial program 63.0%
Taylor expanded in F around inf 66.9%
*-commutative66.9%
clear-num66.9%
un-div-inv72.6%
Applied egg-rr72.6%
Taylor expanded in B around 0 75.1%
Final simplification79.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 (sin B)) (/ x B))))
(if (<= F -4.1e+133)
t_0
(if (<= F -8e+99)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F -22.5) t_0 (/ x (- (tan B))))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / sin(B)) - (x / B);
double tmp;
if (F <= -4.1e+133) {
tmp = t_0;
} else if (F <= -8e+99) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -22.5) {
tmp = t_0;
} else {
tmp = x / -tan(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / sin(b)) - (x / b)
if (f <= (-4.1d+133)) then
tmp = t_0
else if (f <= (-8d+99)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= (-22.5d0)) then
tmp = t_0
else
tmp = x / -tan(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / Math.sin(B)) - (x / B);
double tmp;
if (F <= -4.1e+133) {
tmp = t_0;
} else if (F <= -8e+99) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= -22.5) {
tmp = t_0;
} else {
tmp = x / -Math.tan(B);
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / math.sin(B)) - (x / B) tmp = 0 if F <= -4.1e+133: tmp = t_0 elif F <= -8e+99: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= -22.5: tmp = t_0 else: tmp = x / -math.tan(B) return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)) tmp = 0.0 if (F <= -4.1e+133) tmp = t_0; elseif (F <= -8e+99) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -22.5) tmp = t_0; else tmp = Float64(x / Float64(-tan(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / sin(B)) - (x / B); tmp = 0.0; if (F <= -4.1e+133) tmp = t_0; elseif (F <= -8e+99) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= -22.5) tmp = t_0; else tmp = x / -tan(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.1e+133], t$95$0, If[LessEqual[F, -8e+99], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -22.5], t$95$0, N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -4.1 \cdot 10^{+133}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -8 \cdot 10^{+99}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -22.5:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\end{array}
\end{array}
if F < -4.10000000000000004e133 or -7.9999999999999997e99 < F < -22.5Initial program 69.4%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 83.4%
if -4.10000000000000004e133 < F < -7.9999999999999997e99Initial program 82.1%
Taylor expanded in F around -inf 99.9%
Taylor expanded in B around 0 98.7%
if -22.5 < F Initial program 81.4%
Taylor expanded in F around -inf 39.8%
Taylor expanded in x around inf 64.5%
associate-/l*64.4%
clear-num64.4%
tan-quot64.4%
Applied egg-rr64.4%
associate-*r/64.6%
*-rgt-identity64.6%
Simplified64.6%
Final simplification71.7%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.2e-74) (not (<= x 6.6e-177))) (/ x (- (tan B))) (/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.2e-74) || !(x <= 6.6e-177)) {
tmp = x / -tan(B);
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.2d-74)) .or. (.not. (x <= 6.6d-177))) then
tmp = x / -tan(b)
else
tmp = (-1.0d0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1.2e-74) || !(x <= 6.6e-177)) {
tmp = x / -Math.tan(B);
} else {
tmp = -1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1.2e-74) or not (x <= 6.6e-177): tmp = x / -math.tan(B) else: tmp = -1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1.2e-74) || !(x <= 6.6e-177)) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(-1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1.2e-74) || ~((x <= 6.6e-177))) tmp = x / -tan(B); else tmp = -1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.2e-74], N[Not[LessEqual[x, 6.6e-177]], $MachinePrecision]], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-74} \lor \neg \left(x \leq 6.6 \cdot 10^{-177}\right):\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if x < -1.1999999999999999e-74 or 6.5999999999999999e-177 < x Initial program 83.4%
Taylor expanded in F around -inf 69.6%
Taylor expanded in x around inf 78.0%
associate-/l*77.8%
clear-num77.8%
tan-quot77.9%
Applied egg-rr77.9%
associate-*r/78.1%
*-rgt-identity78.1%
Simplified78.1%
if -1.1999999999999999e-74 < x < 6.5999999999999999e-177Initial program 68.1%
Taylor expanded in F around -inf 44.0%
add-sqr-sqrt25.3%
sqrt-unprod26.0%
frac-times25.9%
metadata-eval25.9%
metadata-eval25.9%
frac-times26.0%
rgt-mult-inverse26.0%
associate-*l/22.8%
rgt-mult-inverse22.8%
associate-*l/22.7%
sqrt-unprod3.4%
add-sqr-sqrt14.2%
associate-*l/21.4%
rgt-mult-inverse21.4%
*-un-lft-identity21.4%
metadata-eval21.4%
cancel-sign-sub-inv21.4%
div-inv21.4%
Applied egg-rr44.0%
neg-sub044.0%
distribute-neg-in44.0%
distribute-neg-frac244.0%
distribute-neg-frac44.0%
metadata-eval44.0%
Simplified44.0%
Taylor expanded in x around 0 44.0%
Final simplification65.7%
(FPCore (F B x) :precision binary64 (if (<= F -0.355) (- (/ -1.0 (sin B)) (/ x B)) (/ x (- (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.355) {
tmp = (-1.0 / sin(B)) - (x / B);
} else {
tmp = x / -tan(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.355d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else
tmp = x / -tan(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.355) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = x / -Math.tan(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.355: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = x / -math.tan(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.355) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(x / Float64(-tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.355) tmp = (-1.0 / sin(B)) - (x / B); else tmp = x / -tan(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.355], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.355:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\end{array}
\end{array}
if F < -0.35499999999999998Initial program 71.0%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 79.0%
if -0.35499999999999998 < F Initial program 81.4%
Taylor expanded in F around -inf 39.8%
Taylor expanded in x around inf 64.5%
associate-/l*64.4%
clear-num64.4%
tan-quot64.4%
Applied egg-rr64.4%
associate-*r/64.6%
*-rgt-identity64.6%
Simplified64.6%
Final simplification69.5%
(FPCore (F B x) :precision binary64 (if (<= F -5.5) (/ -1.0 (sin B)) (/ x (- (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.5) {
tmp = -1.0 / sin(B);
} else {
tmp = x / -sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-5.5d0)) then
tmp = (-1.0d0) / sin(b)
else
tmp = x / -sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.5) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = x / -Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.5: tmp = -1.0 / math.sin(B) else: tmp = x / -math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.5) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(x / Float64(-sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.5) tmp = -1.0 / sin(B); else tmp = x / -sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.5], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\sin B}\\
\end{array}
\end{array}
if F < -5.5Initial program 71.0%
Taylor expanded in F around -inf 99.4%
add-sqr-sqrt55.4%
sqrt-unprod60.5%
frac-times60.4%
metadata-eval60.4%
metadata-eval60.4%
frac-times60.5%
rgt-mult-inverse60.5%
associate-*l/57.3%
rgt-mult-inverse57.3%
associate-*l/57.2%
sqrt-unprod12.7%
add-sqr-sqrt34.7%
associate-*l/37.8%
rgt-mult-inverse37.8%
*-un-lft-identity37.8%
metadata-eval37.8%
cancel-sign-sub-inv37.8%
div-inv37.8%
Applied egg-rr99.5%
neg-sub099.5%
distribute-neg-in99.5%
distribute-neg-frac299.5%
distribute-neg-frac99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 62.5%
if -5.5 < F Initial program 81.4%
Taylor expanded in F around -inf 39.8%
Taylor expanded in x around inf 64.5%
Taylor expanded in B around 0 39.6%
Final simplification47.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-10) (/ -1.0 (sin B)) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-10) {
tmp = -1.0 / sin(B);
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.45d-10)) then
tmp = (-1.0d0) / sin(b)
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-10) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-10: tmp = -1.0 / math.sin(B) else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-10) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.45e-10) tmp = -1.0 / sin(B); else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-10], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.4499999999999999e-10Initial program 71.6%
Taylor expanded in F around -inf 98.5%
add-sqr-sqrt54.3%
sqrt-unprod60.4%
frac-times60.3%
metadata-eval60.3%
metadata-eval60.3%
frac-times60.4%
rgt-mult-inverse60.4%
associate-*l/57.3%
rgt-mult-inverse57.2%
associate-*l/57.2%
sqrt-unprod13.5%
add-sqr-sqrt35.0%
associate-*l/38.1%
rgt-mult-inverse38.1%
*-un-lft-identity38.1%
metadata-eval38.1%
cancel-sign-sub-inv38.1%
div-inv38.1%
Applied egg-rr98.5%
neg-sub098.5%
distribute-neg-in98.5%
distribute-neg-frac298.5%
distribute-neg-frac98.5%
metadata-eval98.5%
Simplified98.5%
Taylor expanded in x around 0 61.2%
if -1.4499999999999999e-10 < F Initial program 81.2%
Taylor expanded in F around -inf 39.6%
Taylor expanded in x around inf 64.7%
Taylor expanded in B around 0 37.4%
Final simplification45.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.4e-77) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-77) {
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 <= (-2.4d-77)) 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 <= -2.4e-77) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.4e-77: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.4e-77) 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 <= -2.4e-77) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-77], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.3999999999999999e-77Initial program 74.6%
Taylor expanded in F around -inf 91.2%
Taylor expanded in B around 0 46.6%
mul-1-neg46.6%
distribute-neg-frac246.6%
Simplified46.6%
if -2.3999999999999999e-77 < F Initial program 79.9%
Taylor expanded in F around -inf 40.2%
Taylor expanded in x around inf 67.1%
Taylor expanded in B around 0 37.9%
Final simplification41.3%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 77.8%
Taylor expanded in F around -inf 60.3%
Taylor expanded in x around inf 55.8%
Taylor expanded in B around 0 31.0%
Final simplification31.0%
herbie shell --seed 2024090
(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))))))