
(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 25 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
(if (<= F -1.16e+36)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 0.26)
(fma (/ F (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ (- x) (tan B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.16e+36) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 0.26) {
tmp = fma((F / sin(B)), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (-x / tan(B)));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.16e+36) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 0.26) tmp = fma(Float64(F / sin(B)), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.16e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.26], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.16 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.26:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.15999999999999998e36Initial program 47.9%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u67.5%
expm1-udef67.5%
Applied egg-rr67.5%
expm1-def67.5%
expm1-log1p99.8%
Simplified99.8%
if -1.15999999999999998e36 < F < 0.26000000000000001Initial program 99.5%
+-commutative99.5%
fma-def99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-in99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
if 0.26000000000000001 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.3e+18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.26)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.3e+18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.26) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.3e+18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.26) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.3e+18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.26], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.26:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.3e18Initial program 51.5%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u69.7%
expm1-udef69.7%
Applied egg-rr69.7%
expm1-def69.7%
expm1-log1p99.8%
Simplified99.8%
if -1.3e18 < F < 0.26000000000000001Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
if 0.26000000000000001 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -3.8e+32)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 0.26)
(+
t_0
(* (/ 1.0 (/ (sin B) F)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -3.8e+32) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 0.26) {
tmp = t_0 + ((1.0 / (sin(B) / F)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-3.8d+32)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 0.26d0) then
tmp = t_0 + ((1.0d0 / (sin(b) / f)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -3.8e+32) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 0.26) {
tmp = t_0 + ((1.0 / (Math.sin(B) / F)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -3.8e+32: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 0.26: tmp = t_0 + ((1.0 / (math.sin(B) / F)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -3.8e+32) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 0.26) tmp = Float64(t_0 + Float64(Float64(1.0 / Float64(sin(B) / F)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -3.8e+32) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 0.26) tmp = t_0 + ((1.0 / (sin(B) / F)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.8e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.26], N[(t$95$0 + N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] / F), $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[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -3.8 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.26:\\
\;\;\;\;t_0 + \frac{1}{\frac{\sin B}{F}} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.8000000000000003e32Initial program 49.4%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u68.4%
expm1-udef68.4%
Applied egg-rr68.4%
expm1-def68.4%
expm1-log1p99.8%
Simplified99.8%
if -3.8000000000000003e32 < F < 0.26000000000000001Initial program 99.5%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
if 0.26000000000000001 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -1.5e+36)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 0.26)
(+ t_0 (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.5e+36) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 0.26) {
tmp = t_0 + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x * ((-1.0d0) / tan(b))
if (f <= (-1.5d+36)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 0.26d0) then
tmp = t_0 + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -1.5e+36) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 0.26) {
tmp = t_0 + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -1.5e+36: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 0.26: tmp = t_0 + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.5e+36) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 0.26) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -1.5e+36) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 0.26) tmp = t_0 + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e+36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.26], N[(t$95$0 + 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[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.26:\\
\;\;\;\;t_0 + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.5e36Initial program 47.9%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u67.5%
expm1-udef67.5%
Applied egg-rr67.5%
expm1-def67.5%
expm1-log1p99.8%
Simplified99.8%
if -1.5e36 < F < 0.26000000000000001Initial program 99.5%
if 0.26000000000000001 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.3e+18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.26)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.3e+18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.26) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.3d+18)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.26d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.3e+18) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.26) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.3e+18: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.26: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.3e+18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.26) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.3e+18) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.26) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.3e+18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.26], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.26:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.3e18Initial program 51.5%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u69.7%
expm1-udef69.7%
Applied egg-rr69.7%
expm1-def69.7%
expm1-log1p99.8%
Simplified99.8%
if -1.3e18 < F < 0.26000000000000001Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.1%
Taylor expanded in x around 0 99.1%
if 0.26000000000000001 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.053)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.7e-50)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 1.95e-11)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.053) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.7e-50) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 1.95e-11) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.053d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.7d-50)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 1.95d-11) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.053) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.7e-50) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 1.95e-11) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.053: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.7e-50: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 1.95e-11: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.053) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.7e-50) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 1.95e-11) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.053) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.7e-50) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 1.95e-11) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.053], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.7e-50], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.95e-11], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.053:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -1.7 \cdot 10^{-50}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-11}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.0529999999999999985Initial program 52.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u70.5%
expm1-udef70.5%
Applied egg-rr70.5%
expm1-def70.5%
expm1-log1p99.8%
Simplified99.8%
if -0.0529999999999999985 < F < -1.70000000000000007e-50Initial program 99.2%
+-commutative99.2%
unsub-neg99.2%
associate-*l/99.3%
associate-*r/99.2%
*-commutative99.2%
Simplified99.3%
Taylor expanded in F around 0 95.2%
Taylor expanded in x around 0 83.0%
associate-/l*83.4%
Simplified83.4%
if -1.70000000000000007e-50 < F < 1.95000000000000005e-11Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 82.2%
if 1.95000000000000005e-11 < F Initial program 72.0%
Taylor expanded in F around inf 94.9%
Final simplification91.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.65e+34)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -6.5e-209)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 1.95e-11)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.65e+34) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -6.5e-209) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 1.95e-11) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.65d+34)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-6.5d-209)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 1.95d-11) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.65e+34) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -6.5e-209) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 1.95e-11) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.65e+34: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -6.5e-209: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 1.95e-11: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.65e+34) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -6.5e-209) 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.95e-11) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.65e+34) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -6.5e-209) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 1.95e-11) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.65e+34], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -6.5e-209], 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.95e-11], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.65 \cdot 10^{+34}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -6.5 \cdot 10^{-209}:\\
\;\;\;\;\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.95 \cdot 10^{-11}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.64999999999999994e34Initial program 48.7%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u68.0%
expm1-udef68.0%
Applied egg-rr68.0%
expm1-def68.0%
expm1-log1p99.8%
Simplified99.8%
if -1.64999999999999994e34 < F < -6.50000000000000042e-209Initial program 99.6%
Taylor expanded in B around 0 85.5%
if -6.50000000000000042e-209 < F < 1.95000000000000005e-11Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 85.7%
if 1.95000000000000005e-11 < F Initial program 72.0%
Taylor expanded in F around inf 94.9%
Final simplification92.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -0.00182)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -6e-113)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 1.26e-54)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 0.00115)
(* (* F t_0) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(+ (* x (/ -1.0 (tan B))) t_0)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -0.00182) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -6e-113) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 0.00115) {
tmp = (F * t_0) * sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = (x * (-1.0 / 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 <= (-0.00182d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-6d-113)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 1.26d-54) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 0.00115d0) then
tmp = (f * t_0) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
else
tmp = (x * ((-1.0d0) / 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 <= -0.00182) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -6e-113) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 0.00115) {
tmp = (F * t_0) * Math.sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + t_0;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) tmp = 0 if F <= -0.00182: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -6e-113: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 1.26e-54: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 0.00115: tmp = (F * t_0) * math.sqrt((1.0 / (2.0 + (x * 2.0)))) else: tmp = (x * (-1.0 / math.tan(B))) + t_0 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -0.00182) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -6e-113) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 1.26e-54) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 0.00115) tmp = Float64(Float64(F * t_0) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))); else tmp = Float64(Float64(x * Float64(-1.0 / 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 <= -0.00182) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -6e-113) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 1.26e-54) tmp = (-x * cos(B)) / sin(B); elseif (F <= 0.00115) tmp = (F * t_0) * sqrt((1.0 / (2.0 + (x * 2.0)))); else tmp = (x * (-1.0 / 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, -0.00182], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-113], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.26e-54], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00115], N[(N[(F * t$95$0), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -0.00182:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 1.26 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 0.00115:\\
\;\;\;\;\left(F \cdot t_0\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t_0\\
\end{array}
\end{array}
if F < -0.00182Initial program 52.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u70.5%
expm1-udef70.5%
Applied egg-rr70.5%
expm1-def70.5%
expm1-log1p99.8%
Simplified99.8%
if -0.00182 < F < -6.0000000000000002e-113Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.4%
*-commutative99.4%
Simplified99.5%
Taylor expanded in F around 0 97.1%
Taylor expanded in x around 0 71.5%
associate-/l*71.7%
Simplified71.7%
if -6.0000000000000002e-113 < F < 1.2599999999999999e-54Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.4%
associate-*r/72.4%
*-commutative72.4%
associate-*r*72.4%
mul-1-neg72.4%
Simplified72.4%
if 1.2599999999999999e-54 < F < 0.00115Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 85.4%
clear-num85.4%
associate-/r/85.6%
Applied egg-rr85.6%
if 0.00115 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification88.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0135)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -2.3e-113)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 2e-54)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 0.038)
(* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0135) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -2.3e-113) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 2e-54) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 0.038) {
tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.0135d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-2.3d-113)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 2d-54) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 0.038d0) then
tmp = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.0135) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -2.3e-113) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 2e-54) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 0.038) {
tmp = (F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.0135: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -2.3e-113: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 2e-54: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 0.038: tmp = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.0135) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -2.3e-113) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 2e-54) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 0.038) tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.0135) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -2.3e-113) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 2e-54) tmp = (-x * cos(B)) / sin(B); elseif (F <= 0.038) tmp = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))); else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.0135], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.3e-113], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-54], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.038], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0135:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -2.3 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 0.038:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.0134999999999999998Initial program 52.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u70.5%
expm1-udef70.5%
Applied egg-rr70.5%
expm1-def70.5%
expm1-log1p99.8%
Simplified99.8%
if -0.0134999999999999998 < F < -2.30000000000000008e-113Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.4%
*-commutative99.4%
Simplified99.5%
Taylor expanded in F around 0 97.1%
Taylor expanded in x around 0 71.5%
associate-/l*71.7%
Simplified71.7%
if -2.30000000000000008e-113 < F < 2.0000000000000001e-54Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.4%
associate-*r/72.4%
*-commutative72.4%
associate-*r*72.4%
mul-1-neg72.4%
Simplified72.4%
if 2.0000000000000001e-54 < F < 0.0379999999999999991Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 85.4%
if 0.0379999999999999991 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification88.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.0215)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2.4e-113)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 1.26e-54)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 1.15e-5)
(* (/ F (sin B)) (sqrt 0.5))
(- (/ F (* F (sin B))) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.0215) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2.4e-113) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 1.15e-5) {
tmp = (F / sin(B)) * sqrt(0.5);
} else {
tmp = (F / (F * sin(B))) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.0215d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2.4d-113)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 1.26d-54) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 1.15d-5) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else
tmp = (f / (f * sin(b))) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.0215) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2.4e-113) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 1.15e-5) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else {
tmp = (F / (F * Math.sin(B))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.0215: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2.4e-113: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 1.26e-54: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 1.15e-5: tmp = (F / math.sin(B)) * math.sqrt(0.5) else: tmp = (F / (F * math.sin(B))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0215) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2.4e-113) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 1.26e-54) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 1.15e-5) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); else tmp = Float64(Float64(F / Float64(F * sin(B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.0215) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2.4e-113) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 1.26e-54) tmp = (-x * cos(B)) / sin(B); elseif (F <= 1.15e-5) tmp = (F / sin(B)) * sqrt(0.5); else tmp = (F / (F * sin(B))) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0215], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.4e-113], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.26e-54], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-5], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.0215:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -2.4 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 1.26 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B} - t_0\\
\end{array}
\end{array}
if F < -0.021499999999999998Initial program 52.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u70.5%
expm1-udef70.5%
Applied egg-rr70.5%
expm1-def70.5%
expm1-log1p99.8%
Simplified99.8%
if -0.021499999999999998 < F < -2.40000000000000012e-113Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.4%
*-commutative99.4%
Simplified99.5%
Taylor expanded in F around 0 97.1%
Taylor expanded in x around 0 71.5%
associate-/l*71.7%
Simplified71.7%
if -2.40000000000000012e-113 < F < 1.2599999999999999e-54Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.4%
associate-*r/72.4%
*-commutative72.4%
associate-*r*72.4%
mul-1-neg72.4%
Simplified72.4%
if 1.2599999999999999e-54 < F < 1.15e-5Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 85.4%
Taylor expanded in x around 0 85.4%
if 1.15e-5 < F Initial program 70.5%
+-commutative70.5%
unsub-neg70.5%
associate-*l/77.7%
associate-*r/77.6%
*-commutative77.6%
Simplified77.7%
Taylor expanded in F around inf 99.6%
un-div-inv99.7%
*-commutative99.7%
Applied egg-rr99.7%
Final simplification88.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0022)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -3.4e-113)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 3.75e-53)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 7.6e-5)
(* (/ F (sin B)) (sqrt 0.5))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0022) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -3.4e-113) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 3.75e-53) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 7.6e-5) {
tmp = (F / sin(B)) * sqrt(0.5);
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.0022d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-3.4d-113)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 3.75d-53) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 7.6d-5) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.0022) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -3.4e-113) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 3.75e-53) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 7.6e-5) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.0022: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -3.4e-113: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 3.75e-53: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 7.6e-5: tmp = (F / math.sin(B)) * math.sqrt(0.5) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.0022) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -3.4e-113) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 3.75e-53) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 7.6e-5) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.0022) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -3.4e-113) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 3.75e-53) tmp = (-x * cos(B)) / sin(B); elseif (F <= 7.6e-5) tmp = (F / sin(B)) * sqrt(0.5); else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.0022], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.4e-113], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.75e-53], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.6e-5], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0022:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -3.4 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 3.75 \cdot 10^{-53}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 7.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.00220000000000000013Initial program 52.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u70.5%
expm1-udef70.5%
Applied egg-rr70.5%
expm1-def70.5%
expm1-log1p99.8%
Simplified99.8%
if -0.00220000000000000013 < F < -3.4000000000000002e-113Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.4%
*-commutative99.4%
Simplified99.5%
Taylor expanded in F around 0 97.1%
Taylor expanded in x around 0 71.5%
associate-/l*71.7%
Simplified71.7%
if -3.4000000000000002e-113 < F < 3.75e-53Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.4%
associate-*r/72.4%
*-commutative72.4%
associate-*r*72.4%
mul-1-neg72.4%
Simplified72.4%
if 3.75e-53 < F < 7.6000000000000004e-5Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 85.4%
Taylor expanded in x around 0 85.4%
if 7.6000000000000004e-5 < F Initial program 70.5%
Taylor expanded in F around inf 99.7%
Final simplification88.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F (sin B)) (sqrt 0.5))))
(if (<= F -0.145)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -6.8e-130)
t_0
(if (<= F 9.2e-225)
(-
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B))
(+ (/ x B) (* -0.3333333333333333 (* x B))))
(if (<= F 4.2e-5) t_0 (- (/ 1.0 B) (/ x (tan B)))))))))
double code(double F, double B, double x) {
double t_0 = (F / sin(B)) * sqrt(0.5);
double tmp;
if (F <= -0.145) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -6.8e-130) {
tmp = t_0;
} else if (F <= 9.2e-225) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B)));
} else if (F <= 4.2e-5) {
tmp = t_0;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (f / sin(b)) * sqrt(0.5d0)
if (f <= (-0.145d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-6.8d-130)) then
tmp = t_0
else if (f <= 9.2d-225) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - ((x / b) + ((-0.3333333333333333d0) * (x * b)))
else if (f <= 4.2d-5) then
tmp = t_0
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (F / Math.sin(B)) * Math.sqrt(0.5);
double tmp;
if (F <= -0.145) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -6.8e-130) {
tmp = t_0;
} else if (F <= 9.2e-225) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B)));
} else if (F <= 4.2e-5) {
tmp = t_0;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): t_0 = (F / math.sin(B)) * math.sqrt(0.5) tmp = 0 if F <= -0.145: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -6.8e-130: tmp = t_0 elif F <= 9.2e-225: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B))) elif F <= 4.2e-5: tmp = t_0 else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(F / sin(B)) * sqrt(0.5)) tmp = 0.0 if (F <= -0.145) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -6.8e-130) tmp = t_0; elseif (F <= 9.2e-225) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(x * B)))); elseif (F <= 4.2e-5) tmp = t_0; else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F / sin(B)) * sqrt(0.5); tmp = 0.0; if (F <= -0.145) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -6.8e-130) tmp = t_0; elseif (F <= 9.2e-225) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B))); elseif (F <= 4.2e-5) tmp = t_0; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.145], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.8e-130], t$95$0, If[LessEqual[F, 9.2e-225], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e-5], t$95$0, N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{if}\;F \leq -0.145:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -6.8 \cdot 10^{-130}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{-225}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-5}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.14499999999999999Initial program 52.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 78.1%
if -0.14499999999999999 < F < -6.8000000000000001e-130 or 9.1999999999999995e-225 < F < 4.19999999999999977e-5Initial program 99.4%
+-commutative99.4%
unsub-neg99.4%
associate-*l/99.4%
associate-*r/99.3%
*-commutative99.3%
Simplified99.4%
Taylor expanded in F around 0 98.5%
Taylor expanded in F around inf 56.4%
Taylor expanded in x around 0 56.5%
if -6.8000000000000001e-130 < F < 9.1999999999999995e-225Initial program 99.6%
Taylor expanded in B around 0 86.3%
Taylor expanded in B around 0 60.1%
*-commutative60.1%
Simplified60.1%
if 4.19999999999999977e-5 < F Initial program 70.5%
+-commutative70.5%
unsub-neg70.5%
associate-*l/77.7%
associate-*r/77.6%
*-commutative77.6%
Simplified77.7%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 71.4%
Final simplification67.6%
(FPCore (F B x)
:precision binary64
(if (<= F -0.08)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -3.8e-128)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 9.2e-225)
(-
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B))
(+ (/ x B) (* -0.3333333333333333 (* x B))))
(if (<= F 0.115)
(* (/ F (sin B)) (sqrt 0.5))
(- (/ 1.0 B) (/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.08) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -3.8e-128) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 9.2e-225) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B)));
} else if (F <= 0.115) {
tmp = (F / sin(B)) * sqrt(0.5);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.08d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-3.8d-128)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 9.2d-225) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - ((x / b) + ((-0.3333333333333333d0) * (x * b)))
else if (f <= 0.115d0) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.08) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -3.8e-128) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 9.2e-225) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B)));
} else if (F <= 0.115) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.08: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -3.8e-128: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 9.2e-225: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B))) elif F <= 0.115: tmp = (F / math.sin(B)) * math.sqrt(0.5) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.08) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -3.8e-128) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 9.2e-225) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(x * B)))); elseif (F <= 0.115) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.08) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -3.8e-128) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 9.2e-225) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - ((x / B) + (-0.3333333333333333 * (x * B))); elseif (F <= 0.115) tmp = (F / sin(B)) * sqrt(0.5); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.08], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.8e-128], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.2e-225], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.115], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.08:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-128}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{-225}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(x \cdot B\right)\right)\\
\mathbf{elif}\;F \leq 0.115:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.0800000000000000017Initial program 52.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 78.1%
if -0.0800000000000000017 < F < -3.8000000000000002e-128Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in F around 0 97.4%
Taylor expanded in x around 0 65.7%
associate-/l*65.9%
Simplified65.9%
if -3.8000000000000002e-128 < F < 9.1999999999999995e-225Initial program 99.6%
Taylor expanded in B around 0 86.3%
Taylor expanded in B around 0 60.1%
*-commutative60.1%
Simplified60.1%
if 9.1999999999999995e-225 < F < 0.115000000000000005Initial program 99.4%
+-commutative99.4%
unsub-neg99.4%
associate-*l/99.4%
associate-*r/99.2%
*-commutative99.2%
Simplified99.3%
Taylor expanded in F around 0 99.2%
Taylor expanded in F around inf 50.8%
Taylor expanded in x around 0 50.9%
if 0.115000000000000005 < F Initial program 70.5%
+-commutative70.5%
unsub-neg70.5%
associate-*l/77.7%
associate-*r/77.6%
*-commutative77.6%
Simplified77.7%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 71.4%
Final simplification67.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -3.8e-113)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 1.6e-54)
(* (cos B) (/ (- x) (sin B)))
(if (<= F 1.8e-6)
(* (/ F (sin B)) (sqrt 0.5))
(- (/ 1.0 B) (/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -3.8e-113) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 1.6e-54) {
tmp = cos(B) * (-x / sin(B));
} else if (F <= 1.8e-6) {
tmp = (F / sin(B)) * sqrt(0.5);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.05d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-3.8d-113)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 1.6d-54) then
tmp = cos(b) * (-x / sin(b))
else if (f <= 1.8d-6) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.05) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -3.8e-113) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 1.6e-54) {
tmp = Math.cos(B) * (-x / Math.sin(B));
} else if (F <= 1.8e-6) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.05: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -3.8e-113: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 1.6e-54: tmp = math.cos(B) * (-x / math.sin(B)) elif F <= 1.8e-6: tmp = (F / math.sin(B)) * math.sqrt(0.5) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.05) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -3.8e-113) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 1.6e-54) tmp = Float64(cos(B) * Float64(Float64(-x) / sin(B))); elseif (F <= 1.8e-6) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.05) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -3.8e-113) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 1.6e-54) tmp = cos(B) * (-x / sin(B)); elseif (F <= 1.8e-6) tmp = (F / sin(B)) * sqrt(0.5); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.05], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.8e-113], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-54], N[(N[Cos[B], $MachinePrecision] * N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-6], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-54}:\\
\;\;\;\;\cos B \cdot \frac{-x}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-6}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.05000000000000004Initial program 52.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 78.1%
if -1.05000000000000004 < F < -3.79999999999999983e-113Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.4%
*-commutative99.4%
Simplified99.5%
Taylor expanded in F around 0 97.1%
Taylor expanded in x around 0 71.5%
associate-/l*71.7%
Simplified71.7%
if -3.79999999999999983e-113 < F < 1.59999999999999999e-54Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.4%
mul-1-neg72.4%
*-commutative72.4%
associate-*l/72.3%
*-commutative72.3%
Simplified72.3%
if 1.59999999999999999e-54 < F < 1.79999999999999992e-6Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 85.4%
Taylor expanded in x around 0 85.4%
if 1.79999999999999992e-6 < F Initial program 70.5%
+-commutative70.5%
unsub-neg70.5%
associate-*l/77.7%
associate-*r/77.6%
*-commutative77.6%
Simplified77.7%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 71.4%
Final simplification74.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.38)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -2.4e-113)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 1.26e-54)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 0.055)
(* (/ F (sin B)) (sqrt 0.5))
(- (/ 1.0 B) (/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.38) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -2.4e-113) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 0.055) {
tmp = (F / sin(B)) * sqrt(0.5);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.38d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-2.4d-113)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 1.26d-54) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 0.055d0) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.38) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -2.4e-113) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 0.055) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.38: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -2.4e-113: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 1.26e-54: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 0.055: tmp = (F / math.sin(B)) * math.sqrt(0.5) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -2.4e-113) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 1.26e-54) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 0.055) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.38) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -2.4e-113) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 1.26e-54) tmp = (-x * cos(B)) / sin(B); elseif (F <= 0.055) tmp = (F / sin(B)) * sqrt(0.5); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.4e-113], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.26e-54], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.055], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.38:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.4 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 1.26 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 0.055:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.38Initial program 52.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 78.1%
if -0.38 < F < -2.40000000000000012e-113Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.4%
*-commutative99.4%
Simplified99.5%
Taylor expanded in F around 0 97.1%
Taylor expanded in x around 0 71.5%
associate-/l*71.7%
Simplified71.7%
if -2.40000000000000012e-113 < F < 1.2599999999999999e-54Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.4%
associate-*r/72.4%
*-commutative72.4%
associate-*r*72.4%
mul-1-neg72.4%
Simplified72.4%
if 1.2599999999999999e-54 < F < 0.0550000000000000003Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 85.4%
Taylor expanded in x around 0 85.4%
if 0.0550000000000000003 < F Initial program 70.5%
+-commutative70.5%
unsub-neg70.5%
associate-*l/77.7%
associate-*r/77.6%
*-commutative77.6%
Simplified77.7%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 71.4%
Final simplification74.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.0019)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -6e-113)
(/ (sqrt 0.5) (/ (sin B) F))
(if (<= F 1.26e-54)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 1.85e-6)
(* (/ F (sin B)) (sqrt 0.5))
(- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.0019) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -6e-113) {
tmp = sqrt(0.5) / (sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 1.85e-6) {
tmp = (F / sin(B)) * sqrt(0.5);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.0019d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-6d-113)) then
tmp = sqrt(0.5d0) / (sin(b) / f)
else if (f <= 1.26d-54) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 1.85d-6) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.0019) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -6e-113) {
tmp = Math.sqrt(0.5) / (Math.sin(B) / F);
} else if (F <= 1.26e-54) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 1.85e-6) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.0019: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -6e-113: tmp = math.sqrt(0.5) / (math.sin(B) / F) elif F <= 1.26e-54: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 1.85e-6: tmp = (F / math.sin(B)) * math.sqrt(0.5) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0019) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -6e-113) tmp = Float64(sqrt(0.5) / Float64(sin(B) / F)); elseif (F <= 1.26e-54) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 1.85e-6) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.0019) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -6e-113) tmp = sqrt(0.5) / (sin(B) / F); elseif (F <= 1.26e-54) tmp = (-x * cos(B)) / sin(B); elseif (F <= 1.85e-6) tmp = (F / sin(B)) * sqrt(0.5); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0019], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -6e-113], N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.26e-54], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e-6], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.0019:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-113}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}}\\
\mathbf{elif}\;F \leq 1.26 \cdot 10^{-54}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{-6}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -0.0019Initial program 52.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
expm1-log1p-u70.5%
expm1-udef70.5%
Applied egg-rr70.5%
expm1-def70.5%
expm1-log1p99.8%
Simplified99.8%
if -0.0019 < F < -6.0000000000000002e-113Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.4%
*-commutative99.4%
Simplified99.5%
Taylor expanded in F around 0 97.1%
Taylor expanded in x around 0 71.5%
associate-/l*71.7%
Simplified71.7%
if -6.0000000000000002e-113 < F < 1.2599999999999999e-54Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 72.4%
associate-*r/72.4%
*-commutative72.4%
associate-*r*72.4%
mul-1-neg72.4%
Simplified72.4%
if 1.2599999999999999e-54 < F < 1.8500000000000001e-6Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 85.4%
Taylor expanded in x around 0 85.4%
if 1.8500000000000001e-6 < F Initial program 70.5%
+-commutative70.5%
unsub-neg70.5%
associate-*l/77.7%
associate-*r/77.6%
*-commutative77.6%
Simplified77.7%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 71.4%
Final simplification80.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+18)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.8e-15)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+18) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.8e-15) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.3d+18)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.8d-15) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+18) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.8e-15) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e+18: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.8e-15: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+18) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.8e-15) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.3e+18) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.8e-15) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-15], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-15}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.3e18Initial program 51.5%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 77.5%
if -1.3e18 < F < 1.8000000000000001e-15Initial program 99.5%
Taylor expanded in B around 0 78.0%
Taylor expanded in B around 0 50.4%
if 1.8000000000000001e-15 < F Initial program 72.7%
+-commutative72.7%
unsub-neg72.7%
associate-*l/79.4%
associate-*r/79.3%
*-commutative79.3%
Simplified79.4%
Taylor expanded in F around inf 93.6%
Taylor expanded in B around 0 67.4%
Final simplification63.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+18)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 4.3e-20)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+18) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 4.3e-20) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.3d+18)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 4.3d-20) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+18) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 4.3e-20) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.3e+18: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 4.3e-20: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+18) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 4.3e-20) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.3e+18) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 4.3e-20) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.3e-20], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.3e18Initial program 51.5%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 77.5%
if -1.3e18 < F < 4.30000000000000011e-20Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.1%
Taylor expanded in B around 0 49.9%
if 4.30000000000000011e-20 < F Initial program 72.7%
+-commutative72.7%
unsub-neg72.7%
associate-*l/79.4%
associate-*r/79.3%
*-commutative79.3%
Simplified79.4%
Taylor expanded in F around inf 93.6%
Taylor expanded in B around 0 67.4%
Final simplification63.0%
(FPCore (F B x) :precision binary64 (if (or (<= F -1.6e-134) (not (<= F 2.4e-205))) (- (/ -1.0 B) (/ x (tan B))) (* (/ (- x) B) (cos B))))
double code(double F, double B, double x) {
double tmp;
if ((F <= -1.6e-134) || !(F <= 2.4e-205)) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = (-x / B) * cos(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.6d-134)) .or. (.not. (f <= 2.4d-205))) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = (-x / b) * cos(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((F <= -1.6e-134) || !(F <= 2.4e-205)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (-x / B) * Math.cos(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (F <= -1.6e-134) or not (F <= 2.4e-205): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (-x / B) * math.cos(B) return tmp
function code(F, B, x) tmp = 0.0 if ((F <= -1.6e-134) || !(F <= 2.4e-205)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(-x) / B) * cos(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((F <= -1.6e-134) || ~((F <= 2.4e-205))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (-x / B) * cos(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[F, -1.6e-134], N[Not[LessEqual[F, 2.4e-205]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{-134} \lor \neg \left(F \leq 2.4 \cdot 10^{-205}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} \cdot \cos B\\
\end{array}
\end{array}
if F < -1.6000000000000001e-134 or 2.4000000000000002e-205 < F Initial program 72.2%
Taylor expanded in B around 0 55.2%
Taylor expanded in F around -inf 54.0%
expm1-log1p-u25.4%
expm1-udef23.5%
neg-mul-123.5%
fma-def23.5%
un-div-inv23.5%
Applied egg-rr23.5%
expm1-def25.5%
expm1-log1p54.1%
fma-udef54.1%
neg-mul-154.1%
+-commutative54.1%
unsub-neg54.1%
Simplified54.1%
if -1.6000000000000001e-134 < F < 2.4000000000000002e-205Initial program 99.6%
+-commutative99.6%
fma-def99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-in99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 78.1%
mul-1-neg78.1%
*-commutative78.1%
associate-*l/78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in B around 0 51.7%
Final simplification53.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6.1e-133)
(- (/ -1.0 B) t_0)
(if (<= F 2.6e-206) (* (/ (- x) B) (cos B)) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -6.1e-133) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2.6e-206) {
tmp = (-x / B) * cos(B);
} else {
tmp = (1.0 / 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 <= (-6.1d-133)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 2.6d-206) then
tmp = (-x / b) * cos(b)
else
tmp = (1.0d0 / 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 <= -6.1e-133) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2.6e-206) {
tmp = (-x / B) * Math.cos(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -6.1e-133: tmp = (-1.0 / B) - t_0 elif F <= 2.6e-206: tmp = (-x / B) * math.cos(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6.1e-133) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 2.6e-206) tmp = Float64(Float64(Float64(-x) / B) * cos(B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -6.1e-133) tmp = (-1.0 / B) - t_0; elseif (F <= 2.6e-206) tmp = (-x / B) * cos(B); else tmp = (1.0 / 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, -6.1e-133], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.6e-206], N[(N[((-x) / B), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6.1 \cdot 10^{-133}:\\
\;\;\;\;\frac{-1}{B} - t_0\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{-206}:\\
\;\;\;\;\frac{-x}{B} \cdot \cos B\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -6.1000000000000004e-133Initial program 64.1%
Taylor expanded in B around 0 46.9%
Taylor expanded in F around -inf 63.5%
expm1-log1p-u29.0%
expm1-udef25.8%
neg-mul-125.8%
fma-def25.8%
un-div-inv25.8%
Applied egg-rr25.8%
expm1-def29.0%
expm1-log1p63.6%
fma-udef63.6%
neg-mul-163.6%
+-commutative63.6%
unsub-neg63.6%
Simplified63.6%
if -6.1000000000000004e-133 < F < 2.6e-206Initial program 99.6%
+-commutative99.6%
fma-def99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
distribute-lft-neg-in99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 78.1%
mul-1-neg78.1%
*-commutative78.1%
associate-*l/78.1%
*-commutative78.1%
Simplified78.1%
Taylor expanded in B around 0 51.7%
if 2.6e-206 < F Initial program 79.9%
+-commutative79.9%
unsub-neg79.9%
associate-*l/84.8%
associate-*r/84.7%
*-commutative84.7%
Simplified84.8%
Taylor expanded in F around inf 77.0%
Taylor expanded in B around 0 58.8%
Final simplification59.2%
(FPCore (F B x) :precision binary64 (if (<= F -4.5e-34) (/ (- -1.0 x) B) (- (/ (- x) B) (* -0.3333333333333333 (* x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-34) {
tmp = (-1.0 - x) / B;
} else {
tmp = (-x / B) - (-0.3333333333333333 * (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.5d-34)) then
tmp = ((-1.0d0) - x) / b
else
tmp = (-x / b) - ((-0.3333333333333333d0) * (x * b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-34) {
tmp = (-1.0 - x) / B;
} else {
tmp = (-x / B) - (-0.3333333333333333 * (x * B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.5e-34: tmp = (-1.0 - x) / B else: tmp = (-x / B) - (-0.3333333333333333 * (x * B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.5e-34) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.3333333333333333 * Float64(x * B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.5e-34) tmp = (-1.0 - x) / B; else tmp = (-x / B) - (-0.3333333333333333 * (x * B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.5e-34], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.3333333333333333 * N[(x * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(x \cdot B\right)\\
\end{array}
\end{array}
if F < -4.50000000000000042e-34Initial program 58.7%
Taylor expanded in B around 0 43.2%
Taylor expanded in F around -inf 45.7%
Taylor expanded in B around 0 48.9%
associate-*r/48.9%
distribute-lft-in48.9%
metadata-eval48.9%
neg-mul-148.9%
Simplified48.9%
if -4.50000000000000042e-34 < F Initial program 87.6%
+-commutative87.6%
fma-def87.6%
+-commutative87.6%
*-commutative87.6%
fma-def87.6%
fma-def87.6%
metadata-eval87.6%
metadata-eval87.6%
distribute-lft-neg-in87.6%
associate-*r/87.7%
*-rgt-identity87.7%
Simplified87.7%
Taylor expanded in F around 0 59.0%
mul-1-neg59.0%
*-commutative59.0%
associate-*l/58.9%
*-commutative58.9%
Simplified58.9%
Taylor expanded in B around 0 29.9%
*-commutative29.9%
distribute-rgt-out--29.9%
metadata-eval29.9%
Simplified29.9%
Taylor expanded in x around 0 29.9%
Final simplification36.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.8e-36) (/ (- -1.0 x) B) (* x (- (/ -1.0 B) (* B -0.3333333333333333)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-36) {
tmp = (-1.0 - x) / B;
} else {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
}
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.8d-36)) then
tmp = ((-1.0d0) - x) / b
else
tmp = x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-36) {
tmp = (-1.0 - x) / B;
} else {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.8e-36: tmp = (-1.0 - x) / B else: tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.8e-36) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.8e-36) tmp = (-1.0 - x) / B; else tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.8e-36], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-36}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if F < -1.80000000000000016e-36Initial program 58.7%
Taylor expanded in B around 0 43.2%
Taylor expanded in F around -inf 45.7%
Taylor expanded in B around 0 48.9%
associate-*r/48.9%
distribute-lft-in48.9%
metadata-eval48.9%
neg-mul-148.9%
Simplified48.9%
if -1.80000000000000016e-36 < F Initial program 87.6%
+-commutative87.6%
fma-def87.6%
+-commutative87.6%
*-commutative87.6%
fma-def87.6%
fma-def87.6%
metadata-eval87.6%
metadata-eval87.6%
distribute-lft-neg-in87.6%
associate-*r/87.7%
*-rgt-identity87.7%
Simplified87.7%
Taylor expanded in F around 0 59.0%
mul-1-neg59.0%
*-commutative59.0%
associate-*l/58.9%
*-commutative58.9%
Simplified58.9%
Taylor expanded in B around 0 29.9%
*-commutative29.9%
distribute-rgt-out--29.9%
metadata-eval29.9%
Simplified29.9%
Taylor expanded in x around 0 29.9%
Final simplification36.3%
(FPCore (F B x) :precision binary64 (if (<= F -4.5e-83) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-83) {
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.5d-83)) 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.5e-83) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.5e-83: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.5e-83) 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.5e-83) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.5e-83], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.5 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -4.49999999999999997e-83Initial program 60.5%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around -inf 45.0%
Taylor expanded in B around 0 47.0%
associate-*r/47.0%
distribute-lft-in47.0%
metadata-eval47.0%
neg-mul-147.0%
Simplified47.0%
if -4.49999999999999997e-83 < F Initial program 87.3%
+-commutative87.3%
fma-def87.3%
+-commutative87.3%
*-commutative87.3%
fma-def87.3%
fma-def87.3%
metadata-eval87.3%
metadata-eval87.3%
distribute-lft-neg-in87.3%
associate-*r/87.4%
*-rgt-identity87.4%
Simplified87.4%
Taylor expanded in F around 0 59.6%
mul-1-neg59.6%
*-commutative59.6%
associate-*l/59.6%
*-commutative59.6%
Simplified59.6%
Taylor expanded in B around 0 30.5%
*-commutative30.5%
distribute-rgt-out--30.5%
metadata-eval30.5%
Simplified30.5%
Taylor expanded in B around 0 30.1%
Final simplification36.0%
(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.9%
+-commutative77.9%
fma-def77.9%
+-commutative77.9%
*-commutative77.9%
fma-def77.9%
fma-def77.9%
metadata-eval77.9%
metadata-eval77.9%
distribute-lft-neg-in77.9%
associate-*r/78.0%
*-rgt-identity78.0%
Simplified78.0%
Taylor expanded in F around 0 54.1%
mul-1-neg54.1%
*-commutative54.1%
associate-*l/54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in B around 0 28.8%
*-commutative28.8%
distribute-rgt-out--28.8%
metadata-eval28.8%
Simplified28.8%
Taylor expanded in B around 0 28.5%
Final simplification28.5%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 77.9%
Taylor expanded in B around 0 61.4%
Taylor expanded in F around -inf 49.9%
Taylor expanded in x around 0 10.7%
Final simplification10.7%
herbie shell --seed 2023230
(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))))))