
(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 -2e+27)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 10000.0)
(- (/ (/ F (sqrt (fma F F 2.0))) (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 <= -2e+27) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 10000.0) {
tmp = ((F / sqrt(fma(F, F, 2.0))) / 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 <= -2e+27) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 10000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / 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, -2e+27], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 10000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $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 -2 \cdot 10^{+27}:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 10000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{-1}{{F}^{2}}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2e27Initial program 60.9%
Simplified71.5%
Taylor expanded in x around 0 71.5%
associate-*l/71.5%
*-lft-identity71.5%
+-commutative71.5%
unpow271.5%
fma-undefine71.5%
Simplified71.5%
Taylor expanded in F around -inf 99.9%
tan-quot99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in B around inf 99.9%
distribute-lft-in99.9%
mul-1-neg99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
div-sub99.9%
Simplified99.9%
if -2e27 < F < 1e4Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
associate-*r/99.6%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.7%
Applied egg-rr99.7%
if 1e4 < F Initial program 53.5%
Simplified74.6%
Taylor expanded in x around 0 74.6%
associate-*l/74.6%
*-lft-identity74.6%
+-commutative74.6%
unpow274.6%
fma-undefine74.6%
Simplified74.6%
associate-*r/74.5%
sqrt-div74.5%
metadata-eval74.5%
un-div-inv74.6%
Applied egg-rr74.6%
Taylor expanded in F around inf 99.8%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -21000000000000.0)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 60000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ (+ 1.0 (/ -1.0 (pow F 2.0))) (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -21000000000000.0) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 60000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = ((1.0 + (-1.0 / pow(F, 2.0))) / sin(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 <= (-21000000000000.0d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 60000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = ((1.0d0 + ((-1.0d0) / (f ** 2.0d0))) / sin(b)) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -21000000000000.0) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 60000.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 + (-1.0 / Math.pow(F, 2.0))) / Math.sin(B)) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -21000000000000.0: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 60000.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 + (-1.0 / math.pow(F, 2.0))) / math.sin(B)) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -21000000000000.0) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 60000.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(Float64(1.0 + Float64(-1.0 / (F ^ 2.0))) / sin(B)) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -21000000000000.0) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 60000.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = ((1.0 + (-1.0 / (F ^ 2.0))) / sin(B)) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -21000000000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 60000.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[(N[(1.0 + N[(-1.0 / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -21000000000000:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 60000:\\
\;\;\;\;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 + \frac{-1}{{F}^{2}}}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -2.1e13Initial program 62.6%
Simplified72.7%
Taylor expanded in x around 0 72.7%
associate-*l/72.8%
*-lft-identity72.8%
+-commutative72.8%
unpow272.8%
fma-undefine72.8%
Simplified72.8%
Taylor expanded in F around -inf 99.9%
tan-quot99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in B around inf 99.9%
distribute-lft-in99.9%
mul-1-neg99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
div-sub99.9%
Simplified99.9%
if -2.1e13 < F < 6e4Initial program 99.4%
if 6e4 < F Initial program 53.5%
Simplified74.6%
Taylor expanded in x around 0 74.6%
associate-*l/74.6%
*-lft-identity74.6%
+-commutative74.6%
unpow274.6%
fma-undefine74.6%
Simplified74.6%
associate-*r/74.5%
sqrt-div74.5%
metadata-eval74.5%
un-div-inv74.6%
Applied egg-rr74.6%
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.55)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 1.45)
(- (/ (/ F (sqrt 2.0)) (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.55) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 1.45) {
tmp = ((F / sqrt(2.0)) / 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.55d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 1.45d0) then
tmp = ((f / sqrt(2.0d0)) / 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.55) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 1.45) {
tmp = ((F / Math.sqrt(2.0)) / 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.55: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 1.45: tmp = ((F / math.sqrt(2.0)) / 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.55) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 1.45) tmp = Float64(Float64(Float64(F / sqrt(2.0)) / 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.55) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 1.45) tmp = ((F / sqrt(2.0)) / 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.55], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(N[(F / N[Sqrt[2.0], $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.55:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \frac{-1}{{F}^{2}}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.55000000000000004Initial program 63.6%
Simplified73.5%
Taylor expanded in x around 0 73.5%
associate-*l/73.5%
*-lft-identity73.5%
+-commutative73.5%
unpow273.5%
fma-undefine73.5%
Simplified73.5%
Taylor expanded in F around -inf 99.9%
tan-quot99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in B around inf 99.9%
distribute-lft-in99.9%
mul-1-neg99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
div-sub99.9%
Simplified99.9%
if -1.55000000000000004 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
associate-*r/99.6%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 98.5%
if 1.44999999999999996 < F Initial program 54.8%
Simplified75.3%
Taylor expanded in x around 0 75.3%
associate-*l/75.3%
*-lft-identity75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
associate-*r/75.2%
sqrt-div75.2%
metadata-eval75.2%
un-div-inv75.3%
Applied egg-rr75.3%
Taylor expanded in F around inf 99.6%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.55)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 1.45)
(- (* 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.55) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 1.45) {
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.55d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 1.45d0) 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.55) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 1.45) {
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.55: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 1.45: 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.55) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 1.45) 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.55) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 1.45) 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.55], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45], 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.55:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;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.55000000000000004Initial program 63.6%
Simplified73.5%
Taylor expanded in x around 0 73.5%
associate-*l/73.5%
*-lft-identity73.5%
+-commutative73.5%
unpow273.5%
fma-undefine73.5%
Simplified73.5%
Taylor expanded in F around -inf 99.9%
tan-quot99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in B around inf 99.9%
distribute-lft-in99.9%
mul-1-neg99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
div-sub99.9%
Simplified99.9%
if -1.55000000000000004 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.4%
if 1.44999999999999996 < F Initial program 54.8%
Simplified75.3%
Taylor expanded in x around 0 75.3%
associate-*l/75.3%
*-lft-identity75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
Taylor expanded in F around inf 98.6%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.5)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 1.45)
(- (/ (* 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.5) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 1.45) {
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.5d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 1.45d0) 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.5) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 1.45) {
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.5: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 1.45: 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.5) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 1.45) 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.5) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 1.45) 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.5], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45], 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.5:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\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.5Initial program 63.6%
Simplified73.5%
Taylor expanded in x around 0 73.5%
associate-*l/73.5%
*-lft-identity73.5%
+-commutative73.5%
unpow273.5%
fma-undefine73.5%
Simplified73.5%
Taylor expanded in F around -inf 99.9%
tan-quot99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in B around inf 99.9%
distribute-lft-in99.9%
mul-1-neg99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
div-sub99.9%
Simplified99.9%
if -1.5 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.4%
*-commutative98.4%
Simplified98.4%
if 1.44999999999999996 < F Initial program 54.8%
Simplified75.3%
Taylor expanded in x around 0 75.3%
associate-*l/75.3%
*-lft-identity75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
Taylor expanded in F around inf 98.6%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.35)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 1.45)
(- (/ (/ F (sqrt 2.0)) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.35) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 1.45) {
tmp = ((F / sqrt(2.0)) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.35d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 1.45d0) then
tmp = ((f / sqrt(2.0d0)) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.35) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 1.45) {
tmp = ((F / Math.sqrt(2.0)) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.35: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 1.45: tmp = ((F / math.sqrt(2.0)) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.35) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 1.45) tmp = Float64(Float64(Float64(F / sqrt(2.0)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.35) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 1.45) tmp = ((F / sqrt(2.0)) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(N[(F / N[Sqrt[2.0], $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.35:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3500000000000001Initial program 63.6%
Simplified73.5%
Taylor expanded in x around 0 73.5%
associate-*l/73.5%
*-lft-identity73.5%
+-commutative73.5%
unpow273.5%
fma-undefine73.5%
Simplified73.5%
Taylor expanded in F around -inf 99.9%
tan-quot99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in B around inf 99.9%
distribute-lft-in99.9%
mul-1-neg99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
div-sub99.9%
Simplified99.9%
if -1.3500000000000001 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
associate-*r/99.6%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 98.5%
if 1.44999999999999996 < F Initial program 54.8%
Simplified75.3%
Taylor expanded in x around 0 75.3%
associate-*l/75.3%
*-lft-identity75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
Taylor expanded in F around inf 98.6%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -21000000000000.0)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F -1.7e-102)
t_0
(if (<= F 1.6e-98)
(- (* F (/ (sqrt 0.5) B)) t_1)
(if (<= F 430000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -21000000000000.0) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= -1.7e-102) {
tmp = t_0;
} else if (F <= 1.6e-98) {
tmp = (F * (sqrt(0.5) / B)) - t_1;
} else if (F <= 430000.0) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-21000000000000.0d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= (-1.7d-102)) then
tmp = t_0
else if (f <= 1.6d-98) then
tmp = (f * (sqrt(0.5d0) / b)) - t_1
else if (f <= 430000.0d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -21000000000000.0) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= -1.7e-102) {
tmp = t_0;
} else if (F <= 1.6e-98) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_1;
} else if (F <= 430000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -21000000000000.0: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= -1.7e-102: tmp = t_0 elif F <= 1.6e-98: tmp = (F * (math.sqrt(0.5) / B)) - t_1 elif F <= 430000.0: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -21000000000000.0) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= -1.7e-102) tmp = t_0; elseif (F <= 1.6e-98) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_1); elseif (F <= 430000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -21000000000000.0) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= -1.7e-102) tmp = t_0; elseif (F <= 1.6e-98) tmp = (F * (sqrt(0.5) / B)) - t_1; elseif (F <= 430000.0) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(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] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -21000000000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.7e-102], t$95$0, If[LessEqual[F, 1.6e-98], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 430000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -21000000000000:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq -1.7 \cdot 10^{-102}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-98}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_1\\
\mathbf{elif}\;F \leq 430000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -2.1e13Initial program 62.6%
Simplified72.7%
Taylor expanded in x around 0 72.7%
associate-*l/72.8%
*-lft-identity72.8%
+-commutative72.8%
unpow272.8%
fma-undefine72.8%
Simplified72.8%
Taylor expanded in F around -inf 99.9%
tan-quot99.9%
associate-/r/99.9%
Applied egg-rr99.9%
Taylor expanded in B around inf 99.9%
distribute-lft-in99.9%
mul-1-neg99.9%
sub-neg99.9%
associate-*r/99.9%
metadata-eval99.9%
div-sub99.9%
Simplified99.9%
if -2.1e13 < F < -1.70000000000000006e-102 or 1.6e-98 < F < 4.3e5Initial program 99.5%
Taylor expanded in B around 0 90.2%
if -1.70000000000000006e-102 < F < 1.6e-98Initial program 99.3%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in B around 0 88.9%
+-commutative88.9%
unpow288.9%
fma-undefine88.9%
Simplified88.9%
Taylor expanded in F around 0 89.0%
associate-/l*89.0%
Simplified89.0%
if 4.3e5 < F Initial program 53.5%
Simplified74.6%
Taylor expanded in x around 0 74.6%
associate-*l/74.6%
*-lft-identity74.6%
+-commutative74.6%
unpow274.6%
fma-undefine74.6%
Simplified74.6%
Taylor expanded in F around inf 99.8%
Final simplification95.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(if (<= F -0.00335)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 2.8e-97)
(+ (/ -1.0 (/ (tan B) x)) (* t_0 (/ F B)))
(if (<= F 430000.0)
(- (* (/ F (sin B)) t_0) (/ x B))
(- (/ 1.0 (sin B)) (/ x (tan B))))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double tmp;
if (F <= -0.00335) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 2.8e-97) {
tmp = (-1.0 / (tan(B) / x)) + (t_0 * (F / B));
} else if (F <= 430000.0) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / sin(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 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
if (f <= (-0.00335d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 2.8d-97) then
tmp = ((-1.0d0) / (tan(b) / x)) + (t_0 * (f / b))
else if (f <= 430000.0d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else
tmp = (1.0d0 / sin(b)) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double tmp;
if (F <= -0.00335) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 2.8e-97) {
tmp = (-1.0 / (Math.tan(B) / x)) + (t_0 * (F / B));
} else if (F <= 430000.0) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) tmp = 0 if F <= -0.00335: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 2.8e-97: tmp = (-1.0 / (math.tan(B) / x)) + (t_0 * (F / B)) elif F <= 430000.0: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = (1.0 / math.sin(B)) - (x / math.tan(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 tmp = 0.0 if (F <= -0.00335) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 2.8e-97) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(t_0 * Float64(F / B))); elseif (F <= 430000.0) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; tmp = 0.0; if (F <= -0.00335) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 2.8e-97) tmp = (-1.0 / (tan(B) / x)) + (t_0 * (F / B)); elseif (F <= 430000.0) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = (1.0 / sin(B)) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, If[LessEqual[F, -0.00335], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-97], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 430000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{if}\;F \leq -0.00335:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-97}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + t\_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 430000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.00335000000000000011Initial program 64.6%
Simplified74.2%
Taylor expanded in x around 0 74.2%
associate-*l/74.2%
*-lft-identity74.2%
+-commutative74.2%
unpow274.2%
fma-undefine74.2%
Simplified74.2%
Taylor expanded in F around -inf 98.7%
tan-quot98.8%
associate-/r/98.7%
Applied egg-rr98.7%
Taylor expanded in B around inf 98.8%
distribute-lft-in98.8%
mul-1-neg98.8%
sub-neg98.8%
associate-*r/98.8%
metadata-eval98.8%
div-sub98.8%
Simplified98.8%
if -0.00335000000000000011 < F < 2.8000000000000002e-97Initial program 99.4%
div-inv99.6%
clear-num99.4%
Applied egg-rr99.4%
Taylor expanded in B around 0 85.1%
if 2.8000000000000002e-97 < F < 4.3e5Initial program 99.6%
Taylor expanded in B around 0 91.4%
if 4.3e5 < F Initial program 53.5%
Simplified74.6%
Taylor expanded in x around 0 74.6%
associate-*l/74.6%
*-lft-identity74.6%
+-commutative74.6%
unpow274.6%
fma-undefine74.6%
Simplified74.6%
Taylor expanded in F around inf 99.8%
Final simplification93.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5e+194)
(- (* F (/ -1.0 (* F B))) t_0)
(if (<= F -3.8e-13)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 9e-16) (/ (* x (cos B)) (- (sin B))) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5e+194) {
tmp = (F * (-1.0 / (F * B))) - t_0;
} else if (F <= -3.8e-13) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 9e-16) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5d+194)) then
tmp = (f * ((-1.0d0) / (f * b))) - t_0
else if (f <= (-3.8d-13)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 9d-16) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5e+194) {
tmp = (F * (-1.0 / (F * B))) - t_0;
} else if (F <= -3.8e-13) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 9e-16) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5e+194: tmp = (F * (-1.0 / (F * B))) - t_0 elif F <= -3.8e-13: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 9e-16: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+194) tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0); elseif (F <= -3.8e-13) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 9e-16) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5e+194) tmp = (F * (-1.0 / (F * B))) - t_0; elseif (F <= -3.8e-13) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 9e-16) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+194], N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.8e-13], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-16], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+194}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot B} - t\_0\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-16}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -4.99999999999999989e194Initial program 45.8%
Simplified58.8%
Taylor expanded in x around 0 58.8%
associate-*l/58.8%
*-lft-identity58.8%
+-commutative58.8%
unpow258.8%
fma-undefine58.8%
Simplified58.8%
Taylor expanded in B around 0 58.8%
+-commutative58.8%
unpow258.8%
fma-undefine58.8%
Simplified58.8%
Taylor expanded in F around -inf 73.0%
*-commutative73.0%
Simplified73.0%
if -4.99999999999999989e194 < F < -3.8e-13Initial program 80.2%
Taylor expanded in F around -inf 92.1%
Taylor expanded in B around 0 79.6%
if -3.8e-13 < F < 9.0000000000000003e-16Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around -inf 38.8%
Taylor expanded in x around inf 63.3%
mul-1-neg63.3%
Simplified63.3%
if 9.0000000000000003e-16 < F Initial program 56.6%
Simplified76.2%
Taylor expanded in x around 0 76.3%
associate-*l/76.3%
*-lft-identity76.3%
+-commutative76.3%
unpow276.3%
fma-undefine76.3%
Simplified76.3%
Taylor expanded in B around 0 65.9%
+-commutative65.9%
unpow265.9%
fma-undefine65.9%
Simplified65.9%
Taylor expanded in F around inf 80.7%
Final simplification72.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.11)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 0.17) (- (* 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.11) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 0.17) {
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.11d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 0.17d0) 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.11) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 0.17) {
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.11: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 0.17: 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.11) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 0.17) 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.11) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 0.17) 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.11], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.17], 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.11:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 0.17:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.110000000000000001Initial program 64.1%
Simplified73.8%
Taylor expanded in x around 0 73.8%
associate-*l/73.9%
*-lft-identity73.9%
+-commutative73.9%
unpow273.9%
fma-undefine73.9%
Simplified73.9%
Taylor expanded in F around -inf 98.7%
tan-quot98.7%
associate-/r/98.7%
Applied egg-rr98.7%
Taylor expanded in B around inf 98.7%
distribute-lft-in98.7%
mul-1-neg98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
div-sub98.7%
Simplified98.7%
if -0.110000000000000001 < F < 0.170000000000000012Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in B around 0 82.1%
+-commutative82.1%
unpow282.1%
fma-undefine82.1%
Simplified82.1%
Taylor expanded in F around 0 81.6%
associate-/l*81.6%
Simplified81.6%
if 0.170000000000000012 < F Initial program 54.8%
Simplified75.3%
Taylor expanded in x around 0 75.3%
associate-*l/75.3%
*-lft-identity75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
Taylor expanded in F around inf 98.6%
Final simplification91.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.06)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 0.019)
(- (/ (* 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.06) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 0.019) {
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.06d0)) then
tmp = ((-1.0d0) - (x * cos(b))) / sin(b)
else if (f <= 0.019d0) 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.06) {
tmp = (-1.0 - (x * Math.cos(B))) / Math.sin(B);
} else if (F <= 0.019) {
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.06: tmp = (-1.0 - (x * math.cos(B))) / math.sin(B) elif F <= 0.019: 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.06) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 0.019) 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.06) tmp = (-1.0 - (x * cos(B))) / sin(B); elseif (F <= 0.019) 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.06], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.019], 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.06:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 0.019:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.059999999999999998Initial program 64.1%
Simplified73.8%
Taylor expanded in x around 0 73.8%
associate-*l/73.9%
*-lft-identity73.9%
+-commutative73.9%
unpow273.9%
fma-undefine73.9%
Simplified73.9%
Taylor expanded in F around -inf 98.7%
tan-quot98.7%
associate-/r/98.7%
Applied egg-rr98.7%
Taylor expanded in B around inf 98.7%
distribute-lft-in98.7%
mul-1-neg98.7%
sub-neg98.7%
associate-*r/98.7%
metadata-eval98.7%
div-sub98.7%
Simplified98.7%
if -0.059999999999999998 < F < 0.0189999999999999995Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in B around 0 82.1%
+-commutative82.1%
unpow282.1%
fma-undefine82.1%
Simplified82.1%
Taylor expanded in F around 0 81.6%
if 0.0189999999999999995 < F Initial program 54.8%
Simplified75.3%
Taylor expanded in x around 0 75.3%
associate-*l/75.3%
*-lft-identity75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
Taylor expanded in F around inf 98.6%
Final simplification91.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.3e-29)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.4e-31)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.3e-29) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.4e-31) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.3d-29)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.4d-31) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.3e-29) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.4e-31) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.3e-29: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.4e-31: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.3e-29) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.4e-31) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.3e-29) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.4e-31) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.3e-29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.4e-31], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-31}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3000000000000001e-29Initial program 66.8%
Simplified75.7%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around -inf 94.3%
if -1.3000000000000001e-29 < F < 3.4000000000000001e-31Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around -inf 39.4%
Taylor expanded in x around inf 65.6%
mul-1-neg65.6%
Simplified65.6%
if 3.4000000000000001e-31 < F Initial program 59.3%
Simplified77.7%
Taylor expanded in x around 0 77.7%
associate-*l/77.7%
*-lft-identity77.7%
+-commutative77.7%
unpow277.7%
fma-undefine77.7%
Simplified77.7%
Taylor expanded in F around inf 91.9%
Final simplification82.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e-29)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.15e-16) (/ (* x (cos B)) (- (sin B))) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e-29) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.15e-16) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1d-29)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.15d-16) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1e-29) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.15e-16) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1e-29: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.15e-16: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e-29) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.15e-16) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1e-29) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.15e-16) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e-29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.15e-16], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.15 \cdot 10^{-16}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -9.99999999999999943e-30Initial program 66.8%
Simplified75.7%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around -inf 94.3%
if -9.99999999999999943e-30 < F < 3.1499999999999999e-16Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around -inf 38.5%
Taylor expanded in x around inf 63.6%
mul-1-neg63.6%
Simplified63.6%
if 3.1499999999999999e-16 < F Initial program 56.6%
Simplified76.2%
Taylor expanded in x around 0 76.3%
associate-*l/76.3%
*-lft-identity76.3%
+-commutative76.3%
unpow276.3%
fma-undefine76.3%
Simplified76.3%
Taylor expanded in B around 0 65.9%
+-commutative65.9%
unpow265.9%
fma-undefine65.9%
Simplified65.9%
Taylor expanded in F around inf 80.7%
Final simplification78.0%
(FPCore (F B x) :precision binary64 (if (or (<= x -9.6e-56) (not (<= x 1.7e-263))) (- (/ 1.0 B) (/ x (tan B))) (/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -9.6e-56) || !(x <= 1.7e-263)) {
tmp = (1.0 / B) - (x / tan(B));
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-9.6d-56)) .or. (.not. (x <= 1.7d-263))) then
tmp = (1.0d0 / b) - (x / tan(b))
else
tmp = (-1.0d0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -9.6e-56) || !(x <= 1.7e-263)) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = -1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -9.6e-56) or not (x <= 1.7e-263): tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = -1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -9.6e-56) || !(x <= 1.7e-263)) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(-1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -9.6e-56) || ~((x <= 1.7e-263))) tmp = (1.0 / B) - (x / tan(B)); else tmp = -1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -9.6e-56], N[Not[LessEqual[x, 1.7e-263]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.6 \cdot 10^{-56} \lor \neg \left(x \leq 1.7 \cdot 10^{-263}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if x < -9.60000000000000002e-56 or 1.70000000000000002e-263 < x Initial program 76.9%
Simplified88.6%
Taylor expanded in x around 0 88.5%
associate-*l/88.6%
*-lft-identity88.6%
+-commutative88.6%
unpow288.6%
fma-undefine88.6%
Simplified88.6%
Taylor expanded in B around 0 79.9%
+-commutative79.9%
unpow279.9%
fma-undefine79.9%
Simplified79.9%
Taylor expanded in F around inf 74.4%
if -9.60000000000000002e-56 < x < 1.70000000000000002e-263Initial program 77.1%
Simplified77.4%
Taylor expanded in x around 0 77.4%
associate-*l/77.4%
*-lft-identity77.4%
+-commutative77.4%
unpow277.4%
fma-undefine77.4%
Simplified77.4%
Taylor expanded in F around -inf 31.9%
tan-quot31.9%
associate-/r/31.9%
Applied egg-rr31.9%
Taylor expanded in x around 0 31.9%
Final simplification62.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5.7e+194)
(- (* F (/ -1.0 (* F B))) t_0)
(if (<= F -3.8e-13) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.7e+194) {
tmp = (F * (-1.0 / (F * B))) - t_0;
} else if (F <= -3.8e-13) {
tmp = (-1.0 / sin(B)) - (x / 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 <= (-5.7d+194)) then
tmp = (f * ((-1.0d0) / (f * b))) - t_0
else if (f <= (-3.8d-13)) then
tmp = ((-1.0d0) / sin(b)) - (x / 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 <= -5.7e+194) {
tmp = (F * (-1.0 / (F * B))) - t_0;
} else if (F <= -3.8e-13) {
tmp = (-1.0 / Math.sin(B)) - (x / 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 <= -5.7e+194: tmp = (F * (-1.0 / (F * B))) - t_0 elif F <= -3.8e-13: tmp = (-1.0 / math.sin(B)) - (x / 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 <= -5.7e+194) tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * B))) - t_0); elseif (F <= -3.8e-13) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / 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 <= -5.7e+194) tmp = (F * (-1.0 / (F * B))) - t_0; elseif (F <= -3.8e-13) tmp = (-1.0 / sin(B)) - (x / 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, -5.7e+194], N[(N[(F * N[(-1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.8e-13], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / 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 -5.7 \cdot 10^{+194}:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot B} - t\_0\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -5.69999999999999983e194Initial program 45.8%
Simplified58.8%
Taylor expanded in x around 0 58.8%
associate-*l/58.8%
*-lft-identity58.8%
+-commutative58.8%
unpow258.8%
fma-undefine58.8%
Simplified58.8%
Taylor expanded in B around 0 58.8%
+-commutative58.8%
unpow258.8%
fma-undefine58.8%
Simplified58.8%
Taylor expanded in F around -inf 73.0%
*-commutative73.0%
Simplified73.0%
if -5.69999999999999983e194 < F < -3.8e-13Initial program 80.2%
Taylor expanded in F around -inf 92.1%
Taylor expanded in B around 0 79.6%
if -3.8e-13 < F Initial program 81.7%
Simplified89.9%
Taylor expanded in x around 0 89.9%
associate-*l/90.0%
*-lft-identity90.0%
+-commutative90.0%
unpow290.0%
fma-undefine90.0%
Simplified90.0%
Taylor expanded in B around 0 75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
Taylor expanded in F around inf 61.4%
Final simplification66.0%
(FPCore (F B x) :precision binary64 (if (<= F -3.8e-13) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e-13) {
tmp = (-1.0 / sin(B)) - (x / 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 <= (-3.8d-13)) then
tmp = ((-1.0d0) / sin(b)) - (x / 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 <= -3.8e-13) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.8e-13: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.8e-13) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / 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 <= -3.8e-13) tmp = (-1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.8e-13], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / 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 -3.8 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -3.8e-13Initial program 65.9%
Taylor expanded in F around -inf 95.3%
Taylor expanded in B around 0 69.2%
if -3.8e-13 < F Initial program 81.7%
Simplified89.9%
Taylor expanded in x around 0 89.9%
associate-*l/90.0%
*-lft-identity90.0%
+-commutative90.0%
unpow290.0%
fma-undefine90.0%
Simplified90.0%
Taylor expanded in B around 0 75.3%
+-commutative75.3%
unpow275.3%
fma-undefine75.3%
Simplified75.3%
Taylor expanded in F around inf 61.4%
Final simplification63.7%
(FPCore (F B x) :precision binary64 (if (<= B 2.7e-5) (/ (- 1.0 x) B) (/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.7e-5) {
tmp = (1.0 - x) / B;
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 2.7d-5) then
tmp = (1.0d0 - x) / b
else
tmp = (-1.0d0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 2.7e-5) {
tmp = (1.0 - x) / B;
} else {
tmp = -1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 2.7e-5: tmp = (1.0 - x) / B else: tmp = -1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 2.7e-5) tmp = Float64(Float64(1.0 - x) / B); else tmp = Float64(-1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 2.7e-5) tmp = (1.0 - x) / B; else tmp = -1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 2.7e-5], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if B < 2.6999999999999999e-5Initial program 74.5%
Simplified85.8%
Taylor expanded in x around 0 85.8%
associate-*l/85.8%
*-lft-identity85.8%
+-commutative85.8%
unpow285.8%
fma-undefine85.8%
Simplified85.8%
Taylor expanded in B around 0 76.4%
+-commutative76.4%
unpow276.4%
fma-undefine76.4%
Simplified76.4%
Taylor expanded in F around inf 59.7%
Taylor expanded in B around 0 43.6%
if 2.6999999999999999e-5 < B Initial program 84.3%
Simplified84.5%
Taylor expanded in x around 0 84.6%
associate-*l/84.5%
*-lft-identity84.5%
+-commutative84.5%
unpow284.5%
fma-undefine84.5%
Simplified84.5%
Taylor expanded in F around -inf 65.7%
tan-quot65.7%
associate-/r/65.6%
Applied egg-rr65.6%
Taylor expanded in x around 0 22.9%
Final simplification38.3%
(FPCore (F B x) :precision binary64 (if (<= F -2.9e-286) (/ (- -1.0 x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.9e-286) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.9d-286)) then
tmp = ((-1.0d0) - x) / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.9e-286) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.9e-286: tmp = (-1.0 - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.9e-286) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.9e-286) tmp = (-1.0 - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.9e-286], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.9 \cdot 10^{-286}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.8999999999999998e-286Initial program 78.8%
Taylor expanded in F around -inf 75.8%
Taylor expanded in B around 0 33.1%
associate-*r/33.1%
neg-mul-133.1%
Simplified33.1%
if -2.8999999999999998e-286 < F Initial program 75.3%
Simplified86.4%
Taylor expanded in x around 0 86.4%
associate-*l/86.4%
*-lft-identity86.4%
+-commutative86.4%
unpow286.4%
fma-undefine86.4%
Simplified86.4%
Taylor expanded in B around 0 72.0%
+-commutative72.0%
unpow272.0%
fma-undefine72.0%
Simplified72.0%
Taylor expanded in F around inf 64.6%
Taylor expanded in B around 0 43.1%
Final simplification38.3%
(FPCore (F B x) :precision binary64 (/ (- 1.0 x) B))
double code(double F, double B, double x) {
return (1.0 - x) / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (1.0d0 - x) / b
end function
public static double code(double F, double B, double x) {
return (1.0 - x) / B;
}
def code(F, B, x): return (1.0 - x) / B
function code(F, B, x) return Float64(Float64(1.0 - x) / B) end
function tmp = code(F, B, x) tmp = (1.0 - x) / B; end
code[F_, B_, x_] := N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 - x}{B}
\end{array}
Initial program 77.0%
Simplified85.5%
Taylor expanded in x around 0 85.5%
associate-*l/85.5%
*-lft-identity85.5%
+-commutative85.5%
unpow285.5%
fma-undefine85.5%
Simplified85.5%
Taylor expanded in B around 0 70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around inf 57.6%
Taylor expanded in B around 0 33.5%
Final simplification33.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 77.0%
Simplified85.5%
Taylor expanded in x around 0 85.5%
associate-*l/85.5%
*-lft-identity85.5%
+-commutative85.5%
unpow285.5%
fma-undefine85.5%
Simplified85.5%
Taylor expanded in B around 0 70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around inf 57.6%
Taylor expanded in x around 0 10.8%
Final simplification10.8%
herbie shell --seed 2024131
(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))))))