
(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 18 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 -4e+30)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 10000.0)
(- (/ (* F (pow (fma F F 2.0) -0.5)) (sin B)) t_0)
(- (/ (+ 1.0 (/ -1.0 (pow F 2.0))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4e+30) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 10000.0) {
tmp = ((F * pow(fma(F, F, 2.0), -0.5)) / sin(B)) - t_0;
} else {
tmp = ((1.0 + (-1.0 / pow(F, 2.0))) / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4e+30) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 10000.0) tmp = Float64(Float64(Float64(F * (fma(F, F, 2.0) ^ -0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / (F ^ 2.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+30], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 10000.0], N[(N[(N[(F * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 + N[(-1.0 / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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^{+30}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 10000:\\
\;\;\;\;\frac{F \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{-1}{{F}^{2}}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.0000000000000001e30Initial program 66.9%
distribute-lft-neg-in66.9%
+-commutative66.9%
associate-*l/75.0%
associate-/l*75.0%
fma-define75.0%
/-rgt-identity75.0%
remove-double-neg75.0%
fma-neg75.0%
Simplified75.2%
Taylor expanded in x around 0 75.2%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-undefine75.2%
Simplified75.2%
Taylor expanded in F around -inf 99.7%
if -4.0000000000000001e30 < F < 1e4Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
associate-*r/99.7%
inv-pow99.7%
sqrt-pow199.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 1e4 < F Initial program 53.4%
distribute-lft-neg-in53.4%
+-commutative53.4%
associate-*l/74.4%
associate-/l*74.3%
fma-define74.3%
/-rgt-identity74.3%
remove-double-neg74.3%
fma-neg74.3%
Simplified74.5%
Taylor expanded in x around 0 74.4%
associate-*l/74.5%
*-lft-identity74.5%
+-commutative74.5%
unpow274.5%
fma-undefine74.5%
Simplified74.5%
associate-*r/74.5%
inv-pow74.5%
sqrt-pow174.5%
metadata-eval74.5%
Applied egg-rr74.5%
Taylor expanded in F around inf 99.8%
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 (/ -1.0 (pow F 2.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 + (-1.0 / pow(F, 2.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 + ((-1.0d0) / (f ** 2.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 + (-1.0 / Math.pow(F, 2.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 + (-1.0 / math.pow(F, 2.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(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(Float64(1.0 + Float64(-1.0 / (F ^ 2.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 + (-1.0 / (F ^ 2.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[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(1.0 + N[(-1.0 / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 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{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{-1}{{F}^{2}}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 68.7%
distribute-lft-neg-in68.7%
+-commutative68.7%
associate-*l/76.4%
associate-/l*76.3%
fma-define76.3%
/-rgt-identity76.3%
remove-double-neg76.3%
fma-neg76.3%
Simplified76.5%
Taylor expanded in x around 0 76.6%
associate-*l/76.5%
*-lft-identity76.5%
+-commutative76.5%
unpow276.5%
fma-undefine76.5%
Simplified76.5%
Taylor expanded in F around -inf 99.7%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
if 1.3999999999999999 < F Initial program 54.7%
distribute-lft-neg-in54.7%
+-commutative54.7%
associate-*l/75.1%
associate-/l*75.1%
fma-define75.1%
/-rgt-identity75.1%
remove-double-neg75.1%
fma-neg75.1%
Simplified75.2%
Taylor expanded in x around 0 75.1%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-undefine75.2%
Simplified75.2%
associate-*r/75.2%
inv-pow75.2%
sqrt-pow175.2%
metadata-eval75.2%
Applied egg-rr75.2%
Taylor expanded in F around inf 99.8%
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 68.7%
distribute-lft-neg-in68.7%
+-commutative68.7%
associate-*l/76.4%
associate-/l*76.3%
fma-define76.3%
/-rgt-identity76.3%
remove-double-neg76.3%
fma-neg76.3%
Simplified76.5%
Taylor expanded in x around 0 76.6%
associate-*l/76.5%
*-lft-identity76.5%
+-commutative76.5%
unpow276.5%
fma-undefine76.5%
Simplified76.5%
Taylor expanded in F around -inf 99.7%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
if 1.3999999999999999 < F Initial program 54.7%
distribute-lft-neg-in54.7%
+-commutative54.7%
associate-*l/75.1%
associate-/l*75.1%
fma-define75.1%
/-rgt-identity75.1%
remove-double-neg75.1%
fma-neg75.1%
Simplified75.2%
Taylor expanded in x around 0 75.1%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-undefine75.2%
Simplified75.2%
Taylor expanded in F around inf 98.6%
Final simplification99.4%
(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(Float64(F * 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[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[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 -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 68.7%
distribute-lft-neg-in68.7%
+-commutative68.7%
associate-*l/76.4%
associate-/l*76.3%
fma-define76.3%
/-rgt-identity76.3%
remove-double-neg76.3%
fma-neg76.3%
Simplified76.5%
Taylor expanded in x around 0 76.6%
associate-*l/76.5%
*-lft-identity76.5%
+-commutative76.5%
unpow276.5%
fma-undefine76.5%
Simplified76.5%
Taylor expanded in F around -inf 99.7%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
if 1.3999999999999999 < F Initial program 54.7%
distribute-lft-neg-in54.7%
+-commutative54.7%
associate-*l/75.1%
associate-/l*75.1%
fma-define75.1%
/-rgt-identity75.1%
remove-double-neg75.1%
fma-neg75.1%
Simplified75.2%
Taylor expanded in x around 0 75.1%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-undefine75.2%
Simplified75.2%
Taylor expanded in F around inf 98.6%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (/ x (tan B))))
(if (<= F -2.15e-41)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 5.1e-206)
t_0
(if (<= F 2.1e-116)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 2.7e-45) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -2.15e-41) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 2.1e-116) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 2.7e-45) {
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 = -x / tan(b)
t_1 = x / tan(b)
if (f <= (-2.15d-41)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 5.1d-206) then
tmp = t_0
else if (f <= 2.1d-116) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 2.7d-45) 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 = -x / Math.tan(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -2.15e-41) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 2.1e-116) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 2.7e-45) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) t_1 = x / math.tan(B) tmp = 0 if F <= -2.15e-41: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 5.1e-206: tmp = t_0 elif F <= 2.1e-116: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 2.7e-45: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.15e-41) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 2.1e-116) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 2.7e-45) 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 = -x / tan(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -2.15e-41) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 2.1e-116) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 2.7e-45) 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[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.15e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 5.1e-206], t$95$0, If[LessEqual[F, 2.1e-116], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-45], 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{-x}{\tan B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.15 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-116}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -2.1499999999999999e-41Initial program 71.4%
distribute-lft-neg-in71.4%
+-commutative71.4%
associate-*l/78.4%
associate-/l*78.3%
fma-define78.3%
/-rgt-identity78.3%
remove-double-neg78.3%
fma-neg78.3%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 96.3%
if -2.1499999999999999e-41 < F < 5.10000000000000005e-206 or 2.0999999999999999e-116 < F < 2.69999999999999985e-45Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.8%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in F around 0 83.0%
mul-1-neg83.0%
distribute-neg-frac283.0%
Simplified83.0%
distribute-frac-neg283.0%
neg-sub083.0%
*-commutative83.0%
associate-*l/82.8%
clear-num82.7%
associate-*l/83.1%
*-un-lft-identity83.1%
quot-tan83.1%
Applied egg-rr83.1%
neg-sub083.1%
distribute-neg-frac83.1%
Simplified83.1%
if 5.10000000000000005e-206 < F < 2.0999999999999999e-116Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around inf 66.0%
*-commutative66.0%
sqrt-div65.7%
metadata-eval65.7%
frac-times65.5%
*-un-lft-identity65.5%
+-commutative65.5%
fma-define65.5%
Applied egg-rr65.5%
Taylor expanded in x around 0 66.0%
if 2.69999999999999985e-45 < F Initial program 57.8%
distribute-lft-neg-in57.8%
+-commutative57.8%
associate-*l/76.8%
associate-/l*76.7%
fma-define76.7%
/-rgt-identity76.7%
remove-double-neg76.7%
fma-neg76.7%
Simplified76.9%
Taylor expanded in x around 0 76.7%
associate-*l/76.9%
*-lft-identity76.9%
+-commutative76.9%
unpow276.9%
fma-undefine76.9%
Simplified76.9%
Taylor expanded in F around inf 95.0%
Final simplification89.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -110.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 5.1e-206)
t_0
(if (<= F 1.36e-117)
(* (sqrt 0.5) (/ F (sin B)))
(if (<= F 5.8e+131)
t_0
(-
(/ 1.0 (sin B))
(+ (* -0.3333333333333333 (* B x)) (/ x B)))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -110.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 1.36e-117) {
tmp = sqrt(0.5) * (F / sin(B));
} else if (F <= 5.8e+131) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (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 <= (-110.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5.1d-206) then
tmp = t_0
else if (f <= 1.36d-117) then
tmp = sqrt(0.5d0) * (f / sin(b))
else if (f <= 5.8d+131) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - (((-0.3333333333333333d0) * (b * x)) + (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 <= -110.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 1.36e-117) {
tmp = Math.sqrt(0.5) * (F / Math.sin(B));
} else if (F <= 5.8e+131) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B));
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= -110.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5.1e-206: tmp = t_0 elif F <= 1.36e-117: tmp = math.sqrt(0.5) * (F / math.sin(B)) elif F <= 5.8e+131: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -110.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 1.36e-117) tmp = Float64(sqrt(0.5) * Float64(F / sin(B))); elseif (F <= 5.8e+131) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(-0.3333333333333333 * Float64(B * x)) + Float64(x / B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= -110.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 1.36e-117) tmp = sqrt(0.5) * (F / sin(B)); elseif (F <= 5.8e+131) tmp = t_0; else tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (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, -110.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.1e-206], t$95$0, If[LessEqual[F, 1.36e-117], N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.8e+131], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -110:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.36 \cdot 10^{-117}:\\
\;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{+131}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\
\end{array}
\end{array}
if F < -110Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -110 < F < 5.10000000000000005e-206 or 1.35999999999999996e-117 < F < 5.8000000000000002e131Initial program 96.9%
distribute-lft-neg-in96.9%
+-commutative96.9%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 84.9%
Taylor expanded in F around 0 71.5%
mul-1-neg71.5%
distribute-neg-frac271.5%
Simplified71.5%
distribute-frac-neg271.5%
neg-sub071.5%
*-commutative71.5%
associate-*l/71.3%
clear-num71.3%
associate-*l/71.5%
*-un-lft-identity71.5%
quot-tan71.6%
Applied egg-rr71.6%
neg-sub071.6%
distribute-neg-frac71.6%
Simplified71.6%
if 5.10000000000000005e-206 < F < 1.35999999999999996e-117Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around inf 66.0%
Taylor expanded in x around 0 65.9%
if 5.8000000000000002e131 < F Initial program 36.2%
Taylor expanded in F around -inf 51.5%
Taylor expanded in B around 0 24.3%
add-sqr-sqrt14.5%
sqrt-unprod36.3%
frac-times36.3%
metadata-eval36.3%
metadata-eval36.3%
frac-times36.3%
sqrt-unprod36.6%
add-sqr-sqrt65.3%
*-un-lft-identity65.3%
Applied egg-rr65.3%
Final simplification70.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -200.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 5.1e-206)
t_0
(if (<= F 9.5e-118)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 9e+134)
t_0
(-
(/ 1.0 (sin B))
(+ (* -0.3333333333333333 (* B x)) (/ x B)))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -200.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 9.5e-118) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 9e+134) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (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 <= (-200.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5.1d-206) then
tmp = t_0
else if (f <= 9.5d-118) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 9d+134) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - (((-0.3333333333333333d0) * (b * x)) + (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 <= -200.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 9.5e-118) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 9e+134) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B));
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= -200.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5.1e-206: tmp = t_0 elif F <= 9.5e-118: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 9e+134: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -200.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 9.5e-118) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 9e+134) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(-0.3333333333333333 * Float64(B * x)) + Float64(x / B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= -200.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 9.5e-118) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 9e+134) tmp = t_0; else tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (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, -200.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.1e-206], t$95$0, If[LessEqual[F, 9.5e-118], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e+134], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -200:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-118}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{+134}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\
\end{array}
\end{array}
if F < -200Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -200 < F < 5.10000000000000005e-206 or 9.49999999999999931e-118 < F < 8.9999999999999995e134Initial program 96.9%
distribute-lft-neg-in96.9%
+-commutative96.9%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 84.9%
Taylor expanded in F around 0 71.5%
mul-1-neg71.5%
distribute-neg-frac271.5%
Simplified71.5%
distribute-frac-neg271.5%
neg-sub071.5%
*-commutative71.5%
associate-*l/71.3%
clear-num71.3%
associate-*l/71.5%
*-un-lft-identity71.5%
quot-tan71.6%
Applied egg-rr71.6%
neg-sub071.6%
distribute-neg-frac71.6%
Simplified71.6%
if 5.10000000000000005e-206 < F < 9.49999999999999931e-118Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around inf 66.0%
*-commutative66.0%
sqrt-div65.7%
metadata-eval65.7%
frac-times65.5%
*-un-lft-identity65.5%
+-commutative65.5%
fma-define65.5%
Applied egg-rr65.5%
Taylor expanded in x around 0 66.0%
if 8.9999999999999995e134 < F Initial program 36.2%
Taylor expanded in F around -inf 51.5%
Taylor expanded in B around 0 24.3%
add-sqr-sqrt14.5%
sqrt-unprod36.3%
frac-times36.3%
metadata-eval36.3%
metadata-eval36.3%
frac-times36.3%
sqrt-unprod36.6%
add-sqr-sqrt65.3%
*-un-lft-identity65.3%
Applied egg-rr65.3%
Final simplification70.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -2.2e-41)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 5.1e-206)
t_0
(if (<= F 9.5e-118)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 2.3e+133)
t_0
(-
(/ 1.0 (sin B))
(+ (* -0.3333333333333333 (* B x)) (/ x B)))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -2.2e-41) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 9.5e-118) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 2.3e+133) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (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.2d-41)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 5.1d-206) then
tmp = t_0
else if (f <= 9.5d-118) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 2.3d+133) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - (((-0.3333333333333333d0) * (b * x)) + (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.2e-41) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 5.1e-206) {
tmp = t_0;
} else if (F <= 9.5e-118) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 2.3e+133) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B));
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= -2.2e-41: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 5.1e-206: tmp = t_0 elif F <= 9.5e-118: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 2.3e+133: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2.2e-41) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 9.5e-118) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 2.3e+133) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(-0.3333333333333333 * Float64(B * x)) + Float64(x / B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= -2.2e-41) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 5.1e-206) tmp = t_0; elseif (F <= 9.5e-118) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 2.3e+133) tmp = t_0; else tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (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.2e-41], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.1e-206], t$95$0, If[LessEqual[F, 9.5e-118], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e+133], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-206}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-118}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{+133}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\
\end{array}
\end{array}
if F < -2.2e-41Initial program 71.4%
distribute-lft-neg-in71.4%
+-commutative71.4%
associate-*l/78.4%
associate-/l*78.3%
fma-define78.3%
/-rgt-identity78.3%
remove-double-neg78.3%
fma-neg78.3%
Simplified78.6%
Taylor expanded in x around 0 78.6%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 96.3%
if -2.2e-41 < F < 5.10000000000000005e-206 or 9.49999999999999931e-118 < F < 2.2999999999999999e133Initial program 96.7%
distribute-lft-neg-in96.7%
+-commutative96.7%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 83.9%
Taylor expanded in F around 0 72.2%
mul-1-neg72.2%
distribute-neg-frac272.2%
Simplified72.2%
distribute-frac-neg272.2%
neg-sub072.2%
*-commutative72.2%
associate-*l/72.1%
clear-num72.0%
associate-*l/72.3%
*-un-lft-identity72.3%
quot-tan72.3%
Applied egg-rr72.3%
neg-sub072.3%
distribute-neg-frac72.3%
Simplified72.3%
if 5.10000000000000005e-206 < F < 9.49999999999999931e-118Initial program 99.4%
distribute-lft-neg-in99.4%
+-commutative99.4%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in F around inf 66.0%
*-commutative66.0%
sqrt-div65.7%
metadata-eval65.7%
frac-times65.5%
*-un-lft-identity65.5%
+-commutative65.5%
fma-define65.5%
Applied egg-rr65.5%
Taylor expanded in x around 0 66.0%
if 2.2999999999999999e133 < F Initial program 36.2%
Taylor expanded in F around -inf 51.5%
Taylor expanded in B around 0 24.3%
add-sqr-sqrt14.5%
sqrt-unprod36.3%
frac-times36.3%
metadata-eval36.3%
metadata-eval36.3%
frac-times36.3%
sqrt-unprod36.6%
add-sqr-sqrt65.3%
*-un-lft-identity65.3%
Applied egg-rr65.3%
Final simplification78.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.038)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.085)
(- (/ (* 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.038) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.085) {
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.038d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.085d0) 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.038) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.085) {
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.038: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.085: 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.038) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.085) tmp = Float64(Float64(Float64(F * 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.038) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.085) 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.038], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.085], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $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.038:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.085:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.0379999999999999991Initial program 68.7%
distribute-lft-neg-in68.7%
+-commutative68.7%
associate-*l/76.4%
associate-/l*76.3%
fma-define76.3%
/-rgt-identity76.3%
remove-double-neg76.3%
fma-neg76.3%
Simplified76.5%
Taylor expanded in x around 0 76.6%
associate-*l/76.5%
*-lft-identity76.5%
+-commutative76.5%
unpow276.5%
fma-undefine76.5%
Simplified76.5%
Taylor expanded in F around -inf 99.7%
if -0.0379999999999999991 < F < 0.0850000000000000061Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 85.3%
*-commutative85.3%
Simplified85.3%
if 0.0850000000000000061 < F Initial program 54.7%
distribute-lft-neg-in54.7%
+-commutative54.7%
associate-*l/75.1%
associate-/l*75.1%
fma-define75.1%
/-rgt-identity75.1%
remove-double-neg75.1%
fma-neg75.1%
Simplified75.2%
Taylor expanded in x around 0 75.1%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-undefine75.2%
Simplified75.2%
Taylor expanded in F around inf 98.6%
Final simplification93.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (+ x 1.0) B)) (t_1 (/ x (- (sin B)))))
(if (<= F -165000000.0)
(/ (- -1.0 x) B)
(if (<= F 6.2e+134)
t_1
(if (<= F 1.5e+161)
t_0
(if (<= F 1.1e+206)
t_1
(if (<= F 2.7e+236)
t_0
(- (/ -1.0 B) (+ (* -0.3333333333333333 (* B x)) (/ x B))))))))))
double code(double F, double B, double x) {
double t_0 = (x + 1.0) / B;
double t_1 = x / -sin(B);
double tmp;
if (F <= -165000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.2e+134) {
tmp = t_1;
} else if (F <= 1.5e+161) {
tmp = t_0;
} else if (F <= 1.1e+206) {
tmp = t_1;
} else if (F <= 2.7e+236) {
tmp = t_0;
} else {
tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (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) :: t_1
real(8) :: tmp
t_0 = (x + 1.0d0) / b
t_1 = x / -sin(b)
if (f <= (-165000000.0d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 6.2d+134) then
tmp = t_1
else if (f <= 1.5d+161) then
tmp = t_0
else if (f <= 1.1d+206) then
tmp = t_1
else if (f <= 2.7d+236) then
tmp = t_0
else
tmp = ((-1.0d0) / b) - (((-0.3333333333333333d0) * (b * x)) + (x / b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (x + 1.0) / B;
double t_1 = x / -Math.sin(B);
double tmp;
if (F <= -165000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.2e+134) {
tmp = t_1;
} else if (F <= 1.5e+161) {
tmp = t_0;
} else if (F <= 1.1e+206) {
tmp = t_1;
} else if (F <= 2.7e+236) {
tmp = t_0;
} else {
tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (x / B));
}
return tmp;
}
def code(F, B, x): t_0 = (x + 1.0) / B t_1 = x / -math.sin(B) tmp = 0 if F <= -165000000.0: tmp = (-1.0 - x) / B elif F <= 6.2e+134: tmp = t_1 elif F <= 1.5e+161: tmp = t_0 elif F <= 1.1e+206: tmp = t_1 elif F <= 2.7e+236: tmp = t_0 else: tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (x / B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(x + 1.0) / B) t_1 = Float64(x / Float64(-sin(B))) tmp = 0.0 if (F <= -165000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 6.2e+134) tmp = t_1; elseif (F <= 1.5e+161) tmp = t_0; elseif (F <= 1.1e+206) tmp = t_1; elseif (F <= 2.7e+236) tmp = t_0; else tmp = Float64(Float64(-1.0 / B) - Float64(Float64(-0.3333333333333333 * Float64(B * x)) + Float64(x / B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (x + 1.0) / B; t_1 = x / -sin(B); tmp = 0.0; if (F <= -165000000.0) tmp = (-1.0 - x) / B; elseif (F <= 6.2e+134) tmp = t_1; elseif (F <= 1.5e+161) tmp = t_0; elseif (F <= 1.1e+206) tmp = t_1; elseif (F <= 2.7e+236) tmp = t_0; else tmp = (-1.0 / B) - ((-0.3333333333333333 * (B * x)) + (x / B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[F, -165000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.2e+134], t$95$1, If[LessEqual[F, 1.5e+161], t$95$0, If[LessEqual[F, 1.1e+206], t$95$1, If[LessEqual[F, 2.7e+236], t$95$0, N[(N[(-1.0 / B), $MachinePrecision] - N[(N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x + 1}{B}\\
t_1 := \frac{x}{-\sin B}\\
\mathbf{if}\;F \leq -165000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{+134}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{+206}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+236}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\
\end{array}
\end{array}
if F < -1.65e8Initial program 67.9%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 42.1%
mul-1-neg42.1%
distribute-neg-frac242.1%
Simplified42.1%
if -1.65e8 < F < 6.19999999999999963e134 or 1.50000000000000006e161 < F < 1.10000000000000001e206Initial program 92.6%
distribute-lft-neg-in92.6%
+-commutative92.6%
associate-*l/97.4%
associate-/l*97.3%
fma-define97.4%
/-rgt-identity97.4%
remove-double-neg97.4%
fma-neg97.3%
Simplified97.5%
Taylor expanded in x around 0 97.5%
associate-*l/97.5%
*-lft-identity97.5%
+-commutative97.5%
unpow297.5%
fma-undefine97.5%
Simplified97.5%
Taylor expanded in F around 0 81.7%
Taylor expanded in F around 0 66.2%
mul-1-neg66.2%
distribute-neg-frac266.2%
Simplified66.2%
Taylor expanded in B around 0 32.5%
if 6.19999999999999963e134 < F < 1.50000000000000006e161 or 1.10000000000000001e206 < F < 2.7000000000000002e236Initial program 36.8%
Taylor expanded in F around -inf 24.1%
Taylor expanded in B around 0 1.3%
mul-1-neg1.3%
distribute-neg-frac21.3%
Simplified1.3%
*-un-lft-identity1.3%
add-sqr-sqrt0.8%
sqrt-unprod20.7%
sqr-neg20.7%
sqrt-unprod41.2%
add-sqr-sqrt55.5%
Applied egg-rr55.5%
*-lft-identity55.5%
Simplified55.5%
if 2.7000000000000002e236 < F Initial program 37.8%
Taylor expanded in F around -inf 68.8%
Taylor expanded in B around 0 33.0%
Taylor expanded in B around 0 34.1%
Final simplification36.8%
(FPCore (F B x)
:precision binary64
(if (<= F -0.55)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.8e+131)
(/ (- x) (tan B))
(- (/ 1.0 (sin B)) (+ (* -0.3333333333333333 (* B x)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.55) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.8e+131) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.55d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.8d+131) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / sin(b)) - (((-0.3333333333333333d0) * (b * x)) + (x / b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.55) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.8e+131) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.55: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.8e+131: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.55) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.8e+131) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(-0.3333333333333333 * Float64(B * x)) + Float64(x / B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.55) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.8e+131) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - ((-0.3333333333333333 * (B * x)) + (x / B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.55], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+131], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.55:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+131}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(-0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{x}{B}\right)\\
\end{array}
\end{array}
if F < -0.55000000000000004Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -0.55000000000000004 < F < 1.80000000000000016e131Initial program 97.3%
distribute-lft-neg-in97.3%
+-commutative97.3%
associate-*l/99.5%
associate-/l*99.5%
fma-define99.5%
/-rgt-identity99.5%
remove-double-neg99.5%
fma-neg99.5%
Simplified99.7%
Taylor expanded in x around 0 99.7%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 87.0%
Taylor expanded in F around 0 66.5%
mul-1-neg66.5%
distribute-neg-frac266.5%
Simplified66.5%
distribute-frac-neg266.5%
neg-sub066.5%
*-commutative66.5%
associate-*l/66.4%
clear-num66.3%
associate-*l/66.6%
*-un-lft-identity66.6%
quot-tan66.6%
Applied egg-rr66.6%
neg-sub066.6%
distribute-neg-frac66.6%
Simplified66.6%
if 1.80000000000000016e131 < F Initial program 36.2%
Taylor expanded in F around -inf 51.5%
Taylor expanded in B around 0 24.3%
add-sqr-sqrt14.5%
sqrt-unprod36.3%
frac-times36.3%
metadata-eval36.3%
metadata-eval36.3%
frac-times36.3%
sqrt-unprod36.6%
add-sqr-sqrt65.3%
*-un-lft-identity65.3%
Applied egg-rr65.3%
Final simplification67.9%
(FPCore (F B x) :precision binary64 (if (<= F -19.0) (- (/ -1.0 (sin B)) (/ x B)) (/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -19.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else {
tmp = -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 <= (-19.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else
tmp = -x / tan(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -19.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = -x / Math.tan(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -19.0: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = -x / math.tan(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -19.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -19.0) tmp = (-1.0 / sin(B)) - (x / B); else tmp = -x / tan(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -19.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -19:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if F < -19Initial program 68.7%
Taylor expanded in F around -inf 99.4%
Taylor expanded in B around 0 71.8%
if -19 < F Initial program 82.6%
distribute-lft-neg-in82.6%
+-commutative82.6%
associate-*l/90.3%
associate-/l*90.3%
fma-define90.3%
/-rgt-identity90.3%
remove-double-neg90.3%
fma-neg90.3%
Simplified90.5%
Taylor expanded in x around 0 90.4%
associate-*l/90.5%
*-lft-identity90.5%
+-commutative90.5%
unpow290.5%
fma-undefine90.5%
Simplified90.5%
Taylor expanded in F around 0 70.9%
Taylor expanded in F around 0 63.1%
mul-1-neg63.1%
distribute-neg-frac263.1%
Simplified63.1%
distribute-frac-neg263.1%
neg-sub063.1%
*-commutative63.1%
associate-*l/63.0%
clear-num63.0%
associate-*l/63.2%
*-un-lft-identity63.2%
quot-tan63.2%
Applied egg-rr63.2%
neg-sub063.2%
distribute-neg-frac63.2%
Simplified63.2%
Final simplification65.7%
(FPCore (F B x) :precision binary64 (/ (- x) (tan B)))
double code(double F, double B, double x) {
return -x / tan(B);
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / tan(b)
end function
public static double code(double F, double B, double x) {
return -x / Math.tan(B);
}
def code(F, B, x): return -x / math.tan(B)
function code(F, B, x) return Float64(Float64(-x) / tan(B)) end
function tmp = code(F, B, x) tmp = -x / tan(B); end
code[F_, B_, x_] := N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{\tan B}
\end{array}
Initial program 78.6%
distribute-lft-neg-in78.6%
+-commutative78.6%
associate-*l/86.3%
associate-/l*86.3%
fma-define86.3%
/-rgt-identity86.3%
remove-double-neg86.3%
fma-neg86.3%
Simplified86.5%
Taylor expanded in x around 0 86.5%
associate-*l/86.5%
*-lft-identity86.5%
+-commutative86.5%
unpow286.5%
fma-undefine86.5%
Simplified86.5%
Taylor expanded in F around 0 56.8%
Taylor expanded in F around 0 58.5%
mul-1-neg58.5%
distribute-neg-frac258.5%
Simplified58.5%
distribute-frac-neg258.5%
neg-sub058.5%
*-commutative58.5%
associate-*l/58.4%
clear-num58.4%
associate-*l/58.5%
*-un-lft-identity58.5%
quot-tan58.6%
Applied egg-rr58.6%
neg-sub058.6%
distribute-neg-frac58.6%
Simplified58.6%
Final simplification58.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- -1.0 x) B)))
(if (<= F -4.5e-52)
t_0
(if (<= F 2e+130)
(/ (- x) B)
(if (or (<= F 1.5e+161) (and (not (<= F 1.15e+206)) (<= F 3.2e+237)))
(/ (+ x 1.0) B)
t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 - x) / B;
double tmp;
if (F <= -4.5e-52) {
tmp = t_0;
} else if (F <= 2e+130) {
tmp = -x / B;
} else if ((F <= 1.5e+161) || (!(F <= 1.15e+206) && (F <= 3.2e+237))) {
tmp = (x + 1.0) / B;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) - x) / b
if (f <= (-4.5d-52)) then
tmp = t_0
else if (f <= 2d+130) then
tmp = -x / b
else if ((f <= 1.5d+161) .or. (.not. (f <= 1.15d+206)) .and. (f <= 3.2d+237)) then
tmp = (x + 1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 - x) / B;
double tmp;
if (F <= -4.5e-52) {
tmp = t_0;
} else if (F <= 2e+130) {
tmp = -x / B;
} else if ((F <= 1.5e+161) || (!(F <= 1.15e+206) && (F <= 3.2e+237))) {
tmp = (x + 1.0) / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 - x) / B tmp = 0 if F <= -4.5e-52: tmp = t_0 elif F <= 2e+130: tmp = -x / B elif (F <= 1.5e+161) or (not (F <= 1.15e+206) and (F <= 3.2e+237)): tmp = (x + 1.0) / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 - x) / B) tmp = 0.0 if (F <= -4.5e-52) tmp = t_0; elseif (F <= 2e+130) tmp = Float64(Float64(-x) / B); elseif ((F <= 1.5e+161) || (!(F <= 1.15e+206) && (F <= 3.2e+237))) tmp = Float64(Float64(x + 1.0) / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 - x) / B; tmp = 0.0; if (F <= -4.5e-52) tmp = t_0; elseif (F <= 2e+130) tmp = -x / B; elseif ((F <= 1.5e+161) || (~((F <= 1.15e+206)) && (F <= 3.2e+237))) tmp = (x + 1.0) / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -4.5e-52], t$95$0, If[LessEqual[F, 2e+130], N[((-x) / B), $MachinePrecision], If[Or[LessEqual[F, 1.5e+161], And[N[Not[LessEqual[F, 1.15e+206]], $MachinePrecision], LessEqual[F, 3.2e+237]]], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1 - x}{B}\\
\mathbf{if}\;F \leq -4.5 \cdot 10^{-52}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+130}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+161} \lor \neg \left(F \leq 1.15 \cdot 10^{+206}\right) \land F \leq 3.2 \cdot 10^{+237}:\\
\;\;\;\;\frac{x + 1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if F < -4.5e-52 or 1.50000000000000006e161 < F < 1.15000000000000008e206 or 3.20000000000000017e237 < F Initial program 62.8%
Taylor expanded in F around -inf 88.4%
Taylor expanded in B around 0 38.5%
mul-1-neg38.5%
distribute-neg-frac238.5%
Simplified38.5%
if -4.5e-52 < F < 2.0000000000000001e130Initial program 97.1%
Taylor expanded in F around -inf 35.2%
Taylor expanded in B around 0 13.0%
mul-1-neg13.0%
distribute-neg-frac213.0%
Simplified13.0%
Taylor expanded in x around inf 29.0%
associate-*r/29.0%
neg-mul-129.0%
Simplified29.0%
if 2.0000000000000001e130 < F < 1.50000000000000006e161 or 1.15000000000000008e206 < F < 3.20000000000000017e237Initial program 36.8%
Taylor expanded in F around -inf 24.1%
Taylor expanded in B around 0 1.3%
mul-1-neg1.3%
distribute-neg-frac21.3%
Simplified1.3%
*-un-lft-identity1.3%
add-sqr-sqrt0.8%
sqrt-unprod20.7%
sqr-neg20.7%
sqrt-unprod41.2%
add-sqr-sqrt55.5%
Applied egg-rr55.5%
*-lft-identity55.5%
Simplified55.5%
Final simplification34.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) B)))
(if (<= F -5.6e-52)
(/ (- -1.0 x) B)
(if (<= F 9e+131)
t_0
(if (<= F 1.5e+161)
(/ (+ x 1.0) B)
(- t_0 (* B (* x -0.3333333333333333))))))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (F <= -5.6e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 9e+131) {
tmp = t_0;
} else if (F <= 1.5e+161) {
tmp = (x + 1.0) / B;
} else {
tmp = t_0 - (B * (x * -0.3333333333333333));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -x / b
if (f <= (-5.6d-52)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9d+131) then
tmp = t_0
else if (f <= 1.5d+161) then
tmp = (x + 1.0d0) / b
else
tmp = t_0 - (b * (x * (-0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (F <= -5.6e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 9e+131) {
tmp = t_0;
} else if (F <= 1.5e+161) {
tmp = (x + 1.0) / B;
} else {
tmp = t_0 - (B * (x * -0.3333333333333333));
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if F <= -5.6e-52: tmp = (-1.0 - x) / B elif F <= 9e+131: tmp = t_0 elif F <= 1.5e+161: tmp = (x + 1.0) / B else: tmp = t_0 - (B * (x * -0.3333333333333333)) return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (F <= -5.6e-52) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9e+131) tmp = t_0; elseif (F <= 1.5e+161) tmp = Float64(Float64(x + 1.0) / B); else tmp = Float64(t_0 - Float64(B * Float64(x * -0.3333333333333333))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / B; tmp = 0.0; if (F <= -5.6e-52) tmp = (-1.0 - x) / B; elseif (F <= 9e+131) tmp = t_0; elseif (F <= 1.5e+161) tmp = (x + 1.0) / B; else tmp = t_0 - (B * (x * -0.3333333333333333)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[F, -5.6e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9e+131], t$95$0, If[LessEqual[F, 1.5e+161], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision], N[(t$95$0 - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;F \leq -5.6 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{+131}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+161}:\\
\;\;\;\;\frac{x + 1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 - B \cdot \left(x \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if F < -5.59999999999999989e-52Initial program 71.8%
Taylor expanded in F around -inf 95.0%
Taylor expanded in B around 0 38.6%
mul-1-neg38.6%
distribute-neg-frac238.6%
Simplified38.6%
if -5.59999999999999989e-52 < F < 9.00000000000000039e131Initial program 97.1%
Taylor expanded in F around -inf 35.2%
Taylor expanded in B around 0 13.0%
mul-1-neg13.0%
distribute-neg-frac213.0%
Simplified13.0%
Taylor expanded in x around inf 29.0%
associate-*r/29.0%
neg-mul-129.0%
Simplified29.0%
if 9.00000000000000039e131 < F < 1.50000000000000006e161Initial program 57.0%
Taylor expanded in F around -inf 33.6%
Taylor expanded in B around 0 1.2%
mul-1-neg1.2%
distribute-neg-frac21.2%
Simplified1.2%
*-un-lft-identity1.2%
add-sqr-sqrt0.8%
sqrt-unprod14.5%
sqr-neg14.5%
sqrt-unprod44.3%
add-sqr-sqrt57.7%
Applied egg-rr57.7%
*-lft-identity57.7%
Simplified57.7%
if 1.50000000000000006e161 < F Initial program 30.9%
distribute-lft-neg-in30.9%
+-commutative30.9%
associate-*l/56.9%
associate-/l*56.9%
fma-define56.9%
/-rgt-identity56.9%
remove-double-neg56.9%
fma-neg56.9%
Simplified57.0%
Taylor expanded in x around 0 57.0%
associate-*l/57.0%
*-lft-identity57.0%
+-commutative57.0%
unpow257.0%
fma-undefine57.0%
Simplified57.0%
Taylor expanded in F around 0 20.7%
Taylor expanded in F around 0 56.9%
mul-1-neg56.9%
distribute-neg-frac256.9%
Simplified56.9%
Taylor expanded in B around 0 31.4%
distribute-lft-out31.4%
distribute-rgt-out--31.4%
metadata-eval31.4%
Simplified31.4%
Final simplification33.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2.15e-52)
(/ (- -1.0 x) B)
(if (<= F 1.8e+131)
(/ (- x) B)
(if (<= F 1.42e+161)
(/ (+ x 1.0) B)
(* x (- (/ -1.0 B) (* B -0.3333333333333333)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.15e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.8e+131) {
tmp = -x / B;
} else if (F <= 1.42e+161) {
tmp = (x + 1.0) / B;
} else {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.15d-52)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.8d+131) then
tmp = -x / b
else if (f <= 1.42d+161) then
tmp = (x + 1.0d0) / b
else
tmp = x * (((-1.0d0) / b) - (b * (-0.3333333333333333d0)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.15e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.8e+131) {
tmp = -x / B;
} else if (F <= 1.42e+161) {
tmp = (x + 1.0) / B;
} else {
tmp = x * ((-1.0 / B) - (B * -0.3333333333333333));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.15e-52: tmp = (-1.0 - x) / B elif F <= 1.8e+131: tmp = -x / B elif F <= 1.42e+161: tmp = (x + 1.0) / B else: tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.15e-52) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.8e+131) tmp = Float64(Float64(-x) / B); elseif (F <= 1.42e+161) tmp = Float64(Float64(x + 1.0) / B); else tmp = Float64(x * Float64(Float64(-1.0 / B) - Float64(B * -0.3333333333333333))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.15e-52) tmp = (-1.0 - x) / B; elseif (F <= 1.8e+131) tmp = -x / B; elseif (F <= 1.42e+161) tmp = (x + 1.0) / B; else tmp = x * ((-1.0 / B) - (B * -0.3333333333333333)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.15e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.8e+131], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 1.42e+161], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision], N[(x * N[(N[(-1.0 / B), $MachinePrecision] - N[(B * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.15 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+131}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{+161}:\\
\;\;\;\;\frac{x + 1}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\frac{-1}{B} - B \cdot -0.3333333333333333\right)\\
\end{array}
\end{array}
if F < -2.1500000000000002e-52Initial program 71.8%
Taylor expanded in F around -inf 95.0%
Taylor expanded in B around 0 38.6%
mul-1-neg38.6%
distribute-neg-frac238.6%
Simplified38.6%
if -2.1500000000000002e-52 < F < 1.80000000000000016e131Initial program 97.1%
Taylor expanded in F around -inf 35.2%
Taylor expanded in B around 0 13.0%
mul-1-neg13.0%
distribute-neg-frac213.0%
Simplified13.0%
Taylor expanded in x around inf 29.0%
associate-*r/29.0%
neg-mul-129.0%
Simplified29.0%
if 1.80000000000000016e131 < F < 1.42000000000000009e161Initial program 57.0%
Taylor expanded in F around -inf 33.6%
Taylor expanded in B around 0 1.2%
mul-1-neg1.2%
distribute-neg-frac21.2%
Simplified1.2%
*-un-lft-identity1.2%
add-sqr-sqrt0.8%
sqrt-unprod14.5%
sqr-neg14.5%
sqrt-unprod44.3%
add-sqr-sqrt57.7%
Applied egg-rr57.7%
*-lft-identity57.7%
Simplified57.7%
if 1.42000000000000009e161 < F Initial program 30.9%
Taylor expanded in F around -inf 56.1%
Taylor expanded in x around inf 56.9%
mul-1-neg56.9%
associate-*r/57.0%
*-commutative57.0%
distribute-rgt-neg-in57.0%
Simplified57.0%
Taylor expanded in B around 0 31.3%
Final simplification33.4%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.6e-143) (not (<= x 9.5e-167))) (/ (- x) B) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.6e-143) || !(x <= 9.5e-167)) {
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 ((x <= (-2.6d-143)) .or. (.not. (x <= 9.5d-167))) 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 ((x <= -2.6e-143) || !(x <= 9.5e-167)) {
tmp = -x / B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.6e-143) or not (x <= 9.5e-167): tmp = -x / B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.6e-143) || !(x <= 9.5e-167)) 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 ((x <= -2.6e-143) || ~((x <= 9.5e-167))) tmp = -x / B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.6e-143], N[Not[LessEqual[x, 9.5e-167]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-143} \lor \neg \left(x \leq 9.5 \cdot 10^{-167}\right):\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -2.59999999999999987e-143 or 9.49999999999999955e-167 < x Initial program 80.4%
Taylor expanded in F around -inf 65.1%
Taylor expanded in B around 0 24.4%
mul-1-neg24.4%
distribute-neg-frac224.4%
Simplified24.4%
Taylor expanded in x around inf 32.1%
associate-*r/32.1%
neg-mul-132.1%
Simplified32.1%
if -2.59999999999999987e-143 < x < 9.49999999999999955e-167Initial program 73.1%
Taylor expanded in F around -inf 31.8%
Taylor expanded in B around 0 18.6%
mul-1-neg18.6%
distribute-neg-frac218.6%
Simplified18.6%
Taylor expanded in x around 0 18.6%
Final simplification28.8%
(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 78.6%
Taylor expanded in F around -inf 56.9%
Taylor expanded in B around 0 23.0%
mul-1-neg23.0%
distribute-neg-frac223.0%
Simplified23.0%
Taylor expanded in x around 0 8.8%
Final simplification8.8%
herbie shell --seed 2024040
(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))))))