
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.8)
(fma (/ (pow (fma 2.0 x 2.0) -0.5) (sin B)) F (/ x (- (tan B))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.8) {
tmp = fma((pow(fma(2.0, x, 2.0), -0.5) / sin(B)), F, (x / -tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.8) tmp = fma(Float64((fma(2.0, x, 2.0) ^ -0.5) / sin(B)), F, Float64(x / Float64(-tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.8], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.8:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}, F, \frac{x}{-\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.39999999999999991Initial program 58.1%
Simplified72.9%
Taylor expanded in F around -inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
if -2.39999999999999991 < F < 1.80000000000000004Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
fma-neg99.6%
associate-*l/99.6%
*-un-lft-identity99.6%
inv-pow99.6%
sqrt-pow199.6%
+-commutative99.6%
fma-define99.6%
metadata-eval99.6%
distribute-neg-frac99.6%
Applied egg-rr99.6%
if 1.80000000000000004 < F Initial program 65.0%
Simplified72.9%
Taylor expanded in F around inf 99.5%
Taylor expanded in F around 0 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+122)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 150.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+122) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 150.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+122) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 150.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+122], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 150.0], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+122}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 150:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.00000000000000003e122Initial program 45.1%
Simplified59.2%
Taylor expanded in F around -inf 99.7%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.8%
if -2.00000000000000003e122 < F < 150Initial program 96.8%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
if 150 < F Initial program 65.0%
Simplified72.9%
Taylor expanded in F around inf 99.5%
Taylor expanded in F around 0 99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.42)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.42) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.42d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.42) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.42: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.42) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.42) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 58.1%
Simplified72.9%
Taylor expanded in F around -inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
if -1.3999999999999999 < F < 1.4199999999999999Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
if 1.4199999999999999 < F Initial program 65.0%
Simplified72.9%
Taylor expanded in F around inf 99.5%
Taylor expanded in F around 0 99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.2e-83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5.5e-120)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 3.55e-9)
(* F (/ (sqrt 0.5) (sin B)))
(if (or (<= F 1.45e+58) (and (not (<= F 3.1e+234)) (<= F 5.2e+267)))
(- (sin B) t_0)
(- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.2e-83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5.5e-120) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 3.55e-9) {
tmp = F * (sqrt(0.5) / sin(B));
} else if ((F <= 1.45e+58) || (!(F <= 3.1e+234) && (F <= 5.2e+267))) {
tmp = sin(B) - t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-3.2d-83)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 5.5d-120) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 3.55d-9) then
tmp = f * (sqrt(0.5d0) / sin(b))
else if ((f <= 1.45d+58) .or. (.not. (f <= 3.1d+234)) .and. (f <= 5.2d+267)) then
tmp = sin(b) - t_0
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -3.2e-83) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 5.5e-120) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 3.55e-9) {
tmp = F * (Math.sqrt(0.5) / Math.sin(B));
} else if ((F <= 1.45e+58) || (!(F <= 3.1e+234) && (F <= 5.2e+267))) {
tmp = Math.sin(B) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.2e-83: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 5.5e-120: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 3.55e-9: tmp = F * (math.sqrt(0.5) / math.sin(B)) elif (F <= 1.45e+58) or (not (F <= 3.1e+234) and (F <= 5.2e+267)): tmp = math.sin(B) - t_0 else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.2e-83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5.5e-120) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 3.55e-9) tmp = Float64(F * Float64(sqrt(0.5) / sin(B))); elseif ((F <= 1.45e+58) || (!(F <= 3.1e+234) && (F <= 5.2e+267))) tmp = Float64(sin(B) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3.2e-83) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 5.5e-120) tmp = (-x * cos(B)) / sin(B); elseif (F <= 3.55e-9) tmp = F * (sqrt(0.5) / sin(B)); elseif ((F <= 1.45e+58) || (~((F <= 3.1e+234)) && (F <= 5.2e+267))) tmp = sin(B) - t_0; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.2e-83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.5e-120], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.55e-9], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.45e+58], And[N[Not[LessEqual[F, 3.1e+234]], $MachinePrecision], LessEqual[F, 5.2e+267]]], N[(N[Sin[B], $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-120}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 3.55 \cdot 10^{-9}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+58} \lor \neg \left(F \leq 3.1 \cdot 10^{+234}\right) \land F \leq 5.2 \cdot 10^{+267}:\\
\;\;\;\;\sin B - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.2000000000000001e-83Initial program 66.8%
Simplified78.4%
Taylor expanded in F around -inf 91.1%
associate-/r*91.1%
Simplified91.1%
Taylor expanded in F around 0 91.2%
if -3.2000000000000001e-83 < F < 5.5000000000000001e-120Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.7%
*-commutative99.7%
fma-neg99.7%
associate-*l/99.7%
*-un-lft-identity99.7%
inv-pow99.7%
sqrt-pow199.7%
+-commutative99.7%
fma-define99.7%
metadata-eval99.7%
distribute-neg-frac99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 76.8%
associate-*r/76.8%
associate-*r*76.8%
mul-1-neg76.8%
Simplified76.8%
if 5.5000000000000001e-120 < F < 3.54999999999999994e-9Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 99.5%
Taylor expanded in x around 0 60.0%
associate-/l*60.1%
Simplified60.1%
if 3.54999999999999994e-9 < F < 1.45000000000000001e58 or 3.0999999999999999e234 < F < 5.20000000000000005e267Initial program 94.5%
Simplified94.5%
Taylor expanded in F around inf 99.6%
Applied egg-rr84.3%
rem-cube-cbrt84.3%
Simplified84.3%
if 1.45000000000000001e58 < F < 3.0999999999999999e234 or 5.20000000000000005e267 < F Initial program 53.4%
Taylor expanded in B around 0 28.9%
associate-*r/28.9%
neg-mul-128.9%
Simplified28.9%
Taylor expanded in F around inf 73.9%
Final simplification80.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (t_1 (/ x (tan B))))
(if (<= F -0.52)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 4.8e-143)
(- (* (/ F B) t_0) t_1)
(if (<= F 0.0039)
(- (* t_0 (/ F (sin B))) (/ x B))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / tan(B);
double tmp;
if (F <= -0.52) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 4.8e-143) {
tmp = ((F / B) * t_0) - t_1;
} else if (F <= 0.0039) {
tmp = (t_0 * (F / sin(B))) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = x / tan(b)
if (f <= (-0.52d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 4.8d-143) then
tmp = ((f / b) * t_0) - t_1
else if (f <= 0.0039d0) then
tmp = (t_0 * (f / sin(b))) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.52) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 4.8e-143) {
tmp = ((F / B) * t_0) - t_1;
} else if (F <= 0.0039) {
tmp = (t_0 * (F / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = x / math.tan(B) tmp = 0 if F <= -0.52: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 4.8e-143: tmp = ((F / B) * t_0) - t_1 elif F <= 0.0039: tmp = (t_0 * (F / math.sin(B))) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.52) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 4.8e-143) tmp = Float64(Float64(Float64(F / B) * t_0) - t_1); elseif (F <= 0.0039) tmp = Float64(Float64(t_0 * Float64(F / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = x / tan(B); tmp = 0.0; if (F <= -0.52) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 4.8e-143) tmp = ((F / B) * t_0) - t_1; elseif (F <= 0.0039) tmp = (t_0 * (F / sin(B))) - (x / B); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.52], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 4.8e-143], N[(N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 0.0039], N[(N[(t$95$0 * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.52:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{-143}:\\
\;\;\;\;\frac{F}{B} \cdot t\_0 - t\_1\\
\mathbf{elif}\;F \leq 0.0039:\\
\;\;\;\;t\_0 \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -0.52000000000000002Initial program 58.1%
Simplified72.9%
Taylor expanded in F around -inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
if -0.52000000000000002 < F < 4.7999999999999998e-143Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 91.0%
if 4.7999999999999998e-143 < F < 0.0038999999999999998Initial program 99.2%
Taylor expanded in B around 0 76.7%
associate-*r/76.7%
neg-mul-176.7%
Simplified76.7%
Taylor expanded in F around 0 76.7%
if 0.0038999999999999998 < F Initial program 65.0%
Simplified72.9%
Taylor expanded in F around inf 99.5%
Taylor expanded in F around 0 99.7%
Final simplification93.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.3e-83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 4e-119)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 2.7e-58)
(* F (/ (sqrt 0.5) (sin B)))
(if (<= F 7.5e-32)
(* (- x) (/ (cos B) (sin B)))
(- (/ 1.0 (sin B)) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.3e-83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 4e-119) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 2.7e-58) {
tmp = F * (sqrt(0.5) / sin(B));
} else if (F <= 7.5e-32) {
tmp = -x * (cos(B) / sin(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2.3d-83)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 4d-119) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 2.7d-58) then
tmp = f * (sqrt(0.5d0) / sin(b))
else if (f <= 7.5d-32) then
tmp = -x * (cos(b) / sin(b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2.3e-83) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 4e-119) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 2.7e-58) {
tmp = F * (Math.sqrt(0.5) / Math.sin(B));
} else if (F <= 7.5e-32) {
tmp = -x * (Math.cos(B) / Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.3e-83: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 4e-119: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 2.7e-58: tmp = F * (math.sqrt(0.5) / math.sin(B)) elif F <= 7.5e-32: tmp = -x * (math.cos(B) / math.sin(B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.3e-83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 4e-119) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 2.7e-58) tmp = Float64(F * Float64(sqrt(0.5) / sin(B))); elseif (F <= 7.5e-32) tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.3e-83) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 4e-119) tmp = (-x * cos(B)) / sin(B); elseif (F <= 2.7e-58) tmp = F * (sqrt(0.5) / sin(B)); elseif (F <= 7.5e-32) tmp = -x * (cos(B) / sin(B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e-83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4e-119], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-58], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-32], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-119}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-58}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-32}:\\
\;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.2999999999999999e-83Initial program 66.8%
Simplified78.4%
Taylor expanded in F around -inf 91.1%
associate-/r*91.1%
Simplified91.1%
Taylor expanded in F around 0 91.2%
if -2.2999999999999999e-83 < F < 4.00000000000000005e-119Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.7%
*-commutative99.7%
fma-neg99.7%
associate-*l/99.7%
*-un-lft-identity99.7%
inv-pow99.7%
sqrt-pow199.7%
+-commutative99.7%
fma-define99.7%
metadata-eval99.7%
distribute-neg-frac99.7%
Applied egg-rr99.7%
Taylor expanded in x around inf 76.8%
associate-*r/76.8%
associate-*r*76.8%
mul-1-neg76.8%
Simplified76.8%
if 4.00000000000000005e-119 < F < 2.6999999999999999e-58Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 99.4%
Taylor expanded in x around 0 64.1%
associate-/l*64.2%
Simplified64.2%
if 2.6999999999999999e-58 < F < 7.49999999999999953e-32Initial program 99.1%
Simplified99.4%
Taylor expanded in F around -inf 70.6%
associate-/r*70.6%
Simplified70.6%
Taylor expanded in x around inf 79.8%
mul-1-neg79.8%
associate-/l*80.1%
distribute-lft-neg-in80.1%
Simplified80.1%
if 7.49999999999999953e-32 < F Initial program 66.5%
Simplified74.0%
Taylor expanded in F around inf 95.7%
Taylor expanded in F around 0 95.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.48)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.15e-22)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.48) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.15e-22) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.48d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.15d-22) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.48) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.15e-22) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.48: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.15e-22: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.48) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.15e-22) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.48) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.15e-22) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.48], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e-22], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.48:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-22}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.47999999999999998Initial program 58.1%
Simplified72.9%
Taylor expanded in F around -inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
if -0.47999999999999998 < F < 1.1499999999999999e-22Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 83.6%
if 1.1499999999999999e-22 < F Initial program 66.0%
Simplified73.7%
Taylor expanded in F around inf 96.9%
Taylor expanded in F around 0 97.1%
Final simplification91.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.2)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.15e-22)
(- (* F (/ (sqrt 0.5) B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.2) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.15e-22) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.2d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.15d-22) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.2) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.15e-22) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.2: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.15e-22: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.2) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.15e-22) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.2) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.15e-22) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.2], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e-22], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.2:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-22}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.20000000000000001Initial program 58.1%
Simplified72.9%
Taylor expanded in F around -inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
if -0.20000000000000001 < F < 1.1499999999999999e-22Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 83.5%
if 1.1499999999999999e-22 < F Initial program 66.0%
Simplified73.7%
Taylor expanded in F around inf 96.9%
Taylor expanded in F around 0 97.1%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.25e-162) (not (<= x 4.8e-182))) (/ (* (- x) (cos B)) (sin B)) (/ (* F (sqrt 0.5)) (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.25e-162) || !(x <= 4.8e-182)) {
tmp = (-x * cos(B)) / sin(B);
} else {
tmp = (F * sqrt(0.5)) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.25d-162)) .or. (.not. (x <= 4.8d-182))) then
tmp = (-x * cos(b)) / sin(b)
else
tmp = (f * sqrt(0.5d0)) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1.25e-162) || !(x <= 4.8e-182)) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1.25e-162) or not (x <= 4.8e-182): tmp = (-x * math.cos(B)) / math.sin(B) else: tmp = (F * math.sqrt(0.5)) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1.25e-162) || !(x <= 4.8e-182)) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); else tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1.25e-162) || ~((x <= 4.8e-182))) tmp = (-x * cos(B)) / sin(B); else tmp = (F * sqrt(0.5)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.25e-162], N[Not[LessEqual[x, 4.8e-182]], $MachinePrecision]], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-162} \lor \neg \left(x \leq 4.8 \cdot 10^{-182}\right):\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\end{array}
\end{array}
if x < -1.25000000000000004e-162 or 4.7999999999999997e-182 < x Initial program 81.2%
Simplified88.6%
Taylor expanded in F around 0 59.5%
*-commutative59.5%
fma-neg60.0%
associate-*l/60.1%
*-un-lft-identity60.1%
inv-pow60.1%
sqrt-pow160.1%
+-commutative60.1%
fma-define60.1%
metadata-eval60.1%
distribute-neg-frac60.1%
Applied egg-rr60.1%
Taylor expanded in x around inf 76.2%
associate-*r/76.2%
associate-*r*76.2%
mul-1-neg76.2%
Simplified76.2%
if -1.25000000000000004e-162 < x < 4.7999999999999997e-182Initial program 74.7%
Simplified77.5%
Taylor expanded in F around 0 54.3%
Taylor expanded in x around 0 46.0%
Final simplification67.9%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.3e-163) (not (<= x 1.55e-181))) (* (- x) (/ (cos B) (sin B))) (/ (* F (sqrt 0.5)) (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.3e-163) || !(x <= 1.55e-181)) {
tmp = -x * (cos(B) / sin(B));
} else {
tmp = (F * sqrt(0.5)) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.3d-163)) .or. (.not. (x <= 1.55d-181))) then
tmp = -x * (cos(b) / sin(b))
else
tmp = (f * sqrt(0.5d0)) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1.3e-163) || !(x <= 1.55e-181)) {
tmp = -x * (Math.cos(B) / Math.sin(B));
} else {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1.3e-163) or not (x <= 1.55e-181): tmp = -x * (math.cos(B) / math.sin(B)) else: tmp = (F * math.sqrt(0.5)) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1.3e-163) || !(x <= 1.55e-181)) tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B))); else tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1.3e-163) || ~((x <= 1.55e-181))) tmp = -x * (cos(B) / sin(B)); else tmp = (F * sqrt(0.5)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.3e-163], N[Not[LessEqual[x, 1.55e-181]], $MachinePrecision]], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-163} \lor \neg \left(x \leq 1.55 \cdot 10^{-181}\right):\\
\;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\end{array}
\end{array}
if x < -1.30000000000000001e-163 or 1.55000000000000011e-181 < x Initial program 81.2%
Simplified88.6%
Taylor expanded in F around -inf 68.7%
associate-/r*68.7%
Simplified68.7%
Taylor expanded in x around inf 76.2%
mul-1-neg76.2%
associate-/l*76.2%
distribute-lft-neg-in76.2%
Simplified76.2%
if -1.30000000000000001e-163 < x < 1.55000000000000011e-181Initial program 74.7%
Simplified77.5%
Taylor expanded in F around 0 54.3%
Taylor expanded in x around 0 46.0%
Final simplification67.8%
(FPCore (F B x) :precision binary64 (if (or (<= x -7.6e-136) (not (<= x 5.7e-173))) (- (/ -1.0 B) (/ x (tan B))) (/ (* F (sqrt 0.5)) (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -7.6e-136) || !(x <= 5.7e-173)) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = (F * sqrt(0.5)) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-7.6d-136)) .or. (.not. (x <= 5.7d-173))) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = (f * sqrt(0.5d0)) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -7.6e-136) || !(x <= 5.7e-173)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -7.6e-136) or not (x <= 5.7e-173): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (F * math.sqrt(0.5)) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -7.6e-136) || !(x <= 5.7e-173)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -7.6e-136) || ~((x <= 5.7e-173))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (F * sqrt(0.5)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -7.6e-136], N[Not[LessEqual[x, 5.7e-173]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-136} \lor \neg \left(x \leq 5.7 \cdot 10^{-173}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\end{array}
\end{array}
if x < -7.6000000000000005e-136 or 5.7000000000000001e-173 < x Initial program 81.9%
Simplified89.8%
Taylor expanded in F around -inf 71.7%
associate-/r*71.7%
Simplified71.7%
Taylor expanded in B around 0 80.0%
if -7.6000000000000005e-136 < x < 5.7000000000000001e-173Initial program 74.6%
Simplified77.0%
Taylor expanded in F around 0 53.5%
Taylor expanded in x around 0 41.0%
Final simplification66.9%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.5e-136) (not (<= x 4.8e-173))) (- (/ -1.0 B) (/ x (tan B))) (* F (/ (sqrt 0.5) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.5e-136) || !(x <= 4.8e-173)) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = F * (sqrt(0.5) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-2.5d-136)) .or. (.not. (x <= 4.8d-173))) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = f * (sqrt(0.5d0) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -2.5e-136) || !(x <= 4.8e-173)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = F * (Math.sqrt(0.5) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.5e-136) or not (x <= 4.8e-173): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = F * (math.sqrt(0.5) / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.5e-136) || !(x <= 4.8e-173)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(F * Float64(sqrt(0.5) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -2.5e-136) || ~((x <= 4.8e-173))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = F * (sqrt(0.5) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.5e-136], N[Not[LessEqual[x, 4.8e-173]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{-136} \lor \neg \left(x \leq 4.8 \cdot 10^{-173}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\end{array}
\end{array}
if x < -2.5000000000000001e-136 or 4.80000000000000034e-173 < x Initial program 81.9%
Simplified89.8%
Taylor expanded in F around -inf 71.7%
associate-/r*71.7%
Simplified71.7%
Taylor expanded in B around 0 80.0%
if -2.5000000000000001e-136 < x < 4.80000000000000034e-173Initial program 74.6%
Simplified77.0%
Taylor expanded in F around 0 53.5%
Taylor expanded in x around 0 41.0%
associate-/l*41.0%
Simplified41.0%
Final simplification66.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -1.7e-64)
t_0
(if (<= F 2.6e-303)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (or (<= F 1.45e+58) (and (not (<= F 8.5e+234)) (<= F 1.8e+264)))
t_0
(- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= -1.7e-64) {
tmp = t_0;
} else if (F <= 2.6e-303) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if ((F <= 1.45e+58) || (!(F <= 8.5e+234) && (F <= 1.8e+264))) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (f <= (-1.7d-64)) then
tmp = t_0
else if (f <= 2.6d-303) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if ((f <= 1.45d+58) .or. (.not. (f <= 8.5d+234)) .and. (f <= 1.8d+264)) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= -1.7e-64) {
tmp = t_0;
} else if (F <= 2.6e-303) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if ((F <= 1.45e+58) || (!(F <= 8.5e+234) && (F <= 1.8e+264))) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -1.7e-64: tmp = t_0 elif F <= 2.6e-303: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif (F <= 1.45e+58) or (not (F <= 8.5e+234) and (F <= 1.8e+264)): tmp = t_0 else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= -1.7e-64) tmp = t_0; elseif (F <= 2.6e-303) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif ((F <= 1.45e+58) || (!(F <= 8.5e+234) && (F <= 1.8e+264))) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= -1.7e-64) tmp = t_0; elseif (F <= 2.6e-303) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif ((F <= 1.45e+58) || (~((F <= 8.5e+234)) && (F <= 1.8e+264))) tmp = t_0; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.7e-64], t$95$0, If[LessEqual[F, 2.6e-303], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 1.45e+58], And[N[Not[LessEqual[F, 8.5e+234]], $MachinePrecision], LessEqual[F, 1.8e+264]]], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.7 \cdot 10^{-64}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{-303}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+58} \lor \neg \left(F \leq 8.5 \cdot 10^{+234}\right) \land F \leq 1.8 \cdot 10^{+264}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.70000000000000006e-64 or 2.60000000000000005e-303 < F < 1.45000000000000001e58 or 8.49999999999999989e234 < F < 1.80000000000000006e264Initial program 81.4%
Simplified87.7%
Taylor expanded in F around -inf 70.7%
associate-/r*70.7%
Simplified70.7%
Taylor expanded in B around 0 68.5%
if -1.70000000000000006e-64 < F < 2.60000000000000005e-303Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 65.2%
if 1.45000000000000001e58 < F < 8.49999999999999989e234 or 1.80000000000000006e264 < F Initial program 53.4%
Taylor expanded in B around 0 28.9%
associate-*r/28.9%
neg-mul-128.9%
Simplified28.9%
Taylor expanded in F around inf 73.9%
Final simplification68.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -1.15e-64)
t_0
(if (<= F 2.85e-303)
(/ (- (* F (sqrt 0.5)) x) B)
(if (or (<= F 1.45e+58) (and (not (<= F 8.5e+234)) (<= F 1.8e+264)))
t_0
(- (/ 1.0 (sin B)) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (F <= -1.15e-64) {
tmp = t_0;
} else if (F <= 2.85e-303) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if ((F <= 1.45e+58) || (!(F <= 8.5e+234) && (F <= 1.8e+264))) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (f <= (-1.15d-64)) then
tmp = t_0
else if (f <= 2.85d-303) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if ((f <= 1.45d+58) .or. (.not. (f <= 8.5d+234)) .and. (f <= 1.8d+264)) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (F <= -1.15e-64) {
tmp = t_0;
} else if (F <= 2.85e-303) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if ((F <= 1.45e+58) || (!(F <= 8.5e+234) && (F <= 1.8e+264))) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if F <= -1.15e-64: tmp = t_0 elif F <= 2.85e-303: tmp = ((F * math.sqrt(0.5)) - x) / B elif (F <= 1.45e+58) or (not (F <= 8.5e+234) and (F <= 1.8e+264)): tmp = t_0 else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (F <= -1.15e-64) tmp = t_0; elseif (F <= 2.85e-303) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif ((F <= 1.45e+58) || (!(F <= 8.5e+234) && (F <= 1.8e+264))) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (F <= -1.15e-64) tmp = t_0; elseif (F <= 2.85e-303) tmp = ((F * sqrt(0.5)) - x) / B; elseif ((F <= 1.45e+58) || (~((F <= 8.5e+234)) && (F <= 1.8e+264))) tmp = t_0; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.15e-64], t$95$0, If[LessEqual[F, 2.85e-303], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 1.45e+58], And[N[Not[LessEqual[F, 8.5e+234]], $MachinePrecision], LessEqual[F, 1.8e+264]]], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.15 \cdot 10^{-64}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.85 \cdot 10^{-303}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+58} \lor \neg \left(F \leq 8.5 \cdot 10^{+234}\right) \land F \leq 1.8 \cdot 10^{+264}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.1500000000000001e-64 or 2.84999999999999991e-303 < F < 1.45000000000000001e58 or 8.49999999999999989e234 < F < 1.80000000000000006e264Initial program 81.4%
Simplified87.7%
Taylor expanded in F around -inf 70.7%
associate-/r*70.7%
Simplified70.7%
Taylor expanded in B around 0 68.5%
if -1.1500000000000001e-64 < F < 2.84999999999999991e-303Initial program 99.4%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 65.2%
if 1.45000000000000001e58 < F < 8.49999999999999989e234 or 1.80000000000000006e264 < F Initial program 53.4%
Taylor expanded in B around 0 28.9%
associate-*r/28.9%
neg-mul-128.9%
Simplified28.9%
Taylor expanded in F around inf 73.9%
Final simplification68.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= x -2.5e-139)
t_0
(if (<= x -4.5e-251)
(/ -1.0 (sin B))
(if (<= x 2.35e-232) (* F (/ (sqrt 0.5) B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (x <= -2.5e-139) {
tmp = t_0;
} else if (x <= -4.5e-251) {
tmp = -1.0 / sin(B);
} else if (x <= 2.35e-232) {
tmp = F * (sqrt(0.5) / B);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (x <= (-2.5d-139)) then
tmp = t_0
else if (x <= (-4.5d-251)) then
tmp = (-1.0d0) / sin(b)
else if (x <= 2.35d-232) then
tmp = f * (sqrt(0.5d0) / b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (x <= -2.5e-139) {
tmp = t_0;
} else if (x <= -4.5e-251) {
tmp = -1.0 / Math.sin(B);
} else if (x <= 2.35e-232) {
tmp = F * (Math.sqrt(0.5) / B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if x <= -2.5e-139: tmp = t_0 elif x <= -4.5e-251: tmp = -1.0 / math.sin(B) elif x <= 2.35e-232: tmp = F * (math.sqrt(0.5) / B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (x <= -2.5e-139) tmp = t_0; elseif (x <= -4.5e-251) tmp = Float64(-1.0 / sin(B)); elseif (x <= 2.35e-232) tmp = Float64(F * Float64(sqrt(0.5) / B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (x <= -2.5e-139) tmp = t_0; elseif (x <= -4.5e-251) tmp = -1.0 / sin(B); elseif (x <= 2.35e-232) tmp = F * (sqrt(0.5) / B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.5e-139], t$95$0, If[LessEqual[x, -4.5e-251], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.35e-232], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-139}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -4.5 \cdot 10^{-251}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-232}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.50000000000000017e-139 or 2.35000000000000017e-232 < x Initial program 81.2%
Simplified89.0%
Taylor expanded in F around -inf 67.7%
associate-/r*67.7%
Simplified67.7%
Taylor expanded in B around 0 75.5%
if -2.50000000000000017e-139 < x < -4.49999999999999978e-251Initial program 72.0%
Simplified72.1%
Taylor expanded in F around -inf 33.1%
associate-/r*33.0%
Simplified33.0%
associate-*r/33.2%
clear-num33.2%
frac-sub33.1%
frac-2neg33.1%
metadata-eval33.1%
un-div-inv33.1%
metadata-eval33.1%
div-inv33.1%
/-rgt-identity33.1%
Applied egg-rr33.1%
Taylor expanded in x around 0 33.2%
if -4.49999999999999978e-251 < x < 2.35000000000000017e-232Initial program 77.7%
Simplified80.4%
Taylor expanded in F around 0 57.4%
Taylor expanded in x around 0 52.7%
associate-/l*52.8%
Simplified52.8%
Taylor expanded in B around 0 32.5%
(FPCore (F B x) :precision binary64 (if (or (<= x -3.5e-148) (not (<= x 7e-103))) (- (/ -1.0 B) (/ x (tan B))) (/ (- (* F (sqrt 0.5)) x) B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -3.5e-148) || !(x <= 7e-103)) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = ((F * sqrt(0.5)) - 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 ((x <= (-3.5d-148)) .or. (.not. (x <= 7d-103))) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = ((f * sqrt(0.5d0)) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -3.5e-148) || !(x <= 7e-103)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -3.5e-148) or not (x <= 7e-103): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = ((F * math.sqrt(0.5)) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -3.5e-148) || !(x <= 7e-103)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -3.5e-148) || ~((x <= 7e-103))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = ((F * sqrt(0.5)) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -3.5e-148], N[Not[LessEqual[x, 7e-103]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{-148} \lor \neg \left(x \leq 7 \cdot 10^{-103}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\end{array}
\end{array}
if x < -3.5e-148 or 7.00000000000000032e-103 < x Initial program 81.8%
Simplified90.3%
Taylor expanded in F around -inf 75.0%
associate-/r*75.0%
Simplified75.0%
Taylor expanded in B around 0 83.1%
if -3.5e-148 < x < 7.00000000000000032e-103Initial program 75.7%
Simplified77.8%
Taylor expanded in x around 0 77.8%
associate-*l/77.8%
*-lft-identity77.8%
+-commutative77.8%
unpow277.8%
fma-undefine77.8%
Simplified77.8%
Taylor expanded in F around 0 56.2%
Taylor expanded in B around 0 32.7%
Final simplification63.8%
(FPCore (F B x) :precision binary64 (if (<= F -0.225) (/ -1.0 (sin B)) (if (<= F -5.8e-303) (* F (/ (sqrt 0.5) B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.225) {
tmp = -1.0 / sin(B);
} else if (F <= -5.8e-303) {
tmp = F * (sqrt(0.5) / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.225d0)) then
tmp = (-1.0d0) / sin(b)
else if (f <= (-5.8d-303)) then
tmp = f * (sqrt(0.5d0) / b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.225) {
tmp = -1.0 / Math.sin(B);
} else if (F <= -5.8e-303) {
tmp = F * (Math.sqrt(0.5) / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.225: tmp = -1.0 / math.sin(B) elif F <= -5.8e-303: tmp = F * (math.sqrt(0.5) / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.225) tmp = Float64(-1.0 / sin(B)); elseif (F <= -5.8e-303) tmp = Float64(F * Float64(sqrt(0.5) / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.225) tmp = -1.0 / sin(B); elseif (F <= -5.8e-303) tmp = F * (sqrt(0.5) / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.225], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.8e-303], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.225:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -5.8 \cdot 10^{-303}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.225000000000000006Initial program 58.1%
Simplified72.9%
Taylor expanded in F around -inf 99.6%
associate-/r*99.6%
Simplified99.6%
associate-*r/99.7%
clear-num99.6%
frac-sub89.4%
frac-2neg89.4%
metadata-eval89.4%
un-div-inv89.5%
metadata-eval89.5%
div-inv89.5%
/-rgt-identity89.5%
Applied egg-rr89.5%
Taylor expanded in x around 0 55.7%
if -0.225000000000000006 < F < -5.80000000000000028e-303Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in x around 0 33.4%
associate-/l*33.4%
Simplified33.4%
Taylor expanded in B around 0 25.4%
if -5.80000000000000028e-303 < F Initial program 81.7%
Simplified85.8%
Taylor expanded in F around inf 66.9%
Taylor expanded in B around 0 31.8%
(FPCore (F B x) :precision binary64 (if (<= F 5.5e-167) (/ (- -1.0 x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 5.5e-167) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 5.5d-167) then
tmp = ((-1.0d0) - x) / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 5.5e-167) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 5.5e-167: tmp = (-1.0 - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 5.5e-167) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 5.5e-167) tmp = (-1.0 - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 5.5e-167], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5.5000000000000003e-167Initial program 80.9%
Simplified87.7%
Taylor expanded in F around -inf 61.3%
associate-/r*61.3%
Simplified61.3%
Taylor expanded in B around 0 35.3%
mul-1-neg35.3%
distribute-neg-frac235.3%
Simplified35.3%
if 5.5000000000000003e-167 < F Initial program 77.2%
Simplified82.3%
Taylor expanded in F around inf 78.3%
Taylor expanded in B around 0 34.5%
Final simplification35.0%
(FPCore (F B x) :precision binary64 (/ (- 1.0 x) B))
double code(double F, double B, double x) {
return (1.0 - 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 = (1.0d0 - x) / b
end function
public static double code(double F, double B, double x) {
return (1.0 - x) / B;
}
def code(F, B, x): return (1.0 - x) / B
function code(F, B, x) return Float64(Float64(1.0 - x) / B) end
function tmp = code(F, B, x) tmp = (1.0 - x) / B; end
code[F_, B_, x_] := N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 - x}{B}
\end{array}
Initial program 79.4%
Simplified85.5%
Taylor expanded in F around inf 51.4%
Taylor expanded in B around 0 25.2%
(FPCore (F B x) :precision binary64 -1.0)
double code(double F, double B, double x) {
return -1.0;
}
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
end function
public static double code(double F, double B, double x) {
return -1.0;
}
def code(F, B, x): return -1.0
function code(F, B, x) return -1.0 end
function tmp = code(F, B, x) tmp = -1.0; end
code[F_, B_, x_] := -1.0
\begin{array}{l}
\\
-1
\end{array}
Initial program 79.4%
Simplified85.5%
Taylor expanded in F around inf 51.4%
Applied egg-rr3.9%
*-commutative3.9%
neg-mul-13.9%
distribute-frac-neg3.9%
*-inverses3.9%
metadata-eval3.9%
Simplified3.9%
herbie shell --seed 2024111
(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))))))