
(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 19 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(Float64(-x) / 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%
(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 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (t_1 (/ x (tan B))))
(if (<= F -0.225)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.02e-144)
(- (* (/ F B) t_0) t_1)
(if (<= F 0.018)
(- (* 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.225) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.02e-144) {
tmp = ((F / B) * t_0) - t_1;
} else if (F <= 0.018) {
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.225d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.02d-144) then
tmp = ((f / b) * t_0) - t_1
else if (f <= 0.018d0) 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.225) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.02e-144) {
tmp = ((F / B) * t_0) - t_1;
} else if (F <= 0.018) {
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.225: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.02e-144: tmp = ((F / B) * t_0) - t_1 elif F <= 0.018: 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.225) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.02e-144) tmp = Float64(Float64(Float64(F / B) * t_0) - t_1); elseif (F <= 0.018) 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.225) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.02e-144) tmp = ((F / B) * t_0) - t_1; elseif (F <= 0.018) 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.225], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.02e-144], N[(N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 0.018], 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.225:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-144}:\\
\;\;\;\;\frac{F}{B} \cdot t\_0 - t\_1\\
\mathbf{elif}\;F \leq 0.018:\\
\;\;\;\;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.225000000000000006Initial 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.225000000000000006 < F < 1.01999999999999997e-144Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 91.0%
if 1.01999999999999997e-144 < F < 0.0179999999999999986Initial 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.0179999999999999986 < 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 -0.52)
(- (/ -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.52) {
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.52d0)) 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.52) {
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.52: 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.52) 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.52) 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.52], 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.52:\\
\;\;\;\;\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.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 < 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.46)
(- (/ -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.46) {
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.46d0)) 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.46) {
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.46: 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.46) 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.46) 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.46], 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.46:\\
\;\;\;\;\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.46000000000000002Initial 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.46000000000000002 < 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
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.2e-83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7e-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 <= -3.2e-83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7e-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 <= (-3.2d-83)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7d-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 <= -3.2e-83) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7e-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 <= -3.2e-83: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7e-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 <= -3.2e-83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7e-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 <= -3.2e-83) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7e-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, -3.2e-83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7e-32], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-32}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\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 < 6.9999999999999997e-32Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
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 70.6%
associate-*r/70.6%
associate-*r*70.6%
mul-1-neg70.6%
Simplified70.6%
if 6.9999999999999997e-32 < F Initial program 67.0%
Simplified74.4%
Taylor expanded in F around inf 95.7%
Taylor expanded in F around 0 95.9%
Final simplification84.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4e-83)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.45e+58)
(/ (* x (- (cos B))) (sin B))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e-83) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.45e+58) {
tmp = (x * -cos(B)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.4d-83)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.45d+58) then
tmp = (x * -cos(b)) / sin(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e-83) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.45e+58) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.4e-83: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.45e+58: tmp = (x * -math.cos(B)) / math.sin(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.4e-83) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.45e+58) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.4e-83) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.45e+58) tmp = (x * -cos(B)) / sin(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.4e-83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e+58], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+58}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.4e-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 -1.4e-83 < F < 1.45000000000000001e58Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 94.5%
*-commutative94.5%
fma-neg94.6%
associate-*l/94.6%
*-un-lft-identity94.6%
inv-pow94.6%
sqrt-pow194.6%
+-commutative94.6%
fma-define94.6%
metadata-eval94.6%
distribute-neg-frac94.6%
Applied egg-rr94.6%
Taylor expanded in x around inf 69.9%
associate-*r/69.9%
associate-*r*69.9%
mul-1-neg69.9%
Simplified69.9%
if 1.45000000000000001e58 < F Initial program 57.5%
Taylor expanded in B around 0 26.2%
associate-*r/26.2%
neg-mul-126.2%
Simplified26.2%
Taylor expanded in F around inf 67.2%
Final simplification76.5%
(FPCore (F B x)
:precision binary64
(if (<= F -3.2e-83)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 1.45e+58)
(/ (* x (- (cos B))) (sin B))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-83) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 1.45e+58) {
tmp = (x * -cos(B)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.2d-83)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 1.45d+58) then
tmp = (x * -cos(b)) / sin(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-83) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 1.45e+58) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.2e-83: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 1.45e+58: tmp = (x * -math.cos(B)) / math.sin(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.2e-83) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 1.45e+58) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.2e-83) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 1.45e+58) tmp = (x * -cos(B)) / sin(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-83], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e+58], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+58}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\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 B around 0 74.8%
if -3.2000000000000001e-83 < F < 1.45000000000000001e58Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 94.5%
*-commutative94.5%
fma-neg94.6%
associate-*l/94.6%
*-un-lft-identity94.6%
inv-pow94.6%
sqrt-pow194.6%
+-commutative94.6%
fma-define94.6%
metadata-eval94.6%
distribute-neg-frac94.6%
Applied egg-rr94.6%
Taylor expanded in x around inf 69.9%
associate-*r/69.9%
associate-*r*69.9%
mul-1-neg69.9%
Simplified69.9%
if 1.45000000000000001e58 < F Initial program 57.5%
Taylor expanded in B around 0 26.2%
associate-*r/26.2%
neg-mul-126.2%
Simplified26.2%
Taylor expanded in F around inf 67.2%
Final simplification71.0%
(FPCore (F B x)
:precision binary64
(if (<= F -3.2e-83)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 1.45e+58)
(* x (/ (cos B) (- (sin B))))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-83) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 1.45e+58) {
tmp = x * (cos(B) / -sin(B));
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.2d-83)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 1.45d+58) then
tmp = x * (cos(b) / -sin(b))
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-83) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 1.45e+58) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.2e-83: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 1.45e+58: tmp = x * (math.cos(B) / -math.sin(B)) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.2e-83) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 1.45e+58) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.2e-83) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 1.45e+58) tmp = x * (cos(B) / -sin(B)); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-83], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e+58], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+58}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\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 B around 0 74.8%
if -3.2000000000000001e-83 < F < 1.45000000000000001e58Initial program 99.4%
Simplified99.6%
Taylor expanded in F around -inf 33.7%
associate-/r*33.7%
Simplified33.7%
Taylor expanded in x around inf 69.9%
mul-1-neg69.9%
associate-/l*69.8%
distribute-lft-neg-in69.8%
Simplified69.8%
if 1.45000000000000001e58 < F Initial program 57.5%
Taylor expanded in B around 0 26.2%
associate-*r/26.2%
neg-mul-126.2%
Simplified26.2%
Taylor expanded in F around inf 67.2%
Final simplification70.9%
(FPCore (F B x) :precision binary64 (if (or (<= x -5.8e-137) (not (<= x 2.9e-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 <= -5.8e-137) || !(x <= 2.9e-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 <= (-5.8d-137)) .or. (.not. (x <= 2.9d-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 <= -5.8e-137) || !(x <= 2.9e-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 <= -5.8e-137) or not (x <= 2.9e-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 <= -5.8e-137) || !(x <= 2.9e-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 <= -5.8e-137) || ~((x <= 2.9e-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, -5.8e-137], N[Not[LessEqual[x, 2.9e-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 -5.8 \cdot 10^{-137} \lor \neg \left(x \leq 2.9 \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 < -5.7999999999999997e-137 or 2.8999999999999998e-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 -5.7999999999999997e-137 < x < 2.8999999999999998e-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 -5.2e-136) (not (<= x 5.2e-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 <= -5.2e-136) || !(x <= 5.2e-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 <= (-5.2d-136)) .or. (.not. (x <= 5.2d-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 <= -5.2e-136) || !(x <= 5.2e-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 <= -5.2e-136) or not (x <= 5.2e-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 <= -5.2e-136) || !(x <= 5.2e-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 <= -5.2e-136) || ~((x <= 5.2e-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, -5.2e-136], N[Not[LessEqual[x, 5.2e-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 -5.2 \cdot 10^{-136} \lor \neg \left(x \leq 5.2 \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 < -5.19999999999999993e-136 or 5.20000000000000007e-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 -5.19999999999999993e-136 < x < 5.20000000000000007e-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.5e-67)
t_0
(if (<= F 2.1e-303)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 1.55e+58) 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.5e-67) {
tmp = t_0;
} else if (F <= 2.1e-303) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 1.55e+58) {
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.5d-67)) then
tmp = t_0
else if (f <= 2.1d-303) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 1.55d+58) 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.5e-67) {
tmp = t_0;
} else if (F <= 2.1e-303) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 1.55e+58) {
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.5e-67: tmp = t_0 elif F <= 2.1e-303: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 1.55e+58: 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.5e-67) tmp = t_0; elseif (F <= 2.1e-303) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 1.55e+58) 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.5e-67) tmp = t_0; elseif (F <= 2.1e-303) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 1.55e+58) 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.5e-67], t$95$0, If[LessEqual[F, 2.1e-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[LessEqual[F, 1.55e+58], 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.5 \cdot 10^{-67}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-303}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{+58}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.50000000000000016e-67 or 2.1e-303 < F < 1.55e58Initial program 81.2%
Simplified87.7%
Taylor expanded in F around -inf 70.0%
associate-/r*70.0%
Simplified70.0%
Taylor expanded in B around 0 67.7%
if -1.50000000000000016e-67 < F < 2.1e-303Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 65.2%
if 1.55e58 < F Initial program 57.5%
Taylor expanded in B around 0 26.2%
associate-*r/26.2%
neg-mul-126.2%
Simplified26.2%
Taylor expanded in F around inf 67.2%
Final simplification67.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= F -1.7e-68)
t_0
(if (<= F 2.55e-303)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= F 1.45e+58) 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-68) {
tmp = t_0;
} else if (F <= 2.55e-303) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (F <= 1.45e+58) {
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-68)) then
tmp = t_0
else if (f <= 2.55d-303) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (f <= 1.45d+58) 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-68) {
tmp = t_0;
} else if (F <= 2.55e-303) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (F <= 1.45e+58) {
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-68: tmp = t_0 elif F <= 2.55e-303: tmp = ((F * math.sqrt(0.5)) - x) / B elif F <= 1.45e+58: 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-68) tmp = t_0; elseif (F <= 2.55e-303) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (F <= 1.45e+58) 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-68) tmp = t_0; elseif (F <= 2.55e-303) tmp = ((F * sqrt(0.5)) - x) / B; elseif (F <= 1.45e+58) 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-68], t$95$0, If[LessEqual[F, 2.55e-303], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45e+58], 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^{-68}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.55 \cdot 10^{-303}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{+58}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.70000000000000009e-68 or 2.55e-303 < F < 1.45000000000000001e58Initial program 81.2%
Simplified87.7%
Taylor expanded in F around -inf 70.0%
associate-/r*70.0%
Simplified70.0%
Taylor expanded in B around 0 67.7%
if -1.70000000000000009e-68 < F < 2.55e-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 Initial program 57.5%
Taylor expanded in B around 0 26.2%
associate-*r/26.2%
neg-mul-126.2%
Simplified26.2%
Taylor expanded in F around inf 67.2%
Final simplification67.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= x -2.05e-137)
t_0
(if (<= x -9.5e-251)
(/ -1.0 (sin B))
(if (<= x 3.4e-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.05e-137) {
tmp = t_0;
} else if (x <= -9.5e-251) {
tmp = -1.0 / sin(B);
} else if (x <= 3.4e-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.05d-137)) then
tmp = t_0
else if (x <= (-9.5d-251)) then
tmp = (-1.0d0) / sin(b)
else if (x <= 3.4d-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.05e-137) {
tmp = t_0;
} else if (x <= -9.5e-251) {
tmp = -1.0 / Math.sin(B);
} else if (x <= 3.4e-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.05e-137: tmp = t_0 elif x <= -9.5e-251: tmp = -1.0 / math.sin(B) elif x <= 3.4e-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.05e-137) tmp = t_0; elseif (x <= -9.5e-251) tmp = Float64(-1.0 / sin(B)); elseif (x <= 3.4e-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.05e-137) tmp = t_0; elseif (x <= -9.5e-251) tmp = -1.0 / sin(B); elseif (x <= 3.4e-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.05e-137], t$95$0, If[LessEqual[x, -9.5e-251], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.4e-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.05 \cdot 10^{-137}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -9.5 \cdot 10^{-251}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-232}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.0499999999999999e-137 or 3.4000000000000002e-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.0499999999999999e-137 < x < -9.49999999999999927e-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 -9.49999999999999927e-251 < x < 3.4000000000000002e-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 -4.4e-148) (not (<= x 4.6e-102))) (- (/ -1.0 B) (/ x (tan B))) (/ (- (* F (sqrt 0.5)) x) B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -4.4e-148) || !(x <= 4.6e-102)) {
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 <= (-4.4d-148)) .or. (.not. (x <= 4.6d-102))) 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 <= -4.4e-148) || !(x <= 4.6e-102)) {
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 <= -4.4e-148) or not (x <= 4.6e-102): 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 <= -4.4e-148) || !(x <= 4.6e-102)) 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 <= -4.4e-148) || ~((x <= 4.6e-102))) 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, -4.4e-148], N[Not[LessEqual[x, 4.6e-102]], $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 -4.4 \cdot 10^{-148} \lor \neg \left(x \leq 4.6 \cdot 10^{-102}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\end{array}
\end{array}
if x < -4.40000000000000034e-148 or 4.59999999999999973e-102 < 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 -4.40000000000000034e-148 < x < 4.59999999999999973e-102Initial 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.11) (/ -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.11) {
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.11d0)) 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.11) {
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.11: 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.11) 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.11) 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.11], 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.11:\\
\;\;\;\;\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.110000000000000001Initial 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.110000000000000001 < 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 7e-167) (/ (- -1.0 x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 7e-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 <= 7d-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 <= 7e-167) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 7e-167: tmp = (-1.0 - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 7e-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 <= 7e-167) tmp = (-1.0 - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 7e-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 7 \cdot 10^{-167}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 6.9999999999999998e-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 6.9999999999999998e-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))))))