
(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 23 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
(if (<= F -660000.0)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 2e+40)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) (/ x (tan B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -660000.0) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 2e+40) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - (x / tan(B));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -660000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 2e+40) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -660000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+40], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -660000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+40}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -6.6e5Initial program 64.0%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -6.6e5 < F < 2.00000000000000006e40Initial program 99.5%
Simplified99.6%
if 2.00000000000000006e40 < F Initial program 56.6%
Simplified73.2%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
div-sub99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -5.5e+79)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 1e+39)
(- (/ F (* (sin B) (sqrt (fma F F 2.0)))) (/ x (tan B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.5e+79) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 1e+39) {
tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - (x / tan(B));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.5e+79) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 1e+39) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.5e+79], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+39], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{+79}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+39}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -5.50000000000000007e79Initial program 51.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.9%
Applied egg-rr99.9%
if -5.50000000000000007e79 < F < 9.9999999999999994e38Initial program 99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
expm1-log1p-u85.0%
expm1-udef67.5%
associate-*r/67.5%
sqrt-div67.5%
metadata-eval67.5%
un-div-inv67.5%
Applied egg-rr67.5%
expm1-def84.9%
expm1-log1p99.5%
associate-/l/99.6%
Simplified99.6%
if 9.9999999999999994e38 < F Initial program 56.6%
Simplified73.2%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
div-sub99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -7.6e+75)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 6.2e+28)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.6e+75) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 6.2e+28) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 - (x * cos(B))) / 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 (f <= (-7.6d+75)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 6.2d+28) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.6e+75) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 6.2e+28) {
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 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.6e+75: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 6.2e+28: 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 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.6e+75) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 6.2e+28) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.6e+75) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 6.2e+28) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.6e+75], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e+28], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.6 \cdot 10^{+75}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{+28}:\\
\;\;\;\;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 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -7.6000000000000005e75Initial program 51.8%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.9%
Applied egg-rr99.9%
if -7.6000000000000005e75 < F < 6.2000000000000001e28Initial program 99.6%
if 6.2000000000000001e28 < F Initial program 58.6%
Simplified74.5%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
div-sub99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -420000.0)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 1.7e-6)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -420000.0) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 1.7e-6) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - 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 <= (-420000.0d0)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 1.7d-6) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - 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 <= -420000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 1.7e-6) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -420000.0: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 1.7e-6: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -420000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 1.7e-6) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -420000.0) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 1.7e-6) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (F / (sin(B) * (F + (1.0 / F)))) - 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, -420000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-6], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -420000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-6}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_0\\
\end{array}
\end{array}
if F < -4.2e5Initial program 64.0%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -4.2e5 < F < 1.70000000000000003e-6Initial program 99.5%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
if 1.70000000000000003e-6 < F Initial program 62.7%
Simplified77.0%
Taylor expanded in x around 0 76.8%
associate-*l/76.9%
*-lft-identity76.9%
+-commutative76.9%
unpow276.9%
fma-udef76.9%
Simplified76.9%
expm1-log1p-u60.7%
expm1-udef60.6%
associate-*r/60.7%
sqrt-div60.7%
metadata-eval60.7%
un-div-inv60.7%
Applied egg-rr60.7%
expm1-def60.7%
expm1-log1p76.9%
associate-/l/76.9%
Simplified76.9%
Taylor expanded in F around inf 99.1%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -420000.0)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 1.7e-6)
(- (/ F (* (sin B) (sqrt 2.0))) t_0)
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -420000.0) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 1.7e-6) {
tmp = (F / (sin(B) * sqrt(2.0))) - t_0;
} else {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - 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 <= (-420000.0d0)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 1.7d-6) then
tmp = (f / (sin(b) * sqrt(2.0d0))) - t_0
else
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - 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 <= -420000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 1.7e-6) {
tmp = (F / (Math.sin(B) * Math.sqrt(2.0))) - t_0;
} else {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -420000.0: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 1.7e-6: tmp = (F / (math.sin(B) * math.sqrt(2.0))) - t_0 else: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -420000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 1.7e-6) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(2.0))) - t_0); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -420000.0) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 1.7e-6) tmp = (F / (sin(B) * sqrt(2.0))) - t_0; else tmp = (F / (sin(B) * (F + (1.0 / F)))) - 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, -420000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-6], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -420000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-6}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_0\\
\end{array}
\end{array}
if F < -4.2e5Initial program 64.0%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -4.2e5 < F < 1.70000000000000003e-6Initial program 99.5%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
expm1-log1p-u92.0%
expm1-udef70.8%
associate-*r/70.8%
sqrt-div70.8%
metadata-eval70.8%
un-div-inv70.8%
Applied egg-rr70.8%
expm1-def91.9%
expm1-log1p99.6%
associate-/l/99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
if 1.70000000000000003e-6 < F Initial program 62.7%
Simplified77.0%
Taylor expanded in x around 0 76.8%
associate-*l/76.9%
*-lft-identity76.9%
+-commutative76.9%
unpow276.9%
fma-udef76.9%
Simplified76.9%
expm1-log1p-u60.7%
expm1-udef60.6%
associate-*r/60.7%
sqrt-div60.7%
metadata-eval60.7%
un-div-inv60.7%
Applied egg-rr60.7%
expm1-def60.7%
expm1-log1p76.9%
associate-/l/76.9%
Simplified76.9%
Taylor expanded in F around inf 99.1%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.15e-9)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 2.4e-62)
(- (/ F (/ B (sqrt 0.5))) (/ x (tan B)))
(if (<= F 86000000.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-9) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 2.4e-62) {
tmp = (F / (B / sqrt(0.5))) - (x / tan(B));
} else if (F <= 86000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 - (x * cos(B))) / 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 (f <= (-1.15d-9)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 2.4d-62) then
tmp = (f / (b / sqrt(0.5d0))) - (x / tan(b))
else if (f <= 86000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-9) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 2.4e-62) {
tmp = (F / (B / Math.sqrt(0.5))) - (x / Math.tan(B));
} else if (F <= 86000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.15e-9: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 2.4e-62: tmp = (F / (B / math.sqrt(0.5))) - (x / math.tan(B)) elif F <= 86000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.15e-9) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 2.4e-62) tmp = Float64(Float64(F / Float64(B / sqrt(0.5))) - Float64(x / tan(B))); elseif (F <= 86000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.15e-9) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 2.4e-62) tmp = (F / (B / sqrt(0.5))) - (x / tan(B)); elseif (F <= 86000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.15e-9], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e-62], N[(N[(F / N[(B / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 86000000.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], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-62}:\\
\;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 86000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.15e-9Initial program 65.6%
Taylor expanded in F around -inf 98.3%
div-inv98.4%
clear-num98.4%
Applied egg-rr98.4%
if -1.15e-9 < F < 2.39999999999999984e-62Initial program 99.6%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 86.7%
associate-/l*86.7%
Simplified86.7%
if 2.39999999999999984e-62 < F < 8.6e7Initial program 99.5%
Taylor expanded in B around 0 89.5%
if 8.6e7 < F Initial program 59.9%
Simplified75.2%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in F around 0 99.7%
div-sub99.7%
Simplified99.7%
Final simplification93.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* F (/ (sqrt 0.5) (sin B))) (/ x B))))
(if (<= F -0.5)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.16e-186)
t_0
(if (<= F 2.4e-120)
(/ (* x (- (cos B))) (sin B))
(if (<= F 1.7e-6) t_0 (/ (- 1.0 (* x (cos B))) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = (F * (sqrt(0.5) / sin(B))) - (x / B);
double tmp;
if (F <= -0.5) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.16e-186) {
tmp = t_0;
} else if (F <= 2.4e-120) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 1.7e-6) {
tmp = t_0;
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
if (f <= (-0.5d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.16d-186)) then
tmp = t_0
else if (f <= 2.4d-120) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 1.7d-6) then
tmp = t_0
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
double tmp;
if (F <= -0.5) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.16e-186) {
tmp = t_0;
} else if (F <= 2.4e-120) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 1.7e-6) {
tmp = t_0;
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B) tmp = 0 if F <= -0.5: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.16e-186: tmp = t_0 elif F <= 2.4e-120: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 1.7e-6: tmp = t_0 else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B)) tmp = 0.0 if (F <= -0.5) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.16e-186) tmp = t_0; elseif (F <= 2.4e-120) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 1.7e-6) tmp = t_0; else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F * (sqrt(0.5) / sin(B))) - (x / B); tmp = 0.0; if (F <= -0.5) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.16e-186) tmp = t_0; elseif (F <= 2.4e-120) tmp = (x * -cos(B)) / sin(B); elseif (F <= 1.7e-6) tmp = t_0; else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.16e-186], t$95$0, If[LessEqual[F, 2.4e-120], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-6], t$95$0, N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.5:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.16 \cdot 10^{-186}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-120}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -0.5Initial program 65.1%
Simplified75.2%
Taylor expanded in x around 0 75.2%
associate-*l/75.2%
*-lft-identity75.2%
+-commutative75.2%
unpow275.2%
fma-udef75.2%
Simplified75.2%
Taylor expanded in F around -inf 99.7%
if -0.5 < F < -1.15999999999999995e-186 or 2.3999999999999999e-120 < F < 1.70000000000000003e-6Initial program 99.3%
Simplified99.5%
Taylor expanded in x around 0 99.4%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
Taylor expanded in F around 0 99.5%
Taylor expanded in B around 0 78.3%
if -1.15999999999999995e-186 < F < 2.3999999999999999e-120Initial program 99.7%
Taylor expanded in F around -inf 32.4%
Taylor expanded in x around inf 91.4%
if 1.70000000000000003e-6 < F Initial program 62.7%
Simplified77.0%
Taylor expanded in F around inf 98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in F around 0 98.8%
div-sub98.8%
Simplified98.8%
Final simplification92.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.15e-9)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 9.5e-63)
(- (/ F (/ B (sqrt 0.5))) t_0)
(if (<= F 1.7e-6)
(- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.15e-9) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 9.5e-63) {
tmp = (F / (B / sqrt(0.5))) - t_0;
} else if (F <= 1.7e-6) {
tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
} else {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - 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.15d-9)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 9.5d-63) then
tmp = (f / (b / sqrt(0.5d0))) - t_0
else if (f <= 1.7d-6) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
else
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - 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.15e-9) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 9.5e-63) {
tmp = (F / (B / Math.sqrt(0.5))) - t_0;
} else if (F <= 1.7e-6) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
} else {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.15e-9: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 9.5e-63: tmp = (F / (B / math.sqrt(0.5))) - t_0 elif F <= 1.7e-6: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B) else: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.15e-9) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 9.5e-63) tmp = Float64(Float64(F / Float64(B / sqrt(0.5))) - t_0); elseif (F <= 1.7e-6) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.15e-9) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 9.5e-63) tmp = (F / (B / sqrt(0.5))) - t_0; elseif (F <= 1.7e-6) tmp = (F * (sqrt(0.5) / sin(B))) - (x / B); else tmp = (F / (sin(B) * (F + (1.0 / F)))) - 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.15e-9], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e-63], N[(N[(F / N[(B / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.7e-6], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.15 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}} - t\_0\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-6}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t\_0\\
\end{array}
\end{array}
if F < -1.15e-9Initial program 65.6%
Taylor expanded in F around -inf 98.3%
div-inv98.4%
clear-num98.4%
Applied egg-rr98.4%
if -1.15e-9 < F < 9.50000000000000016e-63Initial program 99.6%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 86.7%
associate-/l*86.7%
Simplified86.7%
if 9.50000000000000016e-63 < F < 1.70000000000000003e-6Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.4%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 85.8%
if 1.70000000000000003e-6 < F Initial program 62.7%
Simplified77.0%
Taylor expanded in x around 0 76.8%
associate-*l/76.9%
*-lft-identity76.9%
+-commutative76.9%
unpow276.9%
fma-udef76.9%
Simplified76.9%
expm1-log1p-u60.7%
expm1-udef60.6%
associate-*r/60.7%
sqrt-div60.7%
metadata-eval60.7%
un-div-inv60.7%
Applied egg-rr60.7%
expm1-def60.7%
expm1-log1p76.9%
associate-/l/76.9%
Simplified76.9%
Taylor expanded in F around inf 99.1%
Final simplification93.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.15e-9)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.5e-63)
(- (/ F (/ B (sqrt 0.5))) t_0)
(if (<= F 1.7e-6)
(- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
(/ (- 1.0 (* x (cos B))) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.15e-9) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.5e-63) {
tmp = (F / (B / sqrt(0.5))) - t_0;
} else if (F <= 1.7e-6) {
tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.15d-9)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.5d-63) then
tmp = (f / (b / sqrt(0.5d0))) - t_0
else if (f <= 1.7d-6) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.15e-9) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.5e-63) {
tmp = (F / (B / Math.sqrt(0.5))) - t_0;
} else if (F <= 1.7e-6) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.15e-9: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.5e-63: tmp = (F / (B / math.sqrt(0.5))) - t_0 elif F <= 1.7e-6: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B) else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.15e-9) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.5e-63) tmp = Float64(Float64(F / Float64(B / sqrt(0.5))) - t_0); elseif (F <= 1.7e-6) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.15e-9) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.5e-63) tmp = (F / (B / sqrt(0.5))) - t_0; elseif (F <= 1.7e-6) tmp = (F * (sqrt(0.5) / sin(B))) - (x / B); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.15e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.5e-63], N[(N[(F / N[(B / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.7e-6], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.15 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-63}:\\
\;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}} - t\_0\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-6}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.15e-9Initial program 65.6%
Simplified75.5%
Taylor expanded in x around 0 75.6%
associate-*l/75.5%
*-lft-identity75.5%
+-commutative75.5%
unpow275.5%
fma-udef75.5%
Simplified75.5%
Taylor expanded in F around -inf 98.4%
if -1.15e-9 < F < 3.50000000000000003e-63Initial program 99.6%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 86.7%
associate-/l*86.7%
Simplified86.7%
if 3.50000000000000003e-63 < F < 1.70000000000000003e-6Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.4%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 85.8%
if 1.70000000000000003e-6 < F Initial program 62.7%
Simplified77.0%
Taylor expanded in F around inf 98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in F around 0 98.8%
div-sub98.8%
Simplified98.8%
Final simplification93.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.15e-9)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 1e-61)
(- (/ F (/ B (sqrt 0.5))) (/ x (tan B)))
(if (<= F 7.8e-8)
(- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-9) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 1e-61) {
tmp = (F / (B / sqrt(0.5))) - (x / tan(B));
} else if (F <= 7.8e-8) {
tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
} else {
tmp = (1.0 - (x * cos(B))) / 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 (f <= (-1.15d-9)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 1d-61) then
tmp = (f / (b / sqrt(0.5d0))) - (x / tan(b))
else if (f <= 7.8d-8) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-9) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 1e-61) {
tmp = (F / (B / Math.sqrt(0.5))) - (x / Math.tan(B));
} else if (F <= 7.8e-8) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.15e-9: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 1e-61: tmp = (F / (B / math.sqrt(0.5))) - (x / math.tan(B)) elif F <= 7.8e-8: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B) else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.15e-9) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 1e-61) tmp = Float64(Float64(F / Float64(B / sqrt(0.5))) - Float64(x / tan(B))); elseif (F <= 7.8e-8) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.15e-9) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 1e-61) tmp = (F / (B / sqrt(0.5))) - (x / tan(B)); elseif (F <= 7.8e-8) tmp = (F * (sqrt(0.5) / sin(B))) - (x / B); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.15e-9], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-61], N[(N[(F / N[(B / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.8e-8], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10^{-61}:\\
\;\;\;\;\frac{F}{\frac{B}{\sqrt{0.5}}} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 7.8 \cdot 10^{-8}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.15e-9Initial program 65.6%
Taylor expanded in F around -inf 98.3%
div-inv98.4%
clear-num98.4%
Applied egg-rr98.4%
if -1.15e-9 < F < 1e-61Initial program 99.6%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-udef99.7%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 86.7%
associate-/l*86.7%
Simplified86.7%
if 1e-61 < F < 7.7999999999999997e-8Initial program 99.3%
Simplified99.4%
Taylor expanded in x around 0 99.4%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-udef99.4%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 85.8%
if 7.7999999999999997e-8 < F Initial program 62.7%
Simplified77.0%
Taylor expanded in F around inf 98.7%
associate-/r*98.7%
Simplified98.7%
Taylor expanded in F around 0 98.8%
div-sub98.8%
Simplified98.8%
Final simplification93.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.8e-109) (- (/ -1.0 (sin B)) (/ x (tan B))) (if (<= F 1.7e-40) (/ (- x) (tan B)) (/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-109) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.7e-40) {
tmp = -x / tan(B);
} else {
tmp = (1.0 - (x * cos(B))) / 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 (f <= (-1.8d-109)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.7d-40) then
tmp = -x / tan(b)
else
tmp = (1.0d0 - (x * cos(b))) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-109) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.7e-40) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 - (x * Math.cos(B))) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.8e-109: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.7e-40: tmp = -x / math.tan(B) else: tmp = (1.0 - (x * math.cos(B))) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.8e-109) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.7e-40) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.8e-109) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.7e-40) tmp = -x / tan(B); else tmp = (1.0 - (x * cos(B))) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.8e-109], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-40], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-40}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.8e-109Initial program 71.1%
Simplified79.5%
Taylor expanded in x around 0 79.5%
associate-*l/79.5%
*-lft-identity79.5%
+-commutative79.5%
unpow279.5%
fma-udef79.5%
Simplified79.5%
Taylor expanded in F around -inf 88.0%
if -1.8e-109 < F < 1.69999999999999992e-40Initial program 99.6%
Taylor expanded in F around -inf 36.4%
Taylor expanded in x around inf 79.2%
mul-1-neg79.2%
*-commutative79.2%
associate-*r/79.1%
Simplified79.1%
*-commutative79.1%
associate-/r/79.0%
tan-quot79.2%
*-un-lft-identity79.2%
associate-/r*79.2%
Applied egg-rr79.2%
if 1.69999999999999992e-40 < F Initial program 66.0%
Simplified79.0%
Taylor expanded in F around inf 91.9%
associate-/r*91.9%
Simplified91.9%
Taylor expanded in F around 0 92.0%
div-sub92.0%
Simplified92.0%
Final simplification85.8%
(FPCore (F B x)
:precision binary64
(if (<= F -700000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 4.9e-116)
(/ (* x (- (cos B))) (sin B))
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -700000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 4.9e-116) {
tmp = (x * -cos(B)) / sin(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-700000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 4.9d-116) then
tmp = (x * -cos(b)) / sin(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -700000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 4.9e-116) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -700000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 4.9e-116: tmp = (x * -math.cos(B)) / math.sin(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -700000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 4.9e-116) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -700000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 4.9e-116) tmp = (x * -cos(B)) / sin(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -700000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.9e-116], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -700000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{-116}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -7e5Initial program 63.4%
Simplified74.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.0%
*-lft-identity74.0%
+-commutative74.0%
unpow274.0%
fma-udef74.0%
Simplified74.0%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.1%
if -7e5 < F < 4.89999999999999977e-116Initial program 99.6%
Taylor expanded in F around -inf 37.0%
Taylor expanded in x around inf 79.7%
if 4.89999999999999977e-116 < F Initial program 73.6%
Simplified83.7%
Taylor expanded in F around inf 79.8%
associate-/r*79.8%
Simplified79.8%
Taylor expanded in B around 0 63.9%
Final simplification73.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.8e-109)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 6.8e-116) (/ (* 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 <= -1.8e-109) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 6.8e-116) {
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 <= (-1.8d-109)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 6.8d-116) 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 <= -1.8e-109) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 6.8e-116) {
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 <= -1.8e-109: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 6.8e-116: 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 <= -1.8e-109) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 6.8e-116) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.8e-109) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 6.8e-116) 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, -1.8e-109], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.8e-116], 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.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 6.8 \cdot 10^{-116}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.8e-109Initial program 71.1%
Simplified79.5%
Taylor expanded in x around 0 79.5%
associate-*l/79.5%
*-lft-identity79.5%
+-commutative79.5%
unpow279.5%
fma-udef79.5%
Simplified79.5%
Taylor expanded in F around -inf 88.0%
if -1.8e-109 < F < 6.79999999999999985e-116Initial program 99.7%
Taylor expanded in F around -inf 35.2%
Taylor expanded in x around inf 87.9%
if 6.79999999999999985e-116 < F Initial program 73.6%
Simplified83.7%
Taylor expanded in F around inf 79.8%
associate-/r*79.8%
Simplified79.8%
Taylor expanded in B around 0 63.9%
Final simplification78.4%
(FPCore (F B x)
:precision binary64
(if (<= F -700000.0)
(/ -1.0 (sin B))
(if (or (<= F 8.2e+67) (and (not (<= F 3.8e+118)) (<= F 8.2e+198)))
(/ -1.0 (/ (tan B) x))
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -700000.0) {
tmp = -1.0 / sin(B);
} else if ((F <= 8.2e+67) || (!(F <= 3.8e+118) && (F <= 8.2e+198))) {
tmp = -1.0 / (tan(B) / x);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-700000.0d0)) then
tmp = (-1.0d0) / sin(b)
else if ((f <= 8.2d+67) .or. (.not. (f <= 3.8d+118)) .and. (f <= 8.2d+198)) then
tmp = (-1.0d0) / (tan(b) / x)
else
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -700000.0) {
tmp = -1.0 / Math.sin(B);
} else if ((F <= 8.2e+67) || (!(F <= 3.8e+118) && (F <= 8.2e+198))) {
tmp = -1.0 / (Math.tan(B) / x);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -700000.0: tmp = -1.0 / math.sin(B) elif (F <= 8.2e+67) or (not (F <= 3.8e+118) and (F <= 8.2e+198)): tmp = -1.0 / (math.tan(B) / x) else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -700000.0) tmp = Float64(-1.0 / sin(B)); elseif ((F <= 8.2e+67) || (!(F <= 3.8e+118) && (F <= 8.2e+198))) tmp = Float64(-1.0 / Float64(tan(B) / x)); else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -700000.0) tmp = -1.0 / sin(B); elseif ((F <= 8.2e+67) || (~((F <= 3.8e+118)) && (F <= 8.2e+198))) tmp = -1.0 / (tan(B) / x); else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -700000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 8.2e+67], And[N[Not[LessEqual[F, 3.8e+118]], $MachinePrecision], LessEqual[F, 8.2e+198]]], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -700000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{+67} \lor \neg \left(F \leq 3.8 \cdot 10^{+118}\right) \land F \leq 8.2 \cdot 10^{+198}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7e5Initial program 63.4%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 59.5%
if -7e5 < F < 8.19999999999999959e67 or 3.80000000000000016e118 < F < 8.2000000000000003e198Initial program 97.1%
Taylor expanded in F around -inf 41.7%
Taylor expanded in x around inf 69.0%
mul-1-neg69.0%
*-commutative69.0%
associate-*r/68.9%
Simplified68.9%
*-commutative68.9%
associate-/r/68.9%
tan-quot69.0%
clear-num69.0%
Applied egg-rr69.0%
if 8.19999999999999959e67 < F < 3.80000000000000016e118 or 8.2000000000000003e198 < F Initial program 40.6%
Simplified61.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in B around 0 57.0%
associate--l+57.0%
div-sub57.0%
Simplified57.0%
Final simplification64.9%
(FPCore (F B x)
:precision binary64
(if (<= F -700000.0)
(/ -1.0 (sin B))
(if (or (<= F 2.65e+67) (and (not (<= F 2.7e+118)) (<= F 9e+198)))
(/ (- x) (tan B))
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -700000.0) {
tmp = -1.0 / sin(B);
} else if ((F <= 2.65e+67) || (!(F <= 2.7e+118) && (F <= 9e+198))) {
tmp = -x / tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-700000.0d0)) then
tmp = (-1.0d0) / sin(b)
else if ((f <= 2.65d+67) .or. (.not. (f <= 2.7d+118)) .and. (f <= 9d+198)) then
tmp = -x / tan(b)
else
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -700000.0) {
tmp = -1.0 / Math.sin(B);
} else if ((F <= 2.65e+67) || (!(F <= 2.7e+118) && (F <= 9e+198))) {
tmp = -x / Math.tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -700000.0: tmp = -1.0 / math.sin(B) elif (F <= 2.65e+67) or (not (F <= 2.7e+118) and (F <= 9e+198)): tmp = -x / math.tan(B) else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -700000.0) tmp = Float64(-1.0 / sin(B)); elseif ((F <= 2.65e+67) || (!(F <= 2.7e+118) && (F <= 9e+198))) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -700000.0) tmp = -1.0 / sin(B); elseif ((F <= 2.65e+67) || (~((F <= 2.7e+118)) && (F <= 9e+198))) tmp = -x / tan(B); else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -700000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 2.65e+67], And[N[Not[LessEqual[F, 2.7e+118]], $MachinePrecision], LessEqual[F, 9e+198]]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -700000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+67} \lor \neg \left(F \leq 2.7 \cdot 10^{+118}\right) \land F \leq 9 \cdot 10^{+198}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7e5Initial program 63.4%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
Taylor expanded in x around 0 59.5%
if -7e5 < F < 2.65e67 or 2.7e118 < F < 9.00000000000000003e198Initial program 97.1%
Taylor expanded in F around -inf 41.7%
Taylor expanded in x around inf 69.0%
mul-1-neg69.0%
*-commutative69.0%
associate-*r/68.9%
Simplified68.9%
*-commutative68.9%
associate-/r/68.9%
tan-quot69.0%
*-un-lft-identity69.0%
associate-/r*69.0%
Applied egg-rr69.0%
if 2.65e67 < F < 2.7e118 or 9.00000000000000003e198 < F Initial program 40.6%
Simplified61.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in B around 0 57.0%
associate--l+57.0%
div-sub57.0%
Simplified57.0%
Final simplification64.9%
(FPCore (F B x)
:precision binary64
(if (<= F -900000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F 3.3e+67) (and (not (<= F 2.8e+118)) (<= F 6.8e+198)))
(/ (- x) (tan B))
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -900000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= 3.3e+67) || (!(F <= 2.8e+118) && (F <= 6.8e+198))) {
tmp = -x / tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-900000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= 3.3d+67) .or. (.not. (f <= 2.8d+118)) .and. (f <= 6.8d+198)) then
tmp = -x / tan(b)
else
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -900000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= 3.3e+67) || (!(F <= 2.8e+118) && (F <= 6.8e+198))) {
tmp = -x / Math.tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -900000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= 3.3e+67) or (not (F <= 2.8e+118) and (F <= 6.8e+198)): tmp = -x / math.tan(B) else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -900000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= 3.3e+67) || (!(F <= 2.8e+118) && (F <= 6.8e+198))) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -900000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= 3.3e+67) || (~((F <= 2.8e+118)) && (F <= 6.8e+198))) tmp = -x / tan(B); else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -900000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 3.3e+67], And[N[Not[LessEqual[F, 2.8e+118]], $MachinePrecision], LessEqual[F, 6.8e+198]]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -900000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.3 \cdot 10^{+67} \lor \neg \left(F \leq 2.8 \cdot 10^{+118}\right) \land F \leq 6.8 \cdot 10^{+198}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9e5Initial program 63.4%
Simplified74.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.0%
*-lft-identity74.0%
+-commutative74.0%
unpow274.0%
fma-udef74.0%
Simplified74.0%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.1%
if -9e5 < F < 3.3000000000000003e67 or 2.79999999999999986e118 < F < 6.8000000000000001e198Initial program 97.1%
Taylor expanded in F around -inf 41.7%
Taylor expanded in x around inf 69.0%
mul-1-neg69.0%
*-commutative69.0%
associate-*r/68.9%
Simplified68.9%
*-commutative68.9%
associate-/r/68.9%
tan-quot69.0%
*-un-lft-identity69.0%
associate-/r*69.0%
Applied egg-rr69.0%
if 3.3000000000000003e67 < F < 2.79999999999999986e118 or 6.8000000000000001e198 < F Initial program 40.6%
Simplified61.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in B around 0 57.0%
associate--l+57.0%
div-sub57.0%
Simplified57.0%
Final simplification69.7%
(FPCore (F B x) :precision binary64 (if (<= F -700000.0) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 1.25e-137) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -700000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.25e-137) {
tmp = -x / tan(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 <= (-700000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.25d-137) then
tmp = -x / tan(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 <= -700000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.25e-137) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -700000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.25e-137: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -700000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.25e-137) tmp = Float64(Float64(-x) / tan(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 <= -700000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.25e-137) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -700000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.25e-137], N[((-x) / N[Tan[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 -700000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{-137}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -7e5Initial program 63.4%
Simplified74.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.0%
*-lft-identity74.0%
+-commutative74.0%
unpow274.0%
fma-udef74.0%
Simplified74.0%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.1%
if -7e5 < F < 1.25e-137Initial program 99.6%
Taylor expanded in F around -inf 36.7%
Taylor expanded in x around inf 79.2%
mul-1-neg79.2%
*-commutative79.2%
associate-*r/79.2%
Simplified79.2%
*-commutative79.2%
associate-/r/79.1%
tan-quot79.2%
*-un-lft-identity79.2%
associate-/r*79.2%
Applied egg-rr79.2%
if 1.25e-137 < F Initial program 74.1%
Simplified84.0%
Taylor expanded in F around inf 79.3%
associate-/r*79.3%
Simplified79.3%
Taylor expanded in B around 0 64.5%
Final simplification73.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.1e-9) (/ -1.0 (sin B)) (if (<= F 1e-157) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e-9) {
tmp = -1.0 / sin(B);
} else if (F <= 1e-157) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.1d-9)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 1d-157) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e-9) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 1e-157) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.1e-9: tmp = -1.0 / math.sin(B) elif F <= 1e-157: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.1e-9) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1e-157) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.1e-9) tmp = -1.0 / sin(B); elseif (F <= 1e-157) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.1e-9], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-157], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.1 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10^{-157}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.0999999999999999e-9Initial program 65.6%
Taylor expanded in F around -inf 98.3%
div-inv98.4%
clear-num98.4%
Applied egg-rr98.4%
Taylor expanded in x around 0 56.1%
if -1.0999999999999999e-9 < F < 9.99999999999999943e-158Initial program 99.6%
Simplified99.7%
Taylor expanded in F around inf 22.6%
associate-/r*22.6%
Simplified22.6%
Taylor expanded in B around 0 24.7%
Taylor expanded in x around inf 50.1%
neg-mul-150.1%
distribute-neg-frac50.1%
Simplified50.1%
if 9.99999999999999943e-158 < F Initial program 74.6%
Simplified84.3%
Taylor expanded in F around inf 77.9%
associate-/r*77.9%
Simplified77.9%
Taylor expanded in B around 0 38.2%
Final simplification46.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.8e-109) (+ (/ (- -1.0 x) B) (* B (- (* x 0.3333333333333333) 0.16666666666666666))) (if (<= F 5.8e-158) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-109) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 5.8e-158) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.8d-109)) then
tmp = (((-1.0d0) - x) / b) + (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0))
else if (f <= 5.8d-158) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-109) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 5.8e-158) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.8e-109: tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)) elif F <= 5.8e-158: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.8e-109) tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666))); elseif (F <= 5.8e-158) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.8e-109) tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)); elseif (F <= 5.8e-158) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.8e-109], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.8e-158], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-158}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.8e-109Initial program 71.1%
Taylor expanded in F around -inf 87.9%
Taylor expanded in B around 0 41.2%
if -1.8e-109 < F < 5.79999999999999961e-158Initial program 99.7%
Simplified99.7%
Taylor expanded in F around inf 21.0%
associate-/r*21.0%
Simplified21.0%
Taylor expanded in B around 0 24.7%
Taylor expanded in x around inf 54.5%
neg-mul-154.5%
distribute-neg-frac54.5%
Simplified54.5%
if 5.79999999999999961e-158 < F Initial program 74.6%
Simplified84.3%
Taylor expanded in F around inf 77.9%
associate-/r*77.9%
Simplified77.9%
Taylor expanded in B around 0 38.2%
Final simplification43.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.8e-109) (/ (- -1.0 x) B) (if (<= F 1e-157) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-157) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.8d-109)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1d-157) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-109) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-157) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.8e-109: tmp = (-1.0 - x) / B elif F <= 1e-157: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.8e-109) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1e-157) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.8e-109) tmp = (-1.0 - x) / B; elseif (F <= 1e-157) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.8e-109], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e-157], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 10^{-157}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.8e-109Initial program 71.1%
Taylor expanded in F around -inf 87.9%
Taylor expanded in B around 0 41.0%
associate-*r/41.0%
distribute-lft-in41.0%
metadata-eval41.0%
neg-mul-141.0%
Simplified41.0%
if -1.8e-109 < F < 9.99999999999999943e-158Initial program 99.7%
Simplified99.7%
Taylor expanded in F around inf 21.0%
associate-/r*21.0%
Simplified21.0%
Taylor expanded in B around 0 24.7%
Taylor expanded in x around inf 54.5%
neg-mul-154.5%
distribute-neg-frac54.5%
Simplified54.5%
if 9.99999999999999943e-158 < F Initial program 74.6%
Simplified84.3%
Taylor expanded in F around inf 77.9%
associate-/r*77.9%
Simplified77.9%
Taylor expanded in B around 0 38.2%
Final simplification43.6%
(FPCore (F B x) :precision binary64 (if (<= F 5.8e-158) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 5.8e-158) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 5.8d-158) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 5.8e-158) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 5.8e-158: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 5.8e-158) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 5.8e-158) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 5.8e-158], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.8 \cdot 10^{-158}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5.79999999999999961e-158Initial program 84.7%
Simplified89.1%
Taylor expanded in F around inf 31.7%
associate-/r*31.7%
Simplified31.7%
Taylor expanded in B around 0 22.9%
Taylor expanded in x around inf 37.4%
neg-mul-137.4%
distribute-neg-frac37.4%
Simplified37.4%
if 5.79999999999999961e-158 < F Initial program 74.6%
Simplified84.3%
Taylor expanded in F around inf 77.9%
associate-/r*77.9%
Simplified77.9%
Taylor expanded in B around 0 38.2%
Final simplification37.7%
(FPCore (F B x) :precision binary64 (if (<= F 3.7e+24) (/ (- x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 3.7e+24) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 3.7d+24) then
tmp = -x / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 3.7e+24) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 3.7e+24: tmp = -x / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 3.7e+24) tmp = Float64(Float64(-x) / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 3.7e+24) tmp = -x / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 3.7e+24], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.7 \cdot 10^{+24}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 3.69999999999999999e24Initial program 87.8%
Simplified91.3%
Taylor expanded in F around inf 34.0%
associate-/r*34.0%
Simplified34.0%
Taylor expanded in B around 0 23.8%
Taylor expanded in x around inf 34.4%
neg-mul-134.4%
distribute-neg-frac34.4%
Simplified34.4%
if 3.69999999999999999e24 < F Initial program 59.3%
Simplified74.8%
Taylor expanded in F around inf 99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in B around 0 45.0%
Taylor expanded in x around 0 28.6%
Final simplification32.9%
(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 80.6%
Simplified87.1%
Taylor expanded in F around inf 50.7%
associate-/r*50.7%
Simplified50.7%
Taylor expanded in B around 0 29.2%
Taylor expanded in x around 0 9.7%
Final simplification9.7%
herbie shell --seed 2024026
(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))))))