
(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 -5.6e+53)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 116000000.0)
(- (* F (/ (/ 1.0 (sqrt (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 <= -5.6e+53) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 116000000.0) {
tmp = (F * ((1.0 / sqrt(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 <= -5.6e+53) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 116000000.0) tmp = Float64(Float64(F * Float64(Float64(1.0 / sqrt(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, -5.6e+53], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 116000000.0], N[(N[(F * N[(N[(1.0 / N[Sqrt[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 -5.6 \cdot 10^{+53}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 116000000:\\
\;\;\;\;F \cdot \frac{\frac{1}{\sqrt{\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 < -5.6e53Initial program 44.3%
Simplified57.9%
Taylor expanded in x around 0 58.0%
associate-*l/57.9%
*-lft-identity57.9%
+-commutative57.9%
unpow257.9%
fma-undefine57.9%
Simplified57.9%
fma-define57.9%
sqrt-div57.9%
metadata-eval57.9%
fma-define57.9%
Applied egg-rr57.9%
Taylor expanded in F around -inf 99.6%
if -5.6e53 < F < 1.16e8Initial program 99.4%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
fma-define99.5%
sqrt-div99.5%
metadata-eval99.5%
fma-define99.5%
Applied egg-rr99.5%
if 1.16e8 < F Initial program 44.2%
Simplified70.6%
Taylor expanded in F around inf 99.6%
Taylor expanded in F around 0 99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+53)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 102000000.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 <= -4e+53) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 102000000.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 <= -4e+53) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 102000000.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, -4e+53], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 102000000.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 -4 \cdot 10^{+53}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 102000000:\\
\;\;\;\;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 < -4e53Initial program 44.3%
Simplified57.9%
Taylor expanded in x around 0 58.0%
associate-*l/57.9%
*-lft-identity57.9%
+-commutative57.9%
unpow257.9%
fma-undefine57.9%
Simplified57.9%
fma-define57.9%
sqrt-div57.9%
metadata-eval57.9%
fma-define57.9%
Applied egg-rr57.9%
Taylor expanded in F around -inf 99.6%
if -4e53 < F < 1.02e8Initial program 99.4%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
if 1.02e8 < F Initial program 44.2%
Simplified70.6%
Taylor expanded in F around inf 99.6%
Taylor expanded in F around 0 99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+52)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 70000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+52) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 70000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} 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 <= (-1d+52)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 70000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
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 <= -1e+52) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 70000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1e+52: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 70000000.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (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 <= -1e+52) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 70000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(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 <= -1e+52) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 70000000.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); 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, -1e+52], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 70000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+52}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 70000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -9.9999999999999999e51Initial program 45.2%
Simplified58.6%
Taylor expanded in x around 0 58.7%
associate-*l/58.6%
*-lft-identity58.6%
+-commutative58.6%
unpow258.6%
fma-undefine58.6%
Simplified58.6%
fma-define58.6%
sqrt-div58.6%
metadata-eval58.6%
fma-define58.6%
Applied egg-rr58.6%
Taylor expanded in F around -inf 99.6%
if -9.9999999999999999e51 < F < 7e7Initial program 99.4%
if 7e7 < F Initial program 44.2%
Simplified70.6%
Taylor expanded in F around inf 99.6%
Taylor expanded in F around 0 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -56.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* F (/ (/ 1.0 (sqrt 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 <= -56.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * ((1.0 / sqrt(2.0)) / 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 <= (-56.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f * ((1.0d0 / sqrt(2.0d0)) / 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 <= -56.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * ((1.0 / Math.sqrt(2.0)) / 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 <= -56.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F * ((1.0 / math.sqrt(2.0)) / 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 <= -56.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(Float64(1.0 / sqrt(2.0)) / 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 <= -56.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F * ((1.0 / sqrt(2.0)) / 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, -56.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[(1.0 / N[Sqrt[2.0], $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 -56:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\frac{1}{\sqrt{2}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -56Initial program 51.7%
Simplified63.5%
Taylor expanded in x around 0 63.5%
associate-*l/63.5%
*-lft-identity63.5%
+-commutative63.5%
unpow263.5%
fma-undefine63.5%
Simplified63.5%
fma-define63.5%
sqrt-div63.5%
metadata-eval63.5%
fma-define63.5%
Applied egg-rr63.5%
Taylor expanded in F around -inf 99.3%
if -56 < F < 1.3999999999999999Initial program 99.4%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
fma-define99.5%
sqrt-div99.5%
metadata-eval99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 99.3%
if 1.3999999999999999 < F Initial program 45.1%
Simplified71.0%
Taylor expanded in F around inf 98.7%
Taylor expanded in F around 0 98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -56.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* 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 <= -56.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
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 <= (-56.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) 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 <= -56.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
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 <= -56.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: 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 <= -56.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) 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 <= -56.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) 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, -56.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], 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 -56:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -56Initial program 51.7%
Simplified63.5%
Taylor expanded in x around 0 63.5%
associate-*l/63.5%
*-lft-identity63.5%
+-commutative63.5%
unpow263.5%
fma-undefine63.5%
Simplified63.5%
fma-define63.5%
sqrt-div63.5%
metadata-eval63.5%
fma-define63.5%
Applied egg-rr63.5%
Taylor expanded in F around -inf 99.3%
if -56 < F < 1.3999999999999999Initial program 99.4%
Simplified99.5%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 99.3%
if 1.3999999999999999 < F Initial program 45.1%
Simplified71.0%
Taylor expanded in F around inf 98.7%
Taylor expanded in F around 0 98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -290.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 2.7e-84)
(- (* t_0 (/ F B)) t_1)
(if (<= F 64000.0)
(- (* (/ F (sin B)) t_0) (/ x B))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -290.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 2.7e-84) {
tmp = (t_0 * (F / B)) - t_1;
} else if (F <= 64000.0) {
tmp = ((F / sin(B)) * t_0) - (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 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = x / tan(b)
if (f <= (-290.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 2.7d-84) then
tmp = (t_0 * (f / b)) - t_1
else if (f <= 64000.0d0) then
tmp = ((f / sin(b)) * t_0) - (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.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -290.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 2.7e-84) {
tmp = (t_0 * (F / B)) - t_1;
} else if (F <= 64000.0) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) t_1 = x / math.tan(B) tmp = 0 if F <= -290.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 2.7e-84: tmp = (t_0 * (F / B)) - t_1 elif F <= 64000.0: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -290.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 2.7e-84) tmp = Float64(Float64(t_0 * Float64(F / B)) - t_1); elseif (F <= 64000.0) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - 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 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; t_1 = x / tan(B); tmp = 0.0; if (F <= -290.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 2.7e-84) tmp = (t_0 * (F / B)) - t_1; elseif (F <= 64000.0) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -290.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 2.7e-84], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 64000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $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 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -290:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-84}:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - t\_1\\
\mathbf{elif}\;F \leq 64000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -290Initial program 51.7%
Simplified63.5%
Taylor expanded in x around 0 63.5%
associate-*l/63.5%
*-lft-identity63.5%
+-commutative63.5%
unpow263.5%
fma-undefine63.5%
Simplified63.5%
fma-define63.5%
sqrt-div63.5%
metadata-eval63.5%
fma-define63.5%
Applied egg-rr63.5%
Taylor expanded in F around -inf 99.3%
if -290 < F < 2.6999999999999999e-84Initial program 99.4%
Taylor expanded in B around 0 82.6%
add-sqr-sqrt38.0%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod6.4%
add-sqr-sqrt11.5%
neg-sub011.5%
sub-neg11.5%
add-sqr-sqrt6.4%
sqrt-unprod31.4%
sqr-neg31.4%
sqrt-unprod38.0%
add-sqr-sqrt82.6%
div-inv82.7%
Applied egg-rr82.7%
+-lft-identity82.7%
Simplified82.7%
if 2.6999999999999999e-84 < F < 64000Initial program 99.2%
Taylor expanded in B around 0 81.3%
associate-*r/81.3%
neg-mul-181.3%
Simplified81.3%
if 64000 < F Initial program 44.2%
Simplified70.6%
Taylor expanded in F around inf 99.6%
Taylor expanded in F around 0 99.8%
Final simplification91.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
(t_1 (/ x (tan B))))
(if (<= F -6e-74)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1.46e-126)
t_0
(if (<= F 5e-91)
(* (cos B) (/ x (- (sin B))))
(if (<= F 6e-5) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / tan(B);
double tmp;
if (F <= -6e-74) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1.46e-126) {
tmp = t_0;
} else if (F <= 5e-91) {
tmp = cos(B) * (x / -sin(B));
} else if (F <= 6e-5) {
tmp = t_0;
} 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 = (f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = x / tan(b)
if (f <= (-6d-74)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1.46d-126)) then
tmp = t_0
else if (f <= 5d-91) then
tmp = cos(b) * (x / -sin(b))
else if (f <= 6d-5) then
tmp = t_0
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 = (F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -6e-74) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1.46e-126) {
tmp = t_0;
} else if (F <= 5e-91) {
tmp = Math.cos(B) * (x / -Math.sin(B));
} else if (F <= 6e-5) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = (F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = x / math.tan(B) tmp = 0 if F <= -6e-74: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1.46e-126: tmp = t_0 elif F <= 5e-91: tmp = math.cos(B) * (x / -math.sin(B)) elif F <= 6e-5: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6e-74) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1.46e-126) tmp = t_0; elseif (F <= 5e-91) tmp = Float64(cos(B) * Float64(x / Float64(-sin(B)))); elseif (F <= 6e-5) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = x / tan(B); tmp = 0.0; if (F <= -6e-74) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1.46e-126) tmp = t_0; elseif (F <= 5e-91) tmp = cos(B) * (x / -sin(B)); elseif (F <= 6e-5) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6e-74], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.46e-126], t$95$0, If[LessEqual[F, 5e-91], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-5], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{-74}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -1.46 \cdot 10^{-126}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-91}:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-5}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -6.00000000000000014e-74Initial program 60.4%
Simplified70.1%
Taylor expanded in x around 0 70.1%
associate-*l/70.1%
*-lft-identity70.1%
+-commutative70.1%
unpow270.1%
fma-undefine70.1%
Simplified70.1%
fma-define70.1%
sqrt-div70.1%
metadata-eval70.1%
fma-define70.1%
Applied egg-rr70.1%
Taylor expanded in F around -inf 91.7%
if -6.00000000000000014e-74 < F < -1.46000000000000007e-126 or 4.99999999999999997e-91 < F < 6.00000000000000015e-5Initial program 99.2%
add-cube-cbrt98.9%
pow398.9%
div-inv98.9%
Applied egg-rr98.9%
Taylor expanded in F around 0 98.2%
Taylor expanded in F around inf 68.7%
if -1.46000000000000007e-126 < F < 4.99999999999999997e-91Initial program 99.5%
Taylor expanded in x around inf 81.7%
mul-1-neg81.7%
associate-/l*81.6%
distribute-rgt-neg-in81.6%
distribute-neg-frac281.6%
Simplified81.6%
Taylor expanded in x around 0 81.7%
mul-1-neg81.7%
distribute-frac-neg81.7%
distribute-rgt-neg-in81.7%
*-commutative81.7%
associate-/l*81.7%
Simplified81.7%
if 6.00000000000000015e-5 < F Initial program 45.1%
Simplified71.0%
Taylor expanded in F around inf 98.7%
Taylor expanded in F around 0 98.9%
Final simplification87.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7200.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 6.5e-16)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7200.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 6.5e-16) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-7200.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 6.5d-16) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -7200.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 6.5e-16) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -7200.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 6.5e-16: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7200.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 6.5e-16) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -7200.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 6.5e-16) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7200.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.5e-16], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - 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 -7200:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-16}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7200Initial program 51.7%
Simplified63.5%
Taylor expanded in x around 0 63.5%
associate-*l/63.5%
*-lft-identity63.5%
+-commutative63.5%
unpow263.5%
fma-undefine63.5%
Simplified63.5%
fma-define63.5%
sqrt-div63.5%
metadata-eval63.5%
fma-define63.5%
Applied egg-rr63.5%
Taylor expanded in F around -inf 99.3%
if -7200 < F < 6.50000000000000011e-16Initial program 99.4%
Taylor expanded in B around 0 79.7%
add-sqr-sqrt38.9%
sqrt-unprod33.1%
sqr-neg33.1%
sqrt-unprod6.5%
add-sqr-sqrt13.0%
neg-sub013.0%
sub-neg13.0%
add-sqr-sqrt6.5%
sqrt-unprod33.1%
sqr-neg33.1%
sqrt-unprod38.9%
add-sqr-sqrt79.7%
div-inv79.8%
Applied egg-rr79.8%
+-lft-identity79.8%
Simplified79.8%
if 6.50000000000000011e-16 < F Initial program 46.8%
Simplified71.9%
Taylor expanded in F around inf 96.0%
Taylor expanded in F around 0 96.2%
Final simplification89.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.2e-41)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.15e-46)
(* (cos B) (/ x (- (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 <= -1.2e-41) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.15e-46) {
tmp = cos(B) * (x / -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 <= (-1.2d-41)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.15d-46) then
tmp = cos(b) * (x / -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 <= -1.2e-41) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.15e-46) {
tmp = Math.cos(B) * (x / -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 <= -1.2e-41: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.15e-46: tmp = math.cos(B) * (x / -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 <= -1.2e-41) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.15e-46) tmp = Float64(cos(B) * Float64(x / Float64(-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 <= -1.2e-41) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.15e-46) tmp = cos(B) * (x / -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, -1.2e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e-46], N[(N[Cos[B], $MachinePrecision] * N[(x / (-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 -1.2 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-46}:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.20000000000000011e-41Initial program 58.4%
Simplified68.6%
Taylor expanded in x around 0 68.6%
associate-*l/68.6%
*-lft-identity68.6%
+-commutative68.6%
unpow268.6%
fma-undefine68.6%
Simplified68.6%
fma-define68.6%
sqrt-div68.6%
metadata-eval68.6%
fma-define68.6%
Applied egg-rr68.6%
Taylor expanded in F around -inf 91.3%
if -1.20000000000000011e-41 < F < 1.15e-46Initial program 99.4%
Taylor expanded in x around inf 72.5%
mul-1-neg72.5%
associate-/l*72.4%
distribute-rgt-neg-in72.4%
distribute-neg-frac272.4%
Simplified72.4%
Taylor expanded in x around 0 72.5%
mul-1-neg72.5%
distribute-frac-neg72.5%
distribute-rgt-neg-in72.5%
*-commutative72.5%
associate-/l*72.5%
Simplified72.5%
if 1.15e-46 < F Initial program 49.1%
Simplified73.1%
Taylor expanded in F around inf 92.1%
Taylor expanded in F around 0 92.3%
Final simplification83.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.8e-41)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45e-39) (* (cos B) (/ x (- (sin B)))) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.8e-41) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45e-39) {
tmp = cos(B) * (x / -sin(B));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.8d-41)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d-39) then
tmp = cos(b) * (x / -sin(b))
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.8e-41) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45e-39) {
tmp = Math.cos(B) * (x / -Math.sin(B));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.8e-41: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45e-39: tmp = math.cos(B) * (x / -math.sin(B)) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.8e-41) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45e-39) tmp = Float64(cos(B) * Float64(x / Float64(-sin(B)))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.8e-41) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45e-39) tmp = cos(B) * (x / -sin(B)); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.8e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45e-39], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.8 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-39}:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.8e-41Initial program 58.4%
Simplified68.6%
Taylor expanded in x around 0 68.6%
associate-*l/68.6%
*-lft-identity68.6%
+-commutative68.6%
unpow268.6%
fma-undefine68.6%
Simplified68.6%
fma-define68.6%
sqrt-div68.6%
metadata-eval68.6%
fma-define68.6%
Applied egg-rr68.6%
Taylor expanded in F around -inf 91.3%
if -1.8e-41 < F < 1.44999999999999994e-39Initial program 99.5%
Taylor expanded in x around inf 71.3%
mul-1-neg71.3%
associate-/l*71.2%
distribute-rgt-neg-in71.2%
distribute-neg-frac271.2%
Simplified71.2%
Taylor expanded in x around 0 71.3%
mul-1-neg71.3%
distribute-frac-neg71.3%
distribute-rgt-neg-in71.3%
*-commutative71.3%
associate-/l*71.3%
Simplified71.3%
if 1.44999999999999994e-39 < F Initial program 47.5%
Taylor expanded in B around 0 34.2%
add-sqr-sqrt19.8%
sqrt-unprod17.7%
sqr-neg17.7%
sqrt-unprod0.9%
add-sqr-sqrt6.2%
neg-sub06.2%
sub-neg6.2%
add-sqr-sqrt0.9%
sqrt-unprod17.7%
sqr-neg17.7%
sqrt-unprod19.8%
add-sqr-sqrt34.2%
div-inv34.3%
Applied egg-rr34.3%
+-lft-identity34.3%
Simplified34.3%
Taylor expanded in F around inf 77.8%
Final simplification79.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9.5e-42)
(- (/ -1.0 B) t_0)
(if (<= F 2e-41) (* (cos B) (/ x (- (sin B)))) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -9.5e-42) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2e-41) {
tmp = cos(B) * (x / -sin(B));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-9.5d-42)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 2d-41) then
tmp = cos(b) * (x / -sin(b))
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -9.5e-42) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 2e-41) {
tmp = Math.cos(B) * (x / -Math.sin(B));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -9.5e-42: tmp = (-1.0 / B) - t_0 elif F <= 2e-41: tmp = math.cos(B) * (x / -math.sin(B)) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9.5e-42) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 2e-41) tmp = Float64(cos(B) * Float64(x / Float64(-sin(B)))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -9.5e-42) tmp = (-1.0 / B) - t_0; elseif (F <= 2e-41) tmp = cos(B) * (x / -sin(B)); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9.5e-42], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2e-41], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9.5 \cdot 10^{-42}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-41}:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -9.49999999999999948e-42Initial program 58.4%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around -inf 66.4%
+-commutative66.4%
unsub-neg66.4%
un-div-inv66.5%
Applied egg-rr66.5%
if -9.49999999999999948e-42 < F < 2.00000000000000001e-41Initial program 99.5%
Taylor expanded in x around inf 71.3%
mul-1-neg71.3%
associate-/l*71.2%
distribute-rgt-neg-in71.2%
distribute-neg-frac271.2%
Simplified71.2%
Taylor expanded in x around 0 71.3%
mul-1-neg71.3%
distribute-frac-neg71.3%
distribute-rgt-neg-in71.3%
*-commutative71.3%
associate-/l*71.3%
Simplified71.3%
if 2.00000000000000001e-41 < F Initial program 47.5%
Taylor expanded in B around 0 34.2%
add-sqr-sqrt19.8%
sqrt-unprod17.7%
sqr-neg17.7%
sqrt-unprod0.9%
add-sqr-sqrt6.2%
neg-sub06.2%
sub-neg6.2%
add-sqr-sqrt0.9%
sqrt-unprod17.7%
sqr-neg17.7%
sqrt-unprod19.8%
add-sqr-sqrt34.2%
div-inv34.3%
Applied egg-rr34.3%
+-lft-identity34.3%
Simplified34.3%
Taylor expanded in F around inf 77.8%
Final simplification71.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6.2e-74)
(- (/ -1.0 B) t_0)
(if (<= F 1.18e-141) (/ (* x (cos B)) (- (sin B))) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -6.2e-74) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.18e-141) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-6.2d-74)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 1.18d-141) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -6.2e-74) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.18e-141) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -6.2e-74: tmp = (-1.0 / B) - t_0 elif F <= 1.18e-141: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6.2e-74) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 1.18e-141) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -6.2e-74) tmp = (-1.0 / B) - t_0; elseif (F <= 1.18e-141) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6.2e-74], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.18e-141], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6.2 \cdot 10^{-74}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 1.18 \cdot 10^{-141}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -6.2000000000000003e-74Initial program 60.4%
Taylor expanded in B around 0 47.4%
Taylor expanded in F around -inf 68.0%
+-commutative68.0%
unsub-neg68.0%
un-div-inv68.1%
Applied egg-rr68.1%
if -6.2000000000000003e-74 < F < 1.17999999999999993e-141Initial program 99.4%
Taylor expanded in x around inf 74.2%
mul-1-neg74.2%
Simplified74.2%
if 1.17999999999999993e-141 < F Initial program 60.1%
Taylor expanded in B around 0 42.2%
add-sqr-sqrt23.2%
sqrt-unprod22.0%
sqr-neg22.0%
sqrt-unprod3.0%
add-sqr-sqrt8.6%
neg-sub08.6%
sub-neg8.6%
add-sqr-sqrt3.0%
sqrt-unprod22.0%
sqr-neg22.0%
sqrt-unprod23.2%
add-sqr-sqrt42.2%
div-inv42.3%
Applied egg-rr42.3%
+-lft-identity42.3%
Simplified42.3%
Taylor expanded in F around inf 72.0%
Final simplification71.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.5e-44)
(- (/ -1.0 B) t_0)
(if (<= F 1.4e-82) (/ x (- (tan B))) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.5e-44) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.4e-82) {
tmp = x / -tan(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.5d-44)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 1.4d-82) then
tmp = x / -tan(b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.5e-44) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.4e-82) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.5e-44: tmp = (-1.0 / B) - t_0 elif F <= 1.4e-82: tmp = x / -math.tan(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5e-44) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 1.4e-82) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.5e-44) tmp = (-1.0 / B) - t_0; elseif (F <= 1.4e-82) tmp = x / -tan(B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e-44], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4e-82], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{-44}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.5000000000000001e-44Initial program 58.4%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around -inf 66.4%
+-commutative66.4%
unsub-neg66.4%
un-div-inv66.5%
Applied egg-rr66.5%
if -1.5000000000000001e-44 < F < 1.40000000000000012e-82Initial program 99.5%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-/l*74.1%
distribute-rgt-neg-in74.1%
distribute-neg-frac274.1%
Simplified74.1%
distribute-frac-neg274.1%
clear-num74.0%
tan-quot74.0%
distribute-rgt-neg-in74.0%
neg-sub074.0%
un-div-inv74.1%
Applied egg-rr74.1%
neg-sub074.1%
distribute-frac-neg74.1%
Simplified74.1%
if 1.40000000000000012e-82 < F Initial program 54.3%
Taylor expanded in B around 0 37.7%
add-sqr-sqrt23.9%
sqrt-unprod22.2%
sqr-neg22.2%
sqrt-unprod2.0%
add-sqr-sqrt8.3%
neg-sub08.3%
sub-neg8.3%
add-sqr-sqrt2.0%
sqrt-unprod22.2%
sqr-neg22.2%
sqrt-unprod23.9%
add-sqr-sqrt37.7%
div-inv37.8%
Applied egg-rr37.8%
+-lft-identity37.8%
Simplified37.8%
Taylor expanded in F around inf 73.1%
Final simplification71.5%
(FPCore (F B x) :precision binary64 (if (<= F -2.4e-42) (- (/ -1.0 B) (/ x (tan B))) (if (<= F 1.4e+236) (/ x (- (tan B))) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-42) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 1.4e+236) {
tmp = x / -tan(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 <= (-2.4d-42)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 1.4d+236) then
tmp = x / -tan(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 <= -2.4e-42) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 1.4e+236) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.4e-42: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 1.4e+236: tmp = x / -math.tan(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.4e-42) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 1.4e+236) tmp = Float64(x / Float64(-tan(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 <= -2.4e-42) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 1.4e+236) tmp = x / -tan(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-42], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e+236], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{+236}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.40000000000000003e-42Initial program 58.4%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around -inf 66.4%
+-commutative66.4%
unsub-neg66.4%
un-div-inv66.5%
Applied egg-rr66.5%
if -2.40000000000000003e-42 < F < 1.39999999999999996e236Initial program 87.8%
Taylor expanded in x around inf 64.3%
mul-1-neg64.3%
associate-/l*64.3%
distribute-rgt-neg-in64.3%
distribute-neg-frac264.3%
Simplified64.3%
distribute-frac-neg264.3%
clear-num64.2%
tan-quot64.2%
distribute-rgt-neg-in64.2%
neg-sub064.2%
un-div-inv64.3%
Applied egg-rr64.3%
neg-sub064.3%
distribute-frac-neg64.3%
Simplified64.3%
if 1.39999999999999996e236 < F Initial program 16.3%
Taylor expanded in F around inf 33.8%
Taylor expanded in B around 0 80.1%
Final simplification66.2%
(FPCore (F B x) :precision binary64 (if (<= F -4.2e+198) (/ (- -1.0 x) B) (if (<= F 6.6e+235) (/ x (- (tan B))) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e+198) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.6e+235) {
tmp = x / -tan(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 <= (-4.2d+198)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 6.6d+235) then
tmp = x / -tan(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 <= -4.2e+198) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.6e+235) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.2e+198: tmp = (-1.0 - x) / B elif F <= 6.6e+235: tmp = x / -math.tan(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.2e+198) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 6.6e+235) tmp = Float64(x / Float64(-tan(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 <= -4.2e+198) tmp = (-1.0 - x) / B; elseif (F <= 6.6e+235) tmp = x / -tan(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.2e+198], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.6e+235], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{+198}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 6.6 \cdot 10^{+235}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.20000000000000026e198Initial program 25.4%
Taylor expanded in B around 0 25.6%
Taylor expanded in F around -inf 74.7%
Taylor expanded in B around 0 55.0%
mul-1-neg55.0%
distribute-neg-frac255.0%
Simplified55.0%
if -4.20000000000000026e198 < F < 6.60000000000000001e235Initial program 85.8%
Taylor expanded in x around inf 59.6%
mul-1-neg59.6%
associate-/l*59.6%
distribute-rgt-neg-in59.6%
distribute-neg-frac259.6%
Simplified59.6%
distribute-frac-neg259.6%
clear-num59.5%
tan-quot59.5%
distribute-rgt-neg-in59.5%
neg-sub059.5%
un-div-inv59.6%
Applied egg-rr59.6%
neg-sub059.6%
distribute-frac-neg59.6%
Simplified59.6%
if 6.60000000000000001e235 < F Initial program 16.3%
Taylor expanded in F around inf 33.8%
Taylor expanded in B around 0 80.1%
Final simplification60.6%
(FPCore (F B x) :precision binary64 (if (<= F -2.65e-42) (/ (- -1.0 x) B) (if (<= F 1.4e-82) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-42) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-82) {
tmp = 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 <= (-2.65d-42)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.4d-82) then
tmp = 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 <= -2.65e-42) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-82) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.65e-42: tmp = (-1.0 - x) / B elif F <= 1.4e-82: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.65e-42) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4e-82) tmp = Float64(x / Float64(-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 <= -2.65e-42) tmp = (-1.0 - x) / B; elseif (F <= 1.4e-82) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.65e-42], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4e-82], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.65 \cdot 10^{-42}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.65e-42Initial program 58.4%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around -inf 66.4%
Taylor expanded in B around 0 39.3%
mul-1-neg39.3%
distribute-neg-frac239.3%
Simplified39.3%
if -2.65e-42 < F < 1.40000000000000012e-82Initial program 99.5%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-/l*74.1%
distribute-rgt-neg-in74.1%
distribute-neg-frac274.1%
Simplified74.1%
Taylor expanded in B around 0 36.9%
associate-*r/36.9%
neg-mul-136.9%
Simplified36.9%
if 1.40000000000000012e-82 < F Initial program 54.3%
Taylor expanded in F around inf 56.9%
Taylor expanded in B around 0 48.1%
Final simplification41.0%
(FPCore (F B x) :precision binary64 (if (<= F -2e-41) (/ -1.0 B) (if (<= F 1.4e-82) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e-41) {
tmp = -1.0 / B;
} else if (F <= 1.4e-82) {
tmp = 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 <= (-2d-41)) then
tmp = (-1.0d0) / b
else if (f <= 1.4d-82) then
tmp = 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 <= -2e-41) {
tmp = -1.0 / B;
} else if (F <= 1.4e-82) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e-41: tmp = -1.0 / B elif F <= 1.4e-82: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e-41) tmp = Float64(-1.0 / B); elseif (F <= 1.4e-82) tmp = Float64(x / Float64(-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 <= -2e-41) tmp = -1.0 / B; elseif (F <= 1.4e-82) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e-41], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 1.4e-82], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-82}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.00000000000000001e-41Initial program 58.4%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around -inf 66.4%
Taylor expanded in x around 0 25.1%
if -2.00000000000000001e-41 < F < 1.40000000000000012e-82Initial program 99.5%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-/l*74.1%
distribute-rgt-neg-in74.1%
distribute-neg-frac274.1%
Simplified74.1%
Taylor expanded in B around 0 36.9%
associate-*r/36.9%
neg-mul-136.9%
Simplified36.9%
if 1.40000000000000012e-82 < F Initial program 54.3%
Taylor expanded in F around inf 56.9%
Taylor expanded in B around 0 48.1%
Final simplification36.6%
(FPCore (F B x) :precision binary64 (if (<= F -2e-41) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e-41) {
tmp = -1.0 / B;
} else {
tmp = x / -B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2d-41)) then
tmp = (-1.0d0) / b
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2e-41) {
tmp = -1.0 / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e-41: tmp = -1.0 / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e-41) tmp = Float64(-1.0 / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2e-41) tmp = -1.0 / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e-41], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -2.00000000000000001e-41Initial program 58.4%
Taylor expanded in B around 0 44.7%
Taylor expanded in F around -inf 66.4%
Taylor expanded in x around 0 25.1%
if -2.00000000000000001e-41 < F Initial program 80.2%
Taylor expanded in x around inf 63.4%
mul-1-neg63.4%
associate-/l*63.4%
distribute-rgt-neg-in63.4%
distribute-neg-frac263.4%
Simplified63.4%
Taylor expanded in B around 0 31.4%
associate-*r/31.4%
neg-mul-131.4%
Simplified31.4%
Final simplification29.5%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 73.5%
Taylor expanded in B around 0 57.9%
Taylor expanded in F around -inf 55.1%
Taylor expanded in x around 0 10.2%
herbie shell --seed 2024113
(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))))))