
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -100000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 4.2e+30)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -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 <= -100000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 4.2e+30) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / 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 <= -100000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 4.2e+30) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / 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, -100000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4.2e+30], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(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 -100000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1e11Initial program 51.5%
Simplified72.6%
Taylor expanded in x around 0 72.5%
associate-*l/72.6%
*-lft-identity72.6%
+-commutative72.6%
unpow272.6%
fma-udef72.6%
Simplified72.6%
Taylor expanded in F around -inf 99.8%
if -1e11 < F < 4.2e30Initial program 99.4%
Simplified99.7%
if 4.2e30 < F Initial program 55.4%
Simplified71.7%
Taylor expanded in x around 0 71.7%
associate-*l/71.7%
*-lft-identity71.7%
+-commutative71.7%
unpow271.7%
fma-udef71.7%
Simplified71.7%
Taylor expanded in F around inf 99.9%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -13000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2e+30)
(- (* 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 <= -13000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2e+30) {
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 <= -13000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2e+30) 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, -13000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2e+30], 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 -13000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+30}:\\
\;\;\;\;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 < -1.3e10Initial program 52.2%
Simplified73.0%
Taylor expanded in x around 0 72.9%
associate-*l/73.0%
*-lft-identity73.0%
+-commutative73.0%
unpow273.0%
fma-udef73.0%
Simplified73.0%
Taylor expanded in F around -inf 99.8%
if -1.3e10 < F < 2e30Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
if 2e30 < F Initial program 55.4%
Simplified71.7%
Taylor expanded in x around 0 71.7%
associate-*l/71.7%
*-lft-identity71.7%
+-commutative71.7%
unpow271.7%
fma-udef71.7%
Simplified71.7%
Taylor expanded in F around inf 99.9%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7800000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 200000000.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 <= -7800000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 200000000.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 <= (-7800000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 200000000.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 <= -7800000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 200000000.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 <= -7800000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 200000000.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 <= -7800000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 200000000.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 <= -7800000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 200000000.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, -7800000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 200000000.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 -7800000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;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 < -7.8e6Initial program 52.9%
Simplified73.4%
Taylor expanded in x around 0 73.3%
associate-*l/73.4%
*-lft-identity73.4%
+-commutative73.4%
unpow273.4%
fma-udef73.4%
Simplified73.4%
Taylor expanded in F around -inf 99.8%
if -7.8e6 < F < 2e8Initial program 99.5%
if 2e8 < F Initial program 57.3%
Simplified72.9%
Taylor expanded in x around 0 72.9%
associate-*l/72.9%
*-lft-identity72.9%
+-commutative72.9%
unpow272.9%
fma-udef72.9%
Simplified72.9%
Taylor expanded in F around inf 99.9%
Final simplification99.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.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 <= -1.4) {
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 <= (-1.4d0)) 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 <= -1.4) {
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 <= -1.4: 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 <= -1.4) 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 <= -1.4) 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, -1.4], 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 -1.4:\\
\;\;\;\;\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 < -1.3999999999999999Initial program 52.9%
Simplified73.4%
Taylor expanded in x around 0 73.3%
associate-*l/73.4%
*-lft-identity73.4%
+-commutative73.4%
unpow273.4%
fma-udef73.4%
Simplified73.4%
Taylor expanded in F around -inf 99.8%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around 0 98.6%
if 1.3999999999999999 < F Initial program 57.9%
Simplified73.2%
Taylor expanded in x around 0 73.3%
associate-*l/73.3%
*-lft-identity73.3%
+-commutative73.3%
unpow273.3%
fma-udef73.3%
Simplified73.3%
Taylor expanded in F around inf 99.8%
Final simplification99.3%
(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.4)
(- (/ (sqrt 0.5) (/ (sin B) F)) 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.4) {
tmp = (sqrt(0.5) / (sin(B) / F)) - 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.4d0) then
tmp = (sqrt(0.5d0) / (sin(b) / f)) - 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.4) {
tmp = (Math.sqrt(0.5) / (Math.sin(B) / F)) - 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.4: tmp = (math.sqrt(0.5) / (math.sin(B) / F)) - 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.4) tmp = Float64(Float64(sqrt(0.5) / Float64(sin(B) / F)) - 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.4) tmp = (sqrt(0.5) / (sin(B) / F)) - 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.4], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] / F), $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.4:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{\sin B}{F}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 52.9%
Simplified73.4%
Taylor expanded in x around 0 73.3%
associate-*l/73.4%
*-lft-identity73.4%
+-commutative73.4%
unpow273.4%
fma-udef73.4%
Simplified73.4%
Taylor expanded in F around -inf 99.8%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
log1p-expm1-u80.4%
associate-*r/80.3%
inv-pow80.3%
sqrt-pow180.3%
metadata-eval80.3%
Applied egg-rr80.3%
Taylor expanded in F around 0 98.5%
*-commutative98.5%
associate-/l*98.6%
Simplified98.6%
if 1.3999999999999999 < F Initial program 57.9%
Simplified73.2%
Taylor expanded in x around 0 73.3%
associate-*l/73.3%
*-lft-identity73.3%
+-commutative73.3%
unpow273.3%
fma-udef73.3%
Simplified73.3%
Taylor expanded in F around inf 99.8%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.36)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.0026)
(- (* 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.36) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.0026) {
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.36d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.0026d0) 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.36) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.0026) {
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.36: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.0026: 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.36) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.0026) 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.36) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.0026) 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.36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0026], 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.36:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.0026:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -0.35999999999999999Initial program 52.9%
Simplified73.4%
Taylor expanded in x around 0 73.3%
associate-*l/73.4%
*-lft-identity73.4%
+-commutative73.4%
unpow273.4%
fma-udef73.4%
Simplified73.4%
Taylor expanded in F around -inf 99.8%
if -0.35999999999999999 < F < 0.0025999999999999999Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 87.0%
Taylor expanded in x around 0 87.0%
if 0.0025999999999999999 < F Initial program 59.0%
Simplified74.0%
Taylor expanded in x around 0 74.0%
associate-*l/74.0%
*-lft-identity74.0%
+-commutative74.0%
unpow274.0%
fma-udef74.0%
Simplified74.0%
Taylor expanded in F around inf 97.5%
Final simplification93.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.00225)
(- (/ F (/ B (sqrt 0.5))) 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.18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.00225) {
tmp = (F / (B / sqrt(0.5))) - 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.18d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.00225d0) then
tmp = (f / (b / sqrt(0.5d0))) - 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.18) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.00225) {
tmp = (F / (B / Math.sqrt(0.5))) - 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.18: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.00225: tmp = (F / (B / math.sqrt(0.5))) - 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.18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.00225) tmp = Float64(Float64(F / Float64(B / sqrt(0.5))) - 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.18) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.00225) tmp = (F / (B / sqrt(0.5))) - 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.18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.00225], N[(N[(F / N[(B / N[Sqrt[0.5], $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.18:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.00225:\\
\;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -0.17999999999999999Initial program 52.9%
Simplified73.4%
Taylor expanded in x around 0 73.3%
associate-*l/73.4%
*-lft-identity73.4%
+-commutative73.4%
unpow273.4%
fma-udef73.4%
Simplified73.4%
Taylor expanded in F around -inf 99.8%
if -0.17999999999999999 < F < 0.00224999999999999983Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 87.0%
Taylor expanded in x around 0 87.0%
associate-/l*87.0%
Simplified87.0%
if 0.00224999999999999983 < F Initial program 59.0%
Simplified74.0%
Taylor expanded in x around 0 74.0%
associate-*l/74.0%
*-lft-identity74.0%
+-commutative74.0%
unpow274.0%
fma-udef74.0%
Simplified74.0%
Taylor expanded in F around inf 97.5%
Final simplification93.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.5e-30)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.6e-16) (/ (- 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.5e-30) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.6e-16) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2.5d-30)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.6d-16) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2.5e-30) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.6e-16) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.5e-30: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.6e-16: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.5e-30) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.6e-16) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.5e-30) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.6e-16) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.5e-30], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.6e-16], N[((-x) / N[Tan[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 -2.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2.49999999999999986e-30Initial program 56.8%
Simplified75.5%
Taylor expanded in x around 0 75.5%
associate-*l/75.5%
*-lft-identity75.5%
+-commutative75.5%
unpow275.5%
fma-udef75.5%
Simplified75.5%
Taylor expanded in F around -inf 93.7%
if -2.49999999999999986e-30 < F < 3.59999999999999983e-16Initial program 99.5%
Taylor expanded in F around -inf 31.3%
Taylor expanded in x around inf 75.7%
mul-1-neg75.7%
associate-/l*75.7%
distribute-neg-frac75.7%
Simplified75.7%
expm1-log1p-u66.8%
expm1-udef33.2%
quot-tan33.3%
Applied egg-rr33.3%
expm1-def66.9%
expm1-log1p75.8%
Simplified75.8%
if 3.59999999999999983e-16 < F Initial program 61.6%
Simplified75.6%
Taylor expanded in x around 0 75.7%
associate-*l/75.6%
*-lft-identity75.6%
+-commutative75.6%
unpow275.6%
fma-udef75.6%
Simplified75.6%
Taylor expanded in F around inf 93.0%
Final simplification86.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9e-30)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7.5e-12)
(/ (- x) (tan B))
(if (<= F 9.2e+53) (/ 1.0 (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 <= -9e-30) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7.5e-12) {
tmp = -x / tan(B);
} else if (F <= 9.2e+53) {
tmp = 1.0 / 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 <= (-9d-30)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7.5d-12) then
tmp = -x / tan(b)
else if (f <= 9.2d+53) then
tmp = 1.0d0 / 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 <= -9e-30) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7.5e-12) {
tmp = -x / Math.tan(B);
} else if (F <= 9.2e+53) {
tmp = 1.0 / 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 <= -9e-30: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7.5e-12: tmp = -x / math.tan(B) elif F <= 9.2e+53: tmp = 1.0 / 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 <= -9e-30) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7.5e-12) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 9.2e+53) tmp = Float64(1.0 / 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 <= -9e-30) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7.5e-12) tmp = -x / tan(B); elseif (F <= 9.2e+53) tmp = 1.0 / 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, -9e-30], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.5e-12], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.2e+53], N[(1.0 / 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 -9 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -8.99999999999999935e-30Initial program 56.8%
Simplified75.5%
Taylor expanded in x around 0 75.5%
associate-*l/75.5%
*-lft-identity75.5%
+-commutative75.5%
unpow275.5%
fma-udef75.5%
Simplified75.5%
Taylor expanded in F around -inf 93.7%
if -8.99999999999999935e-30 < F < 7.5e-12Initial program 99.4%
Taylor expanded in F around -inf 31.4%
Taylor expanded in x around inf 74.7%
mul-1-neg74.7%
associate-/l*74.7%
distribute-neg-frac74.7%
Simplified74.7%
expm1-log1p-u65.9%
expm1-udef32.4%
quot-tan32.4%
Applied egg-rr32.4%
expm1-def66.0%
expm1-log1p74.7%
Simplified74.7%
if 7.5e-12 < F < 9.20000000000000079e53Initial program 99.5%
Taylor expanded in F around -inf 4.2%
Taylor expanded in x around 0 4.2%
associate-*l/4.2%
*-commutative4.2%
Simplified4.2%
Taylor expanded in x around 0 2.2%
add-sqr-sqrt1.5%
sqrt-unprod36.0%
frac-times35.8%
metadata-eval35.8%
metadata-eval35.8%
frac-times36.0%
sqrt-unprod42.2%
add-sqr-sqrt62.0%
*-un-lft-identity62.0%
Applied egg-rr62.0%
if 9.20000000000000079e53 < F Initial program 52.6%
Simplified70.0%
Taylor expanded in F around inf 99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 78.8%
Final simplification80.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -2e+264)
t_0
(if (<= F -1.05e+208)
(/ -1.0 (sin B))
(if (<= F -7.8e-28)
(/ (- -1.0 x) B)
(if (<= F 7.5e-12)
t_0
(if (<= F 1.12e+110)
(/ 1.0 (sin B))
(if (<= F 2.2e+224)
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B))
(/ F (* F (sin B)))))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -2e+264) {
tmp = t_0;
} else if (F <= -1.05e+208) {
tmp = -1.0 / sin(B);
} else if (F <= -7.8e-28) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.5e-12) {
tmp = t_0;
} else if (F <= 1.12e+110) {
tmp = 1.0 / sin(B);
} else if (F <= 2.2e+224) {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
} else {
tmp = F / (F * sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -x / tan(b)
if (f <= (-2d+264)) then
tmp = t_0
else if (f <= (-1.05d+208)) then
tmp = (-1.0d0) / sin(b)
else if (f <= (-7.8d-28)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7.5d-12) then
tmp = t_0
else if (f <= 1.12d+110) then
tmp = 1.0d0 / sin(b)
else if (f <= 2.2d+224) then
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
else
tmp = f / (f * sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / Math.tan(B);
double tmp;
if (F <= -2e+264) {
tmp = t_0;
} else if (F <= -1.05e+208) {
tmp = -1.0 / Math.sin(B);
} else if (F <= -7.8e-28) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.5e-12) {
tmp = t_0;
} else if (F <= 1.12e+110) {
tmp = 1.0 / Math.sin(B);
} else if (F <= 2.2e+224) {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
} else {
tmp = F / (F * Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= -2e+264: tmp = t_0 elif F <= -1.05e+208: tmp = -1.0 / math.sin(B) elif F <= -7.8e-28: tmp = (-1.0 - x) / B elif F <= 7.5e-12: tmp = t_0 elif F <= 1.12e+110: tmp = 1.0 / math.sin(B) elif F <= 2.2e+224: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) else: tmp = F / (F * math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2e+264) tmp = t_0; elseif (F <= -1.05e+208) tmp = Float64(-1.0 / sin(B)); elseif (F <= -7.8e-28) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7.5e-12) tmp = t_0; elseif (F <= 1.12e+110) tmp = Float64(1.0 / sin(B)); elseif (F <= 2.2e+224) tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); else tmp = Float64(F / Float64(F * sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= -2e+264) tmp = t_0; elseif (F <= -1.05e+208) tmp = -1.0 / sin(B); elseif (F <= -7.8e-28) tmp = (-1.0 - x) / B; elseif (F <= 7.5e-12) tmp = t_0; elseif (F <= 1.12e+110) tmp = 1.0 / sin(B); elseif (F <= 2.2e+224) tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); else tmp = F / (F * sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+264], t$95$0, If[LessEqual[F, -1.05e+208], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.8e-28], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.5e-12], t$95$0, If[LessEqual[F, 1.12e+110], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.2e+224], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(F / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+264}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq -1.05 \cdot 10^{+208}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -7.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.12 \cdot 10^{+110}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{+224}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{F \cdot \sin B}\\
\end{array}
\end{array}
if F < -2.00000000000000009e264 or -7.79999999999999998e-28 < F < 7.5e-12Initial program 95.0%
Taylor expanded in F around -inf 36.4%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-/l*74.1%
distribute-neg-frac74.1%
Simplified74.1%
expm1-log1p-u66.1%
expm1-udef33.6%
quot-tan33.7%
Applied egg-rr33.7%
expm1-def66.2%
expm1-log1p74.2%
Simplified74.2%
if -2.00000000000000009e264 < F < -1.0499999999999999e208Initial program 2.0%
Taylor expanded in F around -inf 99.8%
Taylor expanded in x around 0 99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 84.6%
if -1.0499999999999999e208 < F < -7.79999999999999998e-28Initial program 72.9%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 67.5%
associate-*r/67.5%
distribute-lft-in67.5%
metadata-eval67.5%
neg-mul-167.5%
Simplified67.5%
if 7.5e-12 < F < 1.1200000000000001e110Initial program 92.1%
Taylor expanded in F around -inf 23.6%
Taylor expanded in x around 0 23.7%
associate-*l/23.8%
*-commutative23.8%
Simplified23.8%
Taylor expanded in x around 0 2.5%
add-sqr-sqrt1.4%
sqrt-unprod21.7%
frac-times21.6%
metadata-eval21.6%
metadata-eval21.6%
frac-times21.7%
sqrt-unprod31.1%
add-sqr-sqrt59.9%
*-un-lft-identity59.9%
Applied egg-rr59.9%
if 1.1200000000000001e110 < F < 2.2e224Initial program 54.0%
Simplified73.9%
Taylor expanded in F around inf 99.7%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in B around 0 71.2%
associate--l+71.2%
*-commutative71.2%
div-sub71.2%
Simplified71.2%
if 2.2e224 < F Initial program 26.1%
Taylor expanded in F around -inf 40.5%
Taylor expanded in x around 0 40.5%
associate-*l/40.5%
*-commutative40.5%
Simplified40.5%
Taylor expanded in x around 0 2.7%
add-sqr-sqrt0.9%
sqrt-unprod22.3%
frac-times22.3%
metadata-eval22.3%
metadata-eval22.3%
frac-times22.3%
sqrt-unprod21.4%
add-sqr-sqrt58.2%
metadata-eval58.2%
metadata-eval58.2%
pow-prod-up58.3%
pow158.3%
inv-pow58.3%
associate-*r/58.2%
associate-/l/58.2%
Applied egg-rr58.2%
associate-*r/58.3%
*-commutative58.3%
*-rgt-identity58.3%
Simplified58.3%
Final simplification70.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -2.45e+271)
t_0
(if (<= F -3.7e+213)
(/ -1.0 (sin B))
(if (<= F -6e-29)
(/ (- -1.0 x) B)
(if (<= F 7.5e-12)
t_0
(if (or (<= F 7.5e+109) (not (<= F 7e+221)))
(/ 1.0 (sin B))
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -2.45e+271) {
tmp = t_0;
} else if (F <= -3.7e+213) {
tmp = -1.0 / sin(B);
} else if (F <= -6e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.5e-12) {
tmp = t_0;
} else if ((F <= 7.5e+109) || !(F <= 7e+221)) {
tmp = 1.0 / sin(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((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) :: t_0
real(8) :: tmp
t_0 = -x / tan(b)
if (f <= (-2.45d+271)) then
tmp = t_0
else if (f <= (-3.7d+213)) then
tmp = (-1.0d0) / sin(b)
else if (f <= (-6d-29)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7.5d-12) then
tmp = t_0
else if ((f <= 7.5d+109) .or. (.not. (f <= 7d+221))) then
tmp = 1.0d0 / sin(b)
else
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / Math.tan(B);
double tmp;
if (F <= -2.45e+271) {
tmp = t_0;
} else if (F <= -3.7e+213) {
tmp = -1.0 / Math.sin(B);
} else if (F <= -6e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.5e-12) {
tmp = t_0;
} else if ((F <= 7.5e+109) || !(F <= 7e+221)) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= -2.45e+271: tmp = t_0 elif F <= -3.7e+213: tmp = -1.0 / math.sin(B) elif F <= -6e-29: tmp = (-1.0 - x) / B elif F <= 7.5e-12: tmp = t_0 elif (F <= 7.5e+109) or not (F <= 7e+221): tmp = 1.0 / math.sin(B) else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2.45e+271) tmp = t_0; elseif (F <= -3.7e+213) tmp = Float64(-1.0 / sin(B)); elseif (F <= -6e-29) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7.5e-12) tmp = t_0; elseif ((F <= 7.5e+109) || !(F <= 7e+221)) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= -2.45e+271) tmp = t_0; elseif (F <= -3.7e+213) tmp = -1.0 / sin(B); elseif (F <= -6e-29) tmp = (-1.0 - x) / B; elseif (F <= 7.5e-12) tmp = t_0; elseif ((F <= 7.5e+109) || ~((F <= 7e+221))) tmp = 1.0 / sin(B); else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.45e+271], t$95$0, If[LessEqual[F, -3.7e+213], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.5e-12], t$95$0, If[Or[LessEqual[F, 7.5e+109], N[Not[LessEqual[F, 7e+221]], $MachinePrecision]], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2.45 \cdot 10^{+271}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq -3.7 \cdot 10^{+213}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{+109} \lor \neg \left(F \leq 7 \cdot 10^{+221}\right):\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.45e271 or -6.0000000000000005e-29 < F < 7.5e-12Initial program 95.0%
Taylor expanded in F around -inf 36.4%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-/l*74.1%
distribute-neg-frac74.1%
Simplified74.1%
expm1-log1p-u66.1%
expm1-udef33.6%
quot-tan33.7%
Applied egg-rr33.7%
expm1-def66.2%
expm1-log1p74.2%
Simplified74.2%
if -2.45e271 < F < -3.69999999999999993e213Initial program 2.0%
Taylor expanded in F around -inf 99.8%
Taylor expanded in x around 0 99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 84.6%
if -3.69999999999999993e213 < F < -6.0000000000000005e-29Initial program 72.9%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 67.5%
associate-*r/67.5%
distribute-lft-in67.5%
metadata-eval67.5%
neg-mul-167.5%
Simplified67.5%
if 7.5e-12 < F < 7.50000000000000018e109 or 7.0000000000000003e221 < F Initial program 64.2%
Taylor expanded in F around -inf 30.8%
Taylor expanded in x around 0 30.8%
associate-*l/30.8%
*-commutative30.8%
Simplified30.8%
Taylor expanded in x around 0 2.6%
add-sqr-sqrt1.2%
sqrt-unprod22.0%
frac-times21.9%
metadata-eval21.9%
metadata-eval21.9%
frac-times22.0%
sqrt-unprod27.0%
add-sqr-sqrt59.2%
*-un-lft-identity59.2%
Applied egg-rr59.2%
if 7.50000000000000018e109 < F < 7.0000000000000003e221Initial program 54.0%
Simplified73.9%
Taylor expanded in F around inf 99.7%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 91.3%
*-commutative91.3%
Simplified91.3%
Taylor expanded in B around 0 71.2%
associate--l+71.2%
*-commutative71.2%
div-sub71.2%
Simplified71.2%
Final simplification70.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -3.5e+271)
t_0
(if (<= F -5.4e+207)
(/ -1.0 (sin B))
(if (<= F -7.8e-28)
(/ (- -1.0 x) B)
(if (<= F 7.5e-12)
t_0
(if (<= F 1.9e+53)
(/ 1.0 (sin B))
(- (/ 1.0 B) (/ x (tan B))))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -3.5e+271) {
tmp = t_0;
} else if (F <= -5.4e+207) {
tmp = -1.0 / sin(B);
} else if (F <= -7.8e-28) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.5e-12) {
tmp = t_0;
} else if (F <= 1.9e+53) {
tmp = 1.0 / sin(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -x / tan(b)
if (f <= (-3.5d+271)) then
tmp = t_0
else if (f <= (-5.4d+207)) then
tmp = (-1.0d0) / sin(b)
else if (f <= (-7.8d-28)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7.5d-12) then
tmp = t_0
else if (f <= 1.9d+53) then
tmp = 1.0d0 / sin(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / Math.tan(B);
double tmp;
if (F <= -3.5e+271) {
tmp = t_0;
} else if (F <= -5.4e+207) {
tmp = -1.0 / Math.sin(B);
} else if (F <= -7.8e-28) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.5e-12) {
tmp = t_0;
} else if (F <= 1.9e+53) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= -3.5e+271: tmp = t_0 elif F <= -5.4e+207: tmp = -1.0 / math.sin(B) elif F <= -7.8e-28: tmp = (-1.0 - x) / B elif F <= 7.5e-12: tmp = t_0 elif F <= 1.9e+53: tmp = 1.0 / math.sin(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -3.5e+271) tmp = t_0; elseif (F <= -5.4e+207) tmp = Float64(-1.0 / sin(B)); elseif (F <= -7.8e-28) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7.5e-12) tmp = t_0; elseif (F <= 1.9e+53) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= -3.5e+271) tmp = t_0; elseif (F <= -5.4e+207) tmp = -1.0 / sin(B); elseif (F <= -7.8e-28) tmp = (-1.0 - x) / B; elseif (F <= 7.5e-12) tmp = t_0; elseif (F <= 1.9e+53) tmp = 1.0 / sin(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.5e+271], t$95$0, If[LessEqual[F, -5.4e+207], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.8e-28], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.5e-12], t$95$0, If[LessEqual[F, 1.9e+53], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{+271}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq -5.4 \cdot 10^{+207}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -7.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+53}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -3.4999999999999999e271 or -7.79999999999999998e-28 < F < 7.5e-12Initial program 95.0%
Taylor expanded in F around -inf 36.4%
Taylor expanded in x around inf 74.1%
mul-1-neg74.1%
associate-/l*74.1%
distribute-neg-frac74.1%
Simplified74.1%
expm1-log1p-u66.1%
expm1-udef33.6%
quot-tan33.7%
Applied egg-rr33.7%
expm1-def66.2%
expm1-log1p74.2%
Simplified74.2%
if -3.4999999999999999e271 < F < -5.4000000000000005e207Initial program 2.0%
Taylor expanded in F around -inf 99.8%
Taylor expanded in x around 0 99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 84.6%
if -5.4000000000000005e207 < F < -7.79999999999999998e-28Initial program 72.9%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 67.5%
associate-*r/67.5%
distribute-lft-in67.5%
metadata-eval67.5%
neg-mul-167.5%
Simplified67.5%
if 7.5e-12 < F < 1.89999999999999999e53Initial program 99.5%
Taylor expanded in F around -inf 4.2%
Taylor expanded in x around 0 4.2%
associate-*l/4.2%
*-commutative4.2%
Simplified4.2%
Taylor expanded in x around 0 2.2%
add-sqr-sqrt1.5%
sqrt-unprod36.0%
frac-times35.8%
metadata-eval35.8%
metadata-eval35.8%
frac-times36.0%
sqrt-unprod42.2%
add-sqr-sqrt62.0%
*-un-lft-identity62.0%
Applied egg-rr62.0%
if 1.89999999999999999e53 < F Initial program 52.6%
Simplified70.0%
Taylor expanded in F around inf 99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 78.8%
Final simplification74.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -3.2e+271)
t_0
(if (<= F -1.02e+210)
(/ -1.0 (sin B))
(if (<= F -7.6e-28)
(/ (- -1.0 x) B)
(if (<= F 5.4e+67)
t_0
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -3.2e+271) {
tmp = t_0;
} else if (F <= -1.02e+210) {
tmp = -1.0 / sin(B);
} else if (F <= -7.6e-28) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.4e+67) {
tmp = t_0;
} else {
tmp = (0.3333333333333333 * (B * x)) + ((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) :: t_0
real(8) :: tmp
t_0 = -x / tan(b)
if (f <= (-3.2d+271)) then
tmp = t_0
else if (f <= (-1.02d+210)) then
tmp = (-1.0d0) / sin(b)
else if (f <= (-7.6d-28)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 5.4d+67) then
tmp = t_0
else
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / Math.tan(B);
double tmp;
if (F <= -3.2e+271) {
tmp = t_0;
} else if (F <= -1.02e+210) {
tmp = -1.0 / Math.sin(B);
} else if (F <= -7.6e-28) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.4e+67) {
tmp = t_0;
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= -3.2e+271: tmp = t_0 elif F <= -1.02e+210: tmp = -1.0 / math.sin(B) elif F <= -7.6e-28: tmp = (-1.0 - x) / B elif F <= 5.4e+67: tmp = t_0 else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -3.2e+271) tmp = t_0; elseif (F <= -1.02e+210) tmp = Float64(-1.0 / sin(B)); elseif (F <= -7.6e-28) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 5.4e+67) tmp = t_0; else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= -3.2e+271) tmp = t_0; elseif (F <= -1.02e+210) tmp = -1.0 / sin(B); elseif (F <= -7.6e-28) tmp = (-1.0 - x) / B; elseif (F <= 5.4e+67) tmp = t_0; else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.2e+271], t$95$0, If[LessEqual[F, -1.02e+210], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.6e-28], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.4e+67], t$95$0, N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -3.2 \cdot 10^{+271}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq -1.02 \cdot 10^{+210}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -7.6 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{+67}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.2000000000000001e271 or -7.60000000000000018e-28 < F < 5.3999999999999998e67Initial program 95.6%
Taylor expanded in F around -inf 34.6%
Taylor expanded in x around inf 68.2%
mul-1-neg68.2%
associate-/l*68.2%
distribute-neg-frac68.2%
Simplified68.2%
expm1-log1p-u60.1%
expm1-udef31.5%
quot-tan31.6%
Applied egg-rr31.6%
expm1-def60.1%
expm1-log1p68.2%
Simplified68.2%
if -3.2000000000000001e271 < F < -1.02000000000000005e210Initial program 2.0%
Taylor expanded in F around -inf 99.8%
Taylor expanded in x around 0 99.9%
associate-*l/99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 84.6%
if -1.02000000000000005e210 < F < -7.60000000000000018e-28Initial program 72.9%
Taylor expanded in F around -inf 92.6%
Taylor expanded in B around 0 67.5%
associate-*r/67.5%
distribute-lft-in67.5%
metadata-eval67.5%
neg-mul-167.5%
Simplified67.5%
if 5.3999999999999998e67 < F Initial program 49.5%
Simplified67.9%
Taylor expanded in F around inf 99.7%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in B around 0 56.1%
associate--l+56.1%
*-commutative56.1%
div-sub56.1%
Simplified56.1%
Final simplification66.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.22e-29)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7.5e-12)
(/ (- x) (tan B))
(if (<= F 8e+51) (/ 1.0 (sin B)) (- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.22e-29) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7.5e-12) {
tmp = -x / tan(B);
} else if (F <= 8e+51) {
tmp = 1.0 / sin(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.22d-29)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 7.5d-12) then
tmp = -x / tan(b)
else if (f <= 8d+51) then
tmp = 1.0d0 / sin(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.22e-29) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 7.5e-12) {
tmp = -x / Math.tan(B);
} else if (F <= 8e+51) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.22e-29: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 7.5e-12: tmp = -x / math.tan(B) elif F <= 8e+51: tmp = 1.0 / math.sin(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.22e-29) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7.5e-12) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 8e+51) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.22e-29) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 7.5e-12) tmp = -x / tan(B); elseif (F <= 8e+51) tmp = 1.0 / sin(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.22e-29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-12], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+51], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.22 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+51}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.21999999999999996e-29Initial program 56.8%
Taylor expanded in F around -inf 93.6%
Taylor expanded in B around 0 78.8%
if -1.21999999999999996e-29 < F < 7.5e-12Initial program 99.4%
Taylor expanded in F around -inf 31.4%
Taylor expanded in x around inf 74.7%
mul-1-neg74.7%
associate-/l*74.7%
distribute-neg-frac74.7%
Simplified74.7%
expm1-log1p-u65.9%
expm1-udef32.4%
quot-tan32.4%
Applied egg-rr32.4%
expm1-def66.0%
expm1-log1p74.7%
Simplified74.7%
if 7.5e-12 < F < 8e51Initial program 99.5%
Taylor expanded in F around -inf 4.2%
Taylor expanded in x around 0 4.2%
associate-*l/4.2%
*-commutative4.2%
Simplified4.2%
Taylor expanded in x around 0 2.2%
add-sqr-sqrt1.5%
sqrt-unprod36.0%
frac-times35.8%
metadata-eval35.8%
metadata-eval35.8%
frac-times36.0%
sqrt-unprod42.2%
add-sqr-sqrt62.0%
*-un-lft-identity62.0%
Applied egg-rr62.0%
if 8e51 < F Initial program 52.6%
Simplified70.0%
Taylor expanded in F around inf 99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 78.8%
Final simplification76.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45e-76)
(/ (- -1.0 x) B)
(if (<= F 1.3e-17)
(- (* B (* x (- -0.3333333333333333))) (/ x B))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-76) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.3e-17) {
tmp = (B * (x * -(-0.3333333333333333))) - (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 <= (-1.45d-76)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.3d-17) then
tmp = (b * (x * -(-0.3333333333333333d0))) - (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 <= -1.45e-76) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.3e-17) {
tmp = (B * (x * -(-0.3333333333333333))) - (x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-76: tmp = (-1.0 - x) / B elif F <= 1.3e-17: tmp = (B * (x * -(-0.3333333333333333))) - (x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-76) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.3e-17) tmp = Float64(Float64(B * Float64(x * Float64(-(-0.3333333333333333)))) - Float64(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 <= -1.45e-76) tmp = (-1.0 - x) / B; elseif (F <= 1.3e-17) tmp = (B * (x * -(-0.3333333333333333))) - (x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-76], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.3e-17], N[(N[(B * N[(x * (--0.3333333333333333)), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-76}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-17}:\\
\;\;\;\;B \cdot \left(x \cdot \left(--0.3333333333333333\right)\right) - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.4500000000000001e-76Initial program 60.0%
Taylor expanded in F around -inf 90.7%
Taylor expanded in B around 0 60.1%
associate-*r/60.1%
distribute-lft-in60.1%
metadata-eval60.1%
neg-mul-160.1%
Simplified60.1%
if -1.4500000000000001e-76 < F < 1.30000000000000002e-17Initial program 99.5%
Taylor expanded in F around -inf 29.8%
Taylor expanded in x around inf 76.2%
mul-1-neg76.2%
associate-/l*76.3%
distribute-neg-frac76.3%
Simplified76.3%
Taylor expanded in B around 0 42.0%
distribute-lft-out42.0%
distribute-rgt-out--42.0%
metadata-eval42.0%
Simplified42.0%
if 1.30000000000000002e-17 < F Initial program 61.6%
Simplified75.6%
Taylor expanded in F around inf 92.8%
associate-/r*92.8%
Simplified92.8%
Taylor expanded in B around 0 48.7%
Final simplification49.6%
(FPCore (F B x) :precision binary64 (if (<= F -7.6e-16) (/ -1.0 B) (if (<= F 3.5e-13) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.6e-16) {
tmp = -1.0 / B;
} else if (F <= 3.5e-13) {
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 <= (-7.6d-16)) then
tmp = (-1.0d0) / b
else if (f <= 3.5d-13) 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 <= -7.6e-16) {
tmp = -1.0 / B;
} else if (F <= 3.5e-13) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.6e-16: tmp = -1.0 / B elif F <= 3.5e-13: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.6e-16) tmp = Float64(-1.0 / B); elseif (F <= 3.5e-13) tmp = Float64(-Float64(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 <= -7.6e-16) tmp = -1.0 / B; elseif (F <= 3.5e-13) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.6e-16], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 3.5e-13], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-13}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.60000000000000024e-16Initial program 54.9%
Taylor expanded in F around -inf 95.9%
Taylor expanded in x around 0 96.0%
associate-*l/96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 54.2%
Taylor expanded in B around 0 38.1%
if -7.60000000000000024e-16 < F < 3.5000000000000002e-13Initial program 99.4%
Simplified99.7%
Taylor expanded in F around inf 25.6%
associate-/r*25.6%
Simplified25.6%
Taylor expanded in B around 0 18.7%
Taylor expanded in x around inf 39.8%
associate-*r/39.8%
neg-mul-139.8%
Simplified39.8%
if 3.5000000000000002e-13 < F Initial program 60.6%
Simplified75.0%
Taylor expanded in F around inf 95.0%
associate-/r*94.9%
Simplified94.9%
Taylor expanded in B around 0 49.8%
Final simplification42.3%
(FPCore (F B x) :precision binary64 (if (<= F -6.4e-92) (/ (- -1.0 x) B) (if (<= F 6e-13) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.4e-92) {
tmp = (-1.0 - x) / B;
} else if (F <= 6e-13) {
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 <= (-6.4d-92)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 6d-13) 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 <= -6.4e-92) {
tmp = (-1.0 - x) / B;
} else if (F <= 6e-13) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.4e-92: tmp = (-1.0 - x) / B elif F <= 6e-13: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.4e-92) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 6e-13) tmp = Float64(-Float64(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 <= -6.4e-92) tmp = (-1.0 - x) / B; elseif (F <= 6e-13) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.4e-92], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6e-13], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.4 \cdot 10^{-92}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-13}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.3999999999999994e-92Initial program 62.3%
Taylor expanded in F around -inf 86.7%
Taylor expanded in B around 0 58.0%
associate-*r/58.0%
distribute-lft-in58.0%
metadata-eval58.0%
neg-mul-158.0%
Simplified58.0%
if -6.3999999999999994e-92 < F < 5.99999999999999968e-13Initial program 99.5%
Simplified99.7%
Taylor expanded in F around inf 23.8%
associate-/r*23.8%
Simplified23.8%
Taylor expanded in B around 0 17.9%
Taylor expanded in x around inf 42.0%
associate-*r/42.0%
neg-mul-142.0%
Simplified42.0%
if 5.99999999999999968e-13 < F Initial program 60.6%
Simplified75.0%
Taylor expanded in F around inf 95.0%
associate-/r*94.9%
Simplified94.9%
Taylor expanded in B around 0 49.8%
Final simplification49.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.6e-16) (/ -1.0 B) (if (<= F 7.5e-12) (- (/ x B)) (/ 1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e-16) {
tmp = -1.0 / B;
} else if (F <= 7.5e-12) {
tmp = -(x / B);
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.6d-16)) then
tmp = (-1.0d0) / b
else if (f <= 7.5d-12) then
tmp = -(x / b)
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e-16) {
tmp = -1.0 / B;
} else if (F <= 7.5e-12) {
tmp = -(x / B);
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.6e-16: tmp = -1.0 / B elif F <= 7.5e-12: tmp = -(x / B) else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.6e-16) tmp = Float64(-1.0 / B); elseif (F <= 7.5e-12) tmp = Float64(-Float64(x / B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.6e-16) tmp = -1.0 / B; elseif (F <= 7.5e-12) tmp = -(x / B); else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.6e-16], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 7.5e-12], (-N[(x / B), $MachinePrecision]), N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < -1.60000000000000011e-16Initial program 54.9%
Taylor expanded in F around -inf 95.9%
Taylor expanded in x around 0 96.0%
associate-*l/96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in x around 0 54.2%
Taylor expanded in B around 0 38.1%
if -1.60000000000000011e-16 < F < 7.5e-12Initial program 99.4%
Simplified99.7%
Taylor expanded in F around inf 26.3%
associate-/r*26.3%
Simplified26.3%
Taylor expanded in B around 0 19.5%
Taylor expanded in x around inf 40.4%
associate-*r/40.4%
neg-mul-140.4%
Simplified40.4%
if 7.5e-12 < F Initial program 60.1%
Simplified74.6%
Taylor expanded in F around inf 94.9%
associate-/r*94.9%
Simplified94.9%
Taylor expanded in B around 0 49.1%
Taylor expanded in x around 0 31.7%
Final simplification37.2%
(FPCore (F B x) :precision binary64 (if (<= F -3.5e-170) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.5e-170) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.5d-170)) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.5e-170) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.5e-170: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.5e-170) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.5e-170) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.5e-170], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.5 \cdot 10^{-170}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < -3.49999999999999985e-170Initial program 68.9%
Taylor expanded in F around -inf 78.9%
Taylor expanded in x around 0 79.0%
associate-*l/79.0%
*-commutative79.0%
Simplified79.0%
Taylor expanded in x around 0 38.9%
Taylor expanded in B around 0 27.8%
if -3.49999999999999985e-170 < F Initial program 80.3%
Simplified87.5%
Taylor expanded in F around inf 57.6%
associate-/r*57.6%
Simplified57.6%
Taylor expanded in B around 0 33.0%
Taylor expanded in x around 0 17.4%
Final simplification21.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 75.8%
Taylor expanded in F around -inf 51.4%
Taylor expanded in x around 0 51.4%
associate-*l/51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in x around 0 17.2%
Taylor expanded in B around 0 12.8%
Final simplification12.8%
herbie shell --seed 2024020
(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))))))