
(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 25 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 -4e+46)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 40000000.0)
(-
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(* (cos B) (/ x (sin B))))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e+46) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 40000000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (cos(B) * (x / sin(B)));
} else {
tmp = (x * (-1.0 / tan(B))) + (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 (f <= (-4d+46)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 40000000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (cos(b) * (x / sin(b)))
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4e+46) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 40000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (Math.cos(B) * (x / Math.sin(B)));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4e+46: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 40000000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (math.cos(B) * (x / math.sin(B))) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4e+46) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 40000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(cos(B) * Float64(x / sin(B)))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4e+46) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 40000000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (cos(B) * (x / sin(B))); else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4e+46], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 40000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+46}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \cos B \cdot \frac{x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -4e46Initial program 41.8%
Taylor expanded in F around -inf 99.6%
expm1-log1p-u39.6%
expm1-udef39.5%
div-inv39.5%
neg-mul-139.5%
fma-def39.5%
Applied egg-rr39.5%
expm1-def39.6%
expm1-log1p99.7%
rem-log-exp41.3%
fma-udef41.3%
neg-mul-141.3%
prod-exp40.5%
*-commutative40.5%
prod-exp41.3%
rem-log-exp99.7%
unsub-neg99.7%
Simplified99.7%
if -4e46 < F < 4e7Initial program 99.5%
Taylor expanded in x around 0 99.6%
associate-*r/99.7%
Simplified99.7%
if 4e7 < F Initial program 56.8%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3100.0)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3100.0) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3100.0d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / 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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3100.0) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3100.0: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3100.0) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3100.0) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / 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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3100.0], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 3100:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 45.9%
Taylor expanded in F around -inf 99.6%
expm1-log1p-u39.5%
expm1-udef39.5%
div-inv39.5%
neg-mul-139.5%
fma-def39.5%
Applied egg-rr39.5%
expm1-def39.5%
expm1-log1p99.7%
rem-log-exp41.4%
fma-udef41.4%
neg-mul-141.4%
prod-exp40.7%
*-commutative40.7%
prod-exp41.4%
rem-log-exp99.7%
unsub-neg99.7%
Simplified99.7%
if -1.3999999999999999 < F < 3100Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in x around 0 99.6%
if 3100 < F Initial program 57.5%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(- (/ -1.0 (sin B)) (* (cos B) (/ x (sin B))))
(if (<= F 3100.0)
(- (* F (/ (sqrt 0.5) (sin B))) (/ x (tan B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B)));
} else if (F <= 3100.0) {
tmp = (F * (sqrt(0.5) / sin(B))) - (x / tan(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (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 (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - (cos(b) * (x / sin(b)))
else if (f <= 3100.0d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / tan(b))
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - (Math.cos(B) * (x / Math.sin(B)));
} else if (F <= 3100.0) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / Math.tan(B));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - (math.cos(B) * (x / math.sin(B))) elif F <= 3100.0: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / math.tan(B)) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(cos(B) * Float64(x / sin(B)))); elseif (F <= 3100.0) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - (cos(B) * (x / sin(B))); elseif (F <= 3100.0) tmp = (F * (sqrt(0.5) / sin(B))) - (x / tan(B)); else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3100.0], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \cos B \cdot \frac{x}{\sin B}\\
\mathbf{elif}\;F \leq 3100:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 45.9%
Taylor expanded in F around -inf 99.6%
Taylor expanded in x around 0 99.7%
associate-*r/45.9%
Simplified99.7%
if -1.3999999999999999 < F < 3100Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in x around 0 99.6%
if 3100 < F Initial program 57.5%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -4.4e+20)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1.04e-94)
t_0
(if (<= F 1.75e-135)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_1)
(if (<= F 1.7e-7) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -4.4e+20) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1.04e-94) {
tmp = t_0;
} else if (F <= 1.75e-135) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1;
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-4.4d+20)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1.04d-94)) then
tmp = t_0
else if (f <= 1.75d-135) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_1
else if (f <= 1.7d-7) then
tmp = t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
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((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -4.4e+20) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1.04e-94) {
tmp = t_0;
} else if (F <= 1.75e-135) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1;
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -4.4e+20: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1.04e-94: tmp = t_0 elif F <= 1.75e-135: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1 elif F <= 1.7e-7: tmp = t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4.4e+20) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1.04e-94) tmp = t_0; elseif (F <= 1.75e-135) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_1); elseif (F <= 1.7e-7) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -4.4e+20) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1.04e-94) tmp = t_0; elseif (F <= 1.75e-135) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1; elseif (F <= 1.7e-7) tmp = t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); 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[(N[(F * F), $MachinePrecision] + 2.0), $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, -4.4e+20], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.04e-94], t$95$0, If[LessEqual[F, 1.75e-135], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.7e-7], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4.4 \cdot 10^{+20}:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq -1.04 \cdot 10^{-94}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{-135}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_1\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -4.4e20Initial program 43.5%
Taylor expanded in F around -inf 99.6%
expm1-log1p-u39.8%
expm1-udef39.7%
div-inv39.7%
neg-mul-139.7%
fma-def39.7%
Applied egg-rr39.7%
expm1-def39.8%
expm1-log1p99.7%
rem-log-exp40.3%
fma-udef40.3%
neg-mul-140.3%
prod-exp39.5%
*-commutative39.5%
prod-exp40.3%
rem-log-exp99.7%
unsub-neg99.7%
Simplified99.7%
if -4.4e20 < F < -1.04e-94 or 1.7499999999999999e-135 < F < 1.69999999999999987e-7Initial program 99.5%
Taylor expanded in B around 0 88.3%
if -1.04e-94 < F < 1.7499999999999999e-135Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 92.6%
if 1.69999999999999987e-7 < F Initial program 58.7%
Taylor expanded in F around inf 99.7%
Final simplification95.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.2e-19)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3100.0)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.2e-19) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3100.0) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-7.2d-19)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3100.0d0) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / 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 <= -7.2e-19) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3100.0) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -7.2e-19: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3100.0: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.2e-19) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3100.0) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -7.2e-19) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3100.0) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / 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, -7.2e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3100.0], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 3100:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -7.2000000000000002e-19Initial program 48.0%
Taylor expanded in F around -inf 97.2%
expm1-log1p-u37.9%
expm1-udef37.9%
div-inv37.9%
neg-mul-137.9%
fma-def37.9%
Applied egg-rr37.9%
expm1-def37.9%
expm1-log1p97.3%
rem-log-exp40.1%
fma-udef40.1%
neg-mul-140.1%
prod-exp39.4%
*-commutative39.4%
prod-exp40.1%
rem-log-exp97.3%
unsub-neg97.3%
Simplified97.3%
if -7.2000000000000002e-19 < F < 3100Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 83.0%
if 3100 < F Initial program 57.5%
Taylor expanded in F around inf 99.7%
Final simplification91.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F (sin B)) (sqrt 0.5)))
(t_1 (+ (/ x B) (* -0.3333333333333333 (* B x)))))
(if (<= F -2.3e-12)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -8.6e-66)
t_0
(if (<= F 3.7e-305)
(- (* (/ F B) (/ -1.0 F)) (* x (/ 1.0 (tan B))))
(if (<= F 8.2e-137)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) t_1)
(if (<= F 2.7e-135)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F 1.7e-7) t_0 (- (/ 1.0 (sin B)) t_1)))))))))
double code(double F, double B, double x) {
double t_0 = (F / sin(B)) * sqrt(0.5);
double t_1 = (x / B) + (-0.3333333333333333 * (B * x));
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -8.6e-66) {
tmp = t_0;
} else if (F <= 3.7e-305) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B)));
} else if (F <= 8.2e-137) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1;
} else if (F <= 2.7e-135) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (f / sin(b)) * sqrt(0.5d0)
t_1 = (x / b) + ((-0.3333333333333333d0) * (b * x))
if (f <= (-2.3d-12)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-8.6d-66)) then
tmp = t_0
else if (f <= 3.7d-305) then
tmp = ((f / b) * ((-1.0d0) / f)) - (x * (1.0d0 / tan(b)))
else if (f <= 8.2d-137) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - t_1
else if (f <= 2.7d-135) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= 1.7d-7) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (F / Math.sin(B)) * Math.sqrt(0.5);
double t_1 = (x / B) + (-0.3333333333333333 * (B * x));
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -8.6e-66) {
tmp = t_0;
} else if (F <= 3.7e-305) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / Math.tan(B)));
} else if (F <= 8.2e-137) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1;
} else if (F <= 2.7e-135) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = (F / math.sin(B)) * math.sqrt(0.5) t_1 = (x / B) + (-0.3333333333333333 * (B * x)) tmp = 0 if F <= -2.3e-12: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -8.6e-66: tmp = t_0 elif F <= 3.7e-305: tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / math.tan(B))) elif F <= 8.2e-137: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1 elif F <= 2.7e-135: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= 1.7e-7: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(F / sin(B)) * sqrt(0.5)) t_1 = Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x))) tmp = 0.0 if (F <= -2.3e-12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -8.6e-66) tmp = t_0; elseif (F <= 3.7e-305) tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 8.2e-137) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - t_1); elseif (F <= 2.7e-135) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= 1.7e-7) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F / sin(B)) * sqrt(0.5); t_1 = (x / B) + (-0.3333333333333333 * (B * x)); tmp = 0.0; if (F <= -2.3e-12) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -8.6e-66) tmp = t_0; elseif (F <= 3.7e-305) tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B))); elseif (F <= 8.2e-137) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - t_1; elseif (F <= 2.7e-135) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= 1.7e-7) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.6e-66], t$95$0, If[LessEqual[F, 3.7e-305], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.2e-137], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 2.7e-135], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-7], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{0.5}\\
t_1 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -8.6 \cdot 10^{-66}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 3.7 \cdot 10^{-305}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{-137}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t_1\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-135}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -2.29999999999999989e-12Initial program 47.4%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 82.8%
if -2.29999999999999989e-12 < F < -8.60000000000000027e-66 or 2.69999999999999999e-135 < F < 1.69999999999999987e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 78.0%
Taylor expanded in x around 0 78.0%
if -8.60000000000000027e-66 < F < 3.69999999999999977e-305Initial program 99.4%
Taylor expanded in F around -inf 37.0%
Taylor expanded in B around 0 61.7%
if 3.69999999999999977e-305 < F < 8.1999999999999997e-137Initial program 99.5%
Taylor expanded in B around 0 66.7%
*-commutative19.4%
Simplified66.7%
Taylor expanded in B around 0 61.0%
if 8.1999999999999997e-137 < F < 2.69999999999999999e-135Initial program 99.2%
Taylor expanded in F around -inf 99.2%
Taylor expanded in B around 0 99.2%
if 1.69999999999999987e-7 < F Initial program 58.7%
Taylor expanded in B around 0 32.3%
*-commutative30.8%
Simplified32.3%
Taylor expanded in F around inf 59.9%
Final simplification69.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (* (sin B) (sqrt 2.0))))
(t_1 (+ (/ x B) (* -0.3333333333333333 (* B x)))))
(if (<= F -2.3e-12)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -1.95e-63)
t_0
(if (<= F 6.2e-306)
(- (* (/ F B) (/ -1.0 F)) (* x (/ 1.0 (tan B))))
(if (<= F 4.6e-137)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) t_1)
(if (<= F 1.75e-135)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F 1.7e-7) t_0 (- (/ 1.0 (sin B)) t_1)))))))))
double code(double F, double B, double x) {
double t_0 = F / (sin(B) * sqrt(2.0));
double t_1 = (x / B) + (-0.3333333333333333 * (B * x));
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -1.95e-63) {
tmp = t_0;
} else if (F <= 6.2e-306) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B)));
} else if (F <= 4.6e-137) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1;
} else if (F <= 1.75e-135) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = f / (sin(b) * sqrt(2.0d0))
t_1 = (x / b) + ((-0.3333333333333333d0) * (b * x))
if (f <= (-2.3d-12)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-1.95d-63)) then
tmp = t_0
else if (f <= 6.2d-306) then
tmp = ((f / b) * ((-1.0d0) / f)) - (x * (1.0d0 / tan(b)))
else if (f <= 4.6d-137) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - t_1
else if (f <= 1.75d-135) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= 1.7d-7) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F / (Math.sin(B) * Math.sqrt(2.0));
double t_1 = (x / B) + (-0.3333333333333333 * (B * x));
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -1.95e-63) {
tmp = t_0;
} else if (F <= 6.2e-306) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / Math.tan(B)));
} else if (F <= 4.6e-137) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1;
} else if (F <= 1.75e-135) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = F / (math.sin(B) * math.sqrt(2.0)) t_1 = (x / B) + (-0.3333333333333333 * (B * x)) tmp = 0 if F <= -2.3e-12: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -1.95e-63: tmp = t_0 elif F <= 6.2e-306: tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / math.tan(B))) elif F <= 4.6e-137: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_1 elif F <= 1.75e-135: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= 1.7e-7: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(F / Float64(sin(B) * sqrt(2.0))) t_1 = Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x))) tmp = 0.0 if (F <= -2.3e-12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -1.95e-63) tmp = t_0; elseif (F <= 6.2e-306) tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 4.6e-137) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - t_1); elseif (F <= 1.75e-135) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= 1.7e-7) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F / (sin(B) * sqrt(2.0)); t_1 = (x / B) + (-0.3333333333333333 * (B * x)); tmp = 0.0; if (F <= -2.3e-12) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -1.95e-63) tmp = t_0; elseif (F <= 6.2e-306) tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B))); elseif (F <= 4.6e-137) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - t_1; elseif (F <= 1.75e-135) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= 1.7e-7) 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[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.95e-63], t$95$0, If[LessEqual[F, 6.2e-306], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.6e-137], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.75e-135], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-7], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B \cdot \sqrt{2}}\\
t_1 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.95 \cdot 10^{-63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-306}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-137}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t_1\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{-135}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -2.29999999999999989e-12Initial program 47.4%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 82.8%
if -2.29999999999999989e-12 < F < -1.95000000000000011e-63 or 1.7499999999999999e-135 < F < 1.69999999999999987e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 78.0%
expm1-log1p-u57.2%
expm1-udef20.1%
*-commutative20.1%
sqrt-div20.1%
metadata-eval20.1%
frac-times20.1%
*-un-lft-identity20.1%
fma-def20.1%
Applied egg-rr20.1%
expm1-def57.3%
expm1-log1p78.0%
Simplified78.0%
Taylor expanded in x around 0 78.0%
if -1.95000000000000011e-63 < F < 6.19999999999999995e-306Initial program 99.4%
Taylor expanded in F around -inf 37.0%
Taylor expanded in B around 0 61.7%
if 6.19999999999999995e-306 < F < 4.60000000000000016e-137Initial program 99.5%
Taylor expanded in B around 0 66.7%
*-commutative19.4%
Simplified66.7%
Taylor expanded in B around 0 61.0%
if 4.60000000000000016e-137 < F < 1.7499999999999999e-135Initial program 99.2%
Taylor expanded in F around -inf 99.2%
Taylor expanded in B around 0 99.2%
if 1.69999999999999987e-7 < F Initial program 58.7%
Taylor expanded in B around 0 32.3%
*-commutative30.8%
Simplified32.3%
Taylor expanded in F around inf 59.9%
Final simplification69.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (* (sin B) (sqrt 2.0)))))
(if (<= F -2.3e-12)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -6e-66)
t_0
(if (<= F 2.8e-135)
(* (cos B) (/ -1.0 (/ (sin B) x)))
(if (<= F 1.7e-7) t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = F / (sin(B) * sqrt(2.0));
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -6e-66) {
tmp = t_0;
} else if (F <= 2.8e-135) {
tmp = cos(B) * (-1.0 / (sin(B) / x));
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (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) :: t_0
real(8) :: tmp
t_0 = f / (sin(b) * sqrt(2.0d0))
if (f <= (-2.3d-12)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-6d-66)) then
tmp = t_0
else if (f <= 2.8d-135) then
tmp = cos(b) * ((-1.0d0) / (sin(b) / x))
else if (f <= 1.7d-7) then
tmp = t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F / (Math.sin(B) * Math.sqrt(2.0));
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -6e-66) {
tmp = t_0;
} else if (F <= 2.8e-135) {
tmp = Math.cos(B) * (-1.0 / (Math.sin(B) / x));
} else if (F <= 1.7e-7) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = F / (math.sin(B) * math.sqrt(2.0)) tmp = 0 if F <= -2.3e-12: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -6e-66: tmp = t_0 elif F <= 2.8e-135: tmp = math.cos(B) * (-1.0 / (math.sin(B) / x)) elif F <= 1.7e-7: tmp = t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(F / Float64(sin(B) * sqrt(2.0))) tmp = 0.0 if (F <= -2.3e-12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -6e-66) tmp = t_0; elseif (F <= 2.8e-135) tmp = Float64(cos(B) * Float64(-1.0 / Float64(sin(B) / x))); elseif (F <= 1.7e-7) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F / (sin(B) * sqrt(2.0)); tmp = 0.0; if (F <= -2.3e-12) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -6e-66) tmp = t_0; elseif (F <= 2.8e-135) tmp = cos(B) * (-1.0 / (sin(B) / x)); elseif (F <= 1.7e-7) tmp = t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-66], t$95$0, If[LessEqual[F, 2.8e-135], N[(N[Cos[B], $MachinePrecision] * N[(-1.0 / N[(N[Sin[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-7], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-66}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\
\;\;\;\;\cos B \cdot \frac{-1}{\frac{\sin B}{x}}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.29999999999999989e-12Initial program 47.4%
Taylor expanded in F around -inf 98.4%
expm1-log1p-u38.5%
expm1-udef38.4%
div-inv38.4%
neg-mul-138.4%
fma-def38.4%
Applied egg-rr38.4%
expm1-def38.5%
expm1-log1p98.5%
rem-log-exp40.6%
fma-udef40.6%
neg-mul-140.6%
prod-exp39.9%
*-commutative39.9%
prod-exp40.6%
rem-log-exp98.5%
unsub-neg98.5%
Simplified98.5%
if -2.29999999999999989e-12 < F < -6.0000000000000004e-66 or 2.80000000000000023e-135 < F < 1.69999999999999987e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 78.0%
expm1-log1p-u57.2%
expm1-udef20.1%
*-commutative20.1%
sqrt-div20.1%
metadata-eval20.1%
frac-times20.1%
*-un-lft-identity20.1%
fma-def20.1%
Applied egg-rr20.1%
expm1-def57.3%
expm1-log1p78.0%
Simplified78.0%
Taylor expanded in x around 0 78.0%
if -6.0000000000000004e-66 < F < 2.80000000000000023e-135Initial program 99.5%
Taylor expanded in F around -inf 37.5%
Taylor expanded in x around inf 83.3%
mul-1-neg83.3%
associate-/l*83.2%
distribute-neg-frac83.2%
Simplified83.2%
div-inv83.3%
Applied egg-rr83.3%
if 1.69999999999999987e-7 < F Initial program 58.7%
Taylor expanded in F around inf 99.7%
Final simplification91.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (* (sin B) (sqrt 2.0)))) (t_1 (/ (* (cos B) (- x)) (sin B))))
(if (<= F -2.3e-12)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -9.2e-66)
t_0
(if (<= F 2.7e-135)
t_1
(if (<= F 1.45e-7)
t_0
(if (<= F 7e+163)
t_1
(-
(/ 1.0 (sin B))
(+ (/ x B) (* -0.3333333333333333 (* B x)))))))))))
double code(double F, double B, double x) {
double t_0 = F / (sin(B) * sqrt(2.0));
double t_1 = (cos(B) * -x) / sin(B);
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -9.2e-66) {
tmp = t_0;
} else if (F <= 2.7e-135) {
tmp = t_1;
} else if (F <= 1.45e-7) {
tmp = t_0;
} else if (F <= 7e+163) {
tmp = t_1;
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = f / (sin(b) * sqrt(2.0d0))
t_1 = (cos(b) * -x) / sin(b)
if (f <= (-2.3d-12)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-9.2d-66)) then
tmp = t_0
else if (f <= 2.7d-135) then
tmp = t_1
else if (f <= 1.45d-7) then
tmp = t_0
else if (f <= 7d+163) then
tmp = t_1
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F / (Math.sin(B) * Math.sqrt(2.0));
double t_1 = (Math.cos(B) * -x) / Math.sin(B);
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -9.2e-66) {
tmp = t_0;
} else if (F <= 2.7e-135) {
tmp = t_1;
} else if (F <= 1.45e-7) {
tmp = t_0;
} else if (F <= 7e+163) {
tmp = t_1;
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): t_0 = F / (math.sin(B) * math.sqrt(2.0)) t_1 = (math.cos(B) * -x) / math.sin(B) tmp = 0 if F <= -2.3e-12: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -9.2e-66: tmp = t_0 elif F <= 2.7e-135: tmp = t_1 elif F <= 1.45e-7: tmp = t_0 elif F <= 7e+163: tmp = t_1 else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) t_0 = Float64(F / Float64(sin(B) * sqrt(2.0))) t_1 = Float64(Float64(cos(B) * Float64(-x)) / sin(B)) tmp = 0.0 if (F <= -2.3e-12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -9.2e-66) tmp = t_0; elseif (F <= 2.7e-135) tmp = t_1; elseif (F <= 1.45e-7) tmp = t_0; elseif (F <= 7e+163) tmp = t_1; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F / (sin(B) * sqrt(2.0)); t_1 = (cos(B) * -x) / sin(B); tmp = 0.0; if (F <= -2.3e-12) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -9.2e-66) tmp = t_0; elseif (F <= 2.7e-135) tmp = t_1; elseif (F <= 1.45e-7) tmp = t_0; elseif (F <= 7e+163) tmp = t_1; else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.2e-66], t$95$0, If[LessEqual[F, 2.7e-135], t$95$1, If[LessEqual[F, 1.45e-7], t$95$0, If[LessEqual[F, 7e+163], t$95$1, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B \cdot \sqrt{2}}\\
t_1 := \frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -9.2 \cdot 10^{-66}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -2.29999999999999989e-12Initial program 47.4%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 82.8%
if -2.29999999999999989e-12 < F < -9.19999999999999967e-66 or 2.69999999999999999e-135 < F < 1.4499999999999999e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 78.0%
expm1-log1p-u57.2%
expm1-udef20.1%
*-commutative20.1%
sqrt-div20.1%
metadata-eval20.1%
frac-times20.1%
*-un-lft-identity20.1%
fma-def20.1%
Applied egg-rr20.1%
expm1-def57.3%
expm1-log1p78.0%
Simplified78.0%
Taylor expanded in x around 0 78.0%
if -9.19999999999999967e-66 < F < 2.69999999999999999e-135 or 1.4499999999999999e-7 < F < 7.0000000000000005e163Initial program 96.9%
Taylor expanded in F around -inf 47.2%
Taylor expanded in x around inf 79.3%
mul-1-neg79.3%
*-commutative79.3%
Simplified79.3%
if 7.0000000000000005e163 < F Initial program 24.5%
Taylor expanded in B around 0 14.0%
*-commutative22.9%
Simplified14.0%
Taylor expanded in F around inf 61.8%
Final simplification77.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (* (sin B) (sqrt 2.0)))) (t_1 (/ (* (cos B) (- x)) (sin B))))
(if (<= F -2.3e-12)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -2.25e-63)
t_0
(if (<= F 2.8e-135)
t_1
(if (<= F 1.6e-7)
t_0
(if (<= F 7e+163)
t_1
(-
(/ 1.0 (sin B))
(+ (/ x B) (* -0.3333333333333333 (* B x)))))))))))
double code(double F, double B, double x) {
double t_0 = F / (sin(B) * sqrt(2.0));
double t_1 = (cos(B) * -x) / sin(B);
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -2.25e-63) {
tmp = t_0;
} else if (F <= 2.8e-135) {
tmp = t_1;
} else if (F <= 1.6e-7) {
tmp = t_0;
} else if (F <= 7e+163) {
tmp = t_1;
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = f / (sin(b) * sqrt(2.0d0))
t_1 = (cos(b) * -x) / sin(b)
if (f <= (-2.3d-12)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-2.25d-63)) then
tmp = t_0
else if (f <= 2.8d-135) then
tmp = t_1
else if (f <= 1.6d-7) then
tmp = t_0
else if (f <= 7d+163) then
tmp = t_1
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F / (Math.sin(B) * Math.sqrt(2.0));
double t_1 = (Math.cos(B) * -x) / Math.sin(B);
double tmp;
if (F <= -2.3e-12) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -2.25e-63) {
tmp = t_0;
} else if (F <= 2.8e-135) {
tmp = t_1;
} else if (F <= 1.6e-7) {
tmp = t_0;
} else if (F <= 7e+163) {
tmp = t_1;
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): t_0 = F / (math.sin(B) * math.sqrt(2.0)) t_1 = (math.cos(B) * -x) / math.sin(B) tmp = 0 if F <= -2.3e-12: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -2.25e-63: tmp = t_0 elif F <= 2.8e-135: tmp = t_1 elif F <= 1.6e-7: tmp = t_0 elif F <= 7e+163: tmp = t_1 else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) t_0 = Float64(F / Float64(sin(B) * sqrt(2.0))) t_1 = Float64(Float64(cos(B) * Float64(-x)) / sin(B)) tmp = 0.0 if (F <= -2.3e-12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -2.25e-63) tmp = t_0; elseif (F <= 2.8e-135) tmp = t_1; elseif (F <= 1.6e-7) tmp = t_0; elseif (F <= 7e+163) tmp = t_1; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F / (sin(B) * sqrt(2.0)); t_1 = (cos(B) * -x) / sin(B); tmp = 0.0; if (F <= -2.3e-12) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -2.25e-63) tmp = t_0; elseif (F <= 2.8e-135) tmp = t_1; elseif (F <= 1.6e-7) tmp = t_0; elseif (F <= 7e+163) tmp = t_1; else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.25e-63], t$95$0, If[LessEqual[F, 2.8e-135], t$95$1, If[LessEqual[F, 1.6e-7], t$95$0, If[LessEqual[F, 7e+163], t$95$1, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B \cdot \sqrt{2}}\\
t_1 := \frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -2.25 \cdot 10^{-63}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-7}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -2.29999999999999989e-12Initial program 47.4%
Taylor expanded in F around -inf 98.4%
expm1-log1p-u38.5%
expm1-udef38.4%
div-inv38.4%
neg-mul-138.4%
fma-def38.4%
Applied egg-rr38.4%
expm1-def38.5%
expm1-log1p98.5%
rem-log-exp40.6%
fma-udef40.6%
neg-mul-140.6%
prod-exp39.9%
*-commutative39.9%
prod-exp40.6%
rem-log-exp98.5%
unsub-neg98.5%
Simplified98.5%
if -2.29999999999999989e-12 < F < -2.25e-63 or 2.80000000000000023e-135 < F < 1.6e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 78.0%
expm1-log1p-u57.2%
expm1-udef20.1%
*-commutative20.1%
sqrt-div20.1%
metadata-eval20.1%
frac-times20.1%
*-un-lft-identity20.1%
fma-def20.1%
Applied egg-rr20.1%
expm1-def57.3%
expm1-log1p78.0%
Simplified78.0%
Taylor expanded in x around 0 78.0%
if -2.25e-63 < F < 2.80000000000000023e-135 or 1.6e-7 < F < 7.0000000000000005e163Initial program 96.9%
Taylor expanded in F around -inf 47.2%
Taylor expanded in x around inf 79.3%
mul-1-neg79.3%
*-commutative79.3%
Simplified79.3%
if 7.0000000000000005e163 < F Initial program 24.5%
Taylor expanded in B around 0 14.0%
*-commutative22.9%
Simplified14.0%
Taylor expanded in F around inf 61.8%
Final simplification82.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (* (sin B) (sqrt 2.0)))))
(if (<= F -1.3e-15)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.62e-65)
t_0
(if (<= F 2.8e-135)
(* (cos B) (/ -1.0 (/ (sin B) x)))
(if (<= F 4.5e-12)
t_0
(if (<= F 7e+163)
(/ (* (cos B) (- x)) (sin B))
(-
(/ 1.0 (sin B))
(+ (/ x B) (* -0.3333333333333333 (* B x)))))))))))
double code(double F, double B, double x) {
double t_0 = F / (sin(B) * sqrt(2.0));
double tmp;
if (F <= -1.3e-15) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.62e-65) {
tmp = t_0;
} else if (F <= 2.8e-135) {
tmp = cos(B) * (-1.0 / (sin(B) / x));
} else if (F <= 4.5e-12) {
tmp = t_0;
} else if (F <= 7e+163) {
tmp = (cos(B) * -x) / sin(B);
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
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 / (sin(b) * sqrt(2.0d0))
if (f <= (-1.3d-15)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.62d-65)) then
tmp = t_0
else if (f <= 2.8d-135) then
tmp = cos(b) * ((-1.0d0) / (sin(b) / x))
else if (f <= 4.5d-12) then
tmp = t_0
else if (f <= 7d+163) then
tmp = (cos(b) * -x) / sin(b)
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F / (Math.sin(B) * Math.sqrt(2.0));
double tmp;
if (F <= -1.3e-15) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.62e-65) {
tmp = t_0;
} else if (F <= 2.8e-135) {
tmp = Math.cos(B) * (-1.0 / (Math.sin(B) / x));
} else if (F <= 4.5e-12) {
tmp = t_0;
} else if (F <= 7e+163) {
tmp = (Math.cos(B) * -x) / Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): t_0 = F / (math.sin(B) * math.sqrt(2.0)) tmp = 0 if F <= -1.3e-15: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.62e-65: tmp = t_0 elif F <= 2.8e-135: tmp = math.cos(B) * (-1.0 / (math.sin(B) / x)) elif F <= 4.5e-12: tmp = t_0 elif F <= 7e+163: tmp = (math.cos(B) * -x) / math.sin(B) else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) t_0 = Float64(F / Float64(sin(B) * sqrt(2.0))) tmp = 0.0 if (F <= -1.3e-15) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.62e-65) tmp = t_0; elseif (F <= 2.8e-135) tmp = Float64(cos(B) * Float64(-1.0 / Float64(sin(B) / x))); elseif (F <= 4.5e-12) tmp = t_0; elseif (F <= 7e+163) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F / (sin(B) * sqrt(2.0)); tmp = 0.0; if (F <= -1.3e-15) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.62e-65) tmp = t_0; elseif (F <= 2.8e-135) tmp = cos(B) * (-1.0 / (sin(B) / x)); elseif (F <= 4.5e-12) tmp = t_0; elseif (F <= 7e+163) tmp = (cos(B) * -x) / sin(B); else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.3e-15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.62e-65], t$95$0, If[LessEqual[F, 2.8e-135], N[(N[Cos[B], $MachinePrecision] * N[(-1.0 / N[(N[Sin[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e-12], t$95$0, If[LessEqual[F, 7e+163], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B \cdot \sqrt{2}}\\
\mathbf{if}\;F \leq -1.3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.62 \cdot 10^{-65}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-135}:\\
\;\;\;\;\cos B \cdot \frac{-1}{\frac{\sin B}{x}}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-12}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+163}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -1.30000000000000002e-15Initial program 47.4%
Taylor expanded in F around -inf 98.4%
expm1-log1p-u38.5%
expm1-udef38.4%
div-inv38.4%
neg-mul-138.4%
fma-def38.4%
Applied egg-rr38.4%
expm1-def38.5%
expm1-log1p98.5%
rem-log-exp40.6%
fma-udef40.6%
neg-mul-140.6%
prod-exp39.9%
*-commutative39.9%
prod-exp40.6%
rem-log-exp98.5%
unsub-neg98.5%
Simplified98.5%
if -1.30000000000000002e-15 < F < -1.6200000000000001e-65 or 2.80000000000000023e-135 < F < 4.49999999999999981e-12Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 78.0%
expm1-log1p-u57.2%
expm1-udef20.1%
*-commutative20.1%
sqrt-div20.1%
metadata-eval20.1%
frac-times20.1%
*-un-lft-identity20.1%
fma-def20.1%
Applied egg-rr20.1%
expm1-def57.3%
expm1-log1p78.0%
Simplified78.0%
Taylor expanded in x around 0 78.0%
if -1.6200000000000001e-65 < F < 2.80000000000000023e-135Initial program 99.5%
Taylor expanded in F around -inf 37.5%
Taylor expanded in x around inf 83.3%
mul-1-neg83.3%
associate-/l*83.2%
distribute-neg-frac83.2%
Simplified83.2%
div-inv83.3%
Applied egg-rr83.3%
if 4.49999999999999981e-12 < F < 7.0000000000000005e163Initial program 91.0%
Taylor expanded in F around -inf 69.2%
Taylor expanded in x around inf 70.2%
mul-1-neg70.2%
*-commutative70.2%
Simplified70.2%
if 7.0000000000000005e163 < F Initial program 24.5%
Taylor expanded in B around 0 14.0%
*-commutative22.9%
Simplified14.0%
Taylor expanded in F around inf 61.8%
Final simplification82.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (/ x B) (* -0.3333333333333333 (* B x)))))
(if (<= F -7.2e-19)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -2.2e-208)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) t_0)
(if (<= F 5.6e-304)
(- (* (/ F B) (/ -1.0 F)) (* x (/ 1.0 (tan B))))
(if (<= F 1.7e-7)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(- (/ 1.0 (sin B)) t_0)))))))
double code(double F, double B, double x) {
double t_0 = (x / B) + (-0.3333333333333333 * (B * x));
double tmp;
if (F <= -7.2e-19) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -2.2e-208) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_0;
} else if (F <= 5.6e-304) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B)));
} else if (F <= 1.7e-7) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / 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 / b) + ((-0.3333333333333333d0) * (b * x))
if (f <= (-7.2d-19)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-2.2d-208)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - t_0
else if (f <= 5.6d-304) then
tmp = ((f / b) * ((-1.0d0) / f)) - (x * (1.0d0 / tan(b)))
else if (f <= 1.7d-7) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / 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 / B) + (-0.3333333333333333 * (B * x));
double tmp;
if (F <= -7.2e-19) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -2.2e-208) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_0;
} else if (F <= 5.6e-304) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / Math.tan(B)));
} else if (F <= 1.7e-7) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (x / B) + (-0.3333333333333333 * (B * x)) tmp = 0 if F <= -7.2e-19: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -2.2e-208: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - t_0 elif F <= 5.6e-304: tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / math.tan(B))) elif F <= 1.7e-7: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x))) tmp = 0.0 if (F <= -7.2e-19) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -2.2e-208) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - t_0); elseif (F <= 5.6e-304) tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 1.7e-7) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / 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 / B) + (-0.3333333333333333 * (B * x)); tmp = 0.0; if (F <= -7.2e-19) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -2.2e-208) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - t_0; elseif (F <= 5.6e-304) tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B))); elseif (F <= 1.7e-7) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.2e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.2e-208], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.6e-304], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.2 \cdot 10^{-208}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t_0\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-304}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -7.2000000000000002e-19Initial program 48.0%
Taylor expanded in F around -inf 97.2%
Taylor expanded in B around 0 81.8%
if -7.2000000000000002e-19 < F < -2.2e-208Initial program 99.4%
Taylor expanded in B around 0 62.8%
*-commutative21.3%
Simplified62.8%
Taylor expanded in B around 0 50.0%
if -2.2e-208 < F < 5.5999999999999997e-304Initial program 99.6%
Taylor expanded in F around -inf 39.4%
Taylor expanded in B around 0 79.3%
if 5.5999999999999997e-304 < F < 1.69999999999999987e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 57.4%
if 1.69999999999999987e-7 < F Initial program 58.7%
Taylor expanded in B around 0 32.3%
*-commutative30.8%
Simplified32.3%
Taylor expanded in F around inf 59.9%
Final simplification65.9%
(FPCore (F B x)
:precision binary64
(if (<= F -5.4e-42)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 3.1e-304)
(- (* (/ F B) (/ -1.0 F)) (* x (/ 1.0 (tan B))))
(if (<= F 4.6e-8)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.4e-42) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 3.1e-304) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B)));
} else if (F <= 4.6e-8) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (-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 <= (-5.4d-42)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 3.1d-304) then
tmp = ((f / b) * ((-1.0d0) / f)) - (x * (1.0d0 / tan(b)))
else if (f <= 4.6d-8) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.4e-42) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 3.1e-304) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / Math.tan(B)));
} else if (F <= 4.6e-8) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.4e-42: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 3.1e-304: tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / math.tan(B))) elif F <= 4.6e-8: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.4e-42) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 3.1e-304) tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 4.6e-8) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.4e-42) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 3.1e-304) tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B))); elseif (F <= 4.6e-8) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.4e-42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-304], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.6e-8], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.4 \cdot 10^{-42}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-304}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\end{array}
\end{array}
if F < -5.39999999999999998e-42Initial program 50.0%
Taylor expanded in F around -inf 93.7%
Taylor expanded in B around 0 78.9%
if -5.39999999999999998e-42 < F < 3.09999999999999985e-304Initial program 99.5%
Taylor expanded in F around -inf 34.8%
Taylor expanded in B around 0 55.9%
if 3.09999999999999985e-304 < F < 4.6000000000000002e-8Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 57.4%
if 4.6000000000000002e-8 < F Initial program 58.7%
Taylor expanded in F around -inf 51.4%
Taylor expanded in B around 0 52.1%
Final simplification62.2%
(FPCore (F B x)
:precision binary64
(if (<= F -3.2e-42)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.6e-304)
(- (* (/ F B) (/ -1.0 F)) (* x (/ 1.0 (tan B))))
(if (<= F 1.7e-7)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(- (/ 1.0 (sin B)) (+ (/ x B) (* -0.3333333333333333 (* B x))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-42) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.6e-304) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B)));
} else if (F <= 1.7e-7) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
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.2d-42)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.6d-304) then
tmp = ((f / b) * ((-1.0d0) / f)) - (x * (1.0d0 / tan(b)))
else if (f <= 1.7d-7) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-42) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.6e-304) {
tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / Math.tan(B)));
} else if (F <= 1.7e-7) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.2e-42: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.6e-304: tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / math.tan(B))) elif F <= 1.7e-7: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.2e-42) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.6e-304) tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - Float64(x * Float64(1.0 / tan(B)))); elseif (F <= 1.7e-7) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.2e-42) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.6e-304) tmp = ((F / B) * (-1.0 / F)) - (x * (1.0 / tan(B))); elseif (F <= 1.7e-7) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-304], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-42}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-304}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - x \cdot \frac{1}{\tan B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -3.20000000000000025e-42Initial program 50.0%
Taylor expanded in F around -inf 93.7%
Taylor expanded in B around 0 78.9%
if -3.20000000000000025e-42 < F < 1.59999999999999999e-304Initial program 99.5%
Taylor expanded in F around -inf 34.8%
Taylor expanded in B around 0 55.9%
if 1.59999999999999999e-304 < F < 1.69999999999999987e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 57.4%
if 1.69999999999999987e-7 < F Initial program 58.7%
Taylor expanded in B around 0 32.3%
*-commutative30.8%
Simplified32.3%
Taylor expanded in F around inf 59.9%
Final simplification64.3%
(FPCore (F B x)
:precision binary64
(if (<= F -3.8e-19)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F -4.2e-60) (and (not (<= F 6.2e-92)) (<= F 5.2e-15)))
(/ F (* B (sqrt (+ 2.0 (* x 2.0)))))
(- (/ (- x) B) (* -0.3333333333333333 (* B x))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e-19) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= -4.2e-60) || (!(F <= 6.2e-92) && (F <= 5.2e-15))) {
tmp = F / (B * sqrt((2.0 + (x * 2.0))));
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
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-19)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= (-4.2d-60)) .or. (.not. (f <= 6.2d-92)) .and. (f <= 5.2d-15)) then
tmp = f / (b * sqrt((2.0d0 + (x * 2.0d0))))
else
tmp = (-x / b) - ((-0.3333333333333333d0) * (b * x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e-19) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= -4.2e-60) || (!(F <= 6.2e-92) && (F <= 5.2e-15))) {
tmp = F / (B * Math.sqrt((2.0 + (x * 2.0))));
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.8e-19: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= -4.2e-60) or (not (F <= 6.2e-92) and (F <= 5.2e-15)): tmp = F / (B * math.sqrt((2.0 + (x * 2.0)))) else: tmp = (-x / B) - (-0.3333333333333333 * (B * x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.8e-19) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= -4.2e-60) || (!(F <= 6.2e-92) && (F <= 5.2e-15))) tmp = Float64(F / Float64(B * sqrt(Float64(2.0 + Float64(x * 2.0))))); else tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.3333333333333333 * Float64(B * x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.8e-19) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= -4.2e-60) || (~((F <= 6.2e-92)) && (F <= 5.2e-15))) tmp = F / (B * sqrt((2.0 + (x * 2.0)))); else tmp = (-x / B) - (-0.3333333333333333 * (B * x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.8e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -4.2e-60], And[N[Not[LessEqual[F, 6.2e-92]], $MachinePrecision], LessEqual[F, 5.2e-15]]], N[(F / N[(B * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -4.2 \cdot 10^{-60} \lor \neg \left(F \leq 6.2 \cdot 10^{-92}\right) \land F \leq 5.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\end{array}
\end{array}
if F < -3.8e-19Initial program 48.0%
Taylor expanded in F around -inf 97.2%
Taylor expanded in B around 0 81.8%
if -3.8e-19 < F < -4.19999999999999982e-60 or 6.2000000000000002e-92 < F < 5.20000000000000009e-15Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.5%
Taylor expanded in F around 0 99.5%
Taylor expanded in F around inf 80.8%
expm1-log1p-u52.5%
expm1-udef23.0%
*-commutative23.0%
sqrt-div23.0%
metadata-eval23.0%
frac-times23.0%
*-un-lft-identity23.0%
fma-def23.0%
Applied egg-rr23.0%
expm1-def52.4%
expm1-log1p80.8%
Simplified80.8%
Taylor expanded in B around 0 55.1%
if -4.19999999999999982e-60 < F < 6.2000000000000002e-92 or 5.20000000000000009e-15 < F Initial program 81.7%
Taylor expanded in F around -inf 42.8%
Taylor expanded in x around inf 67.2%
mul-1-neg67.2%
associate-/l*67.2%
distribute-neg-frac67.2%
Simplified67.2%
Taylor expanded in B around 0 38.2%
distribute-lft-out38.2%
distribute-rgt-out--38.2%
metadata-eval38.2%
*-commutative38.2%
associate-*r*38.2%
neg-mul-138.2%
remove-double-neg38.2%
remove-double-neg38.2%
*-commutative38.2%
*-commutative38.2%
Simplified38.2%
Final simplification52.5%
(FPCore (F B x)
:precision binary64
(if (<= F -4.4e-19)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F -4.8e-65) (and (not (<= F 1.95e-77)) (<= F 0.000225)))
(/ F (* B (sqrt (+ 2.0 (* x 2.0)))))
(+ (* x (/ -1.0 (tan B))) (* B -0.16666666666666666)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.4e-19) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= -4.8e-65) || (!(F <= 1.95e-77) && (F <= 0.000225))) {
tmp = F / (B * sqrt((2.0 + (x * 2.0))));
} else {
tmp = (x * (-1.0 / tan(B))) + (B * -0.16666666666666666);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.4d-19)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= (-4.8d-65)) .or. (.not. (f <= 1.95d-77)) .and. (f <= 0.000225d0)) then
tmp = f / (b * sqrt((2.0d0 + (x * 2.0d0))))
else
tmp = (x * ((-1.0d0) / tan(b))) + (b * (-0.16666666666666666d0))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.4e-19) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= -4.8e-65) || (!(F <= 1.95e-77) && (F <= 0.000225))) {
tmp = F / (B * Math.sqrt((2.0 + (x * 2.0))));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (B * -0.16666666666666666);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.4e-19: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= -4.8e-65) or (not (F <= 1.95e-77) and (F <= 0.000225)): tmp = F / (B * math.sqrt((2.0 + (x * 2.0)))) else: tmp = (x * (-1.0 / math.tan(B))) + (B * -0.16666666666666666) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.4e-19) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= -4.8e-65) || (!(F <= 1.95e-77) && (F <= 0.000225))) tmp = Float64(F / Float64(B * sqrt(Float64(2.0 + Float64(x * 2.0))))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(B * -0.16666666666666666)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.4e-19) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= -4.8e-65) || (~((F <= 1.95e-77)) && (F <= 0.000225))) tmp = F / (B * sqrt((2.0 + (x * 2.0)))); else tmp = (x * (-1.0 / tan(B))) + (B * -0.16666666666666666); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.4e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -4.8e-65], And[N[Not[LessEqual[F, 1.95e-77]], $MachinePrecision], LessEqual[F, 0.000225]]], N[(F / N[(B * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(B * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.4 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -4.8 \cdot 10^{-65} \lor \neg \left(F \leq 1.95 \cdot 10^{-77}\right) \land F \leq 0.000225:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + B \cdot -0.16666666666666666\\
\end{array}
\end{array}
if F < -4.3999999999999997e-19Initial program 48.0%
Taylor expanded in F around -inf 97.2%
Taylor expanded in B around 0 81.8%
if -4.3999999999999997e-19 < F < -4.8000000000000003e-65 or 1.9499999999999999e-77 < F < 2.2499999999999999e-4Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.4%
Taylor expanded in F around 0 99.4%
Taylor expanded in F around inf 86.2%
expm1-log1p-u52.7%
expm1-udef26.6%
*-commutative26.6%
sqrt-div26.6%
metadata-eval26.6%
frac-times26.6%
*-un-lft-identity26.6%
fma-def26.6%
Applied egg-rr26.6%
expm1-def52.8%
expm1-log1p86.3%
Simplified86.3%
Taylor expanded in B around 0 64.3%
if -4.8000000000000003e-65 < F < 1.9499999999999999e-77 or 2.2499999999999999e-4 < F Initial program 82.2%
Taylor expanded in F around -inf 41.8%
Taylor expanded in B around 0 30.7%
Taylor expanded in B around inf 41.2%
*-commutative41.2%
Simplified41.2%
Final simplification54.9%
(FPCore (F B x)
:precision binary64
(if (<= F -7.2e-19)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.5e-7)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-19) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.5e-7) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (-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 <= (-7.2d-19)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.5d-7) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-19) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.5e-7) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.2e-19: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.5e-7: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.2e-19) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.5e-7) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.2e-19) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.5e-7) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.2e-19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e-7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{-19}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\end{array}
\end{array}
if F < -7.2000000000000002e-19Initial program 48.0%
Taylor expanded in F around -inf 97.2%
Taylor expanded in B around 0 81.8%
if -7.2000000000000002e-19 < F < 1.4999999999999999e-7Initial program 99.5%
distribute-lft-neg-in99.5%
+-commutative99.5%
cancel-sign-sub-inv99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 51.9%
if 1.4999999999999999e-7 < F Initial program 58.7%
Taylor expanded in F around -inf 51.4%
Taylor expanded in B around 0 52.1%
Final simplification60.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))))
(if (<= x -0.52)
t_0
(if (<= x -1.26e-27)
(/ (- x) B)
(if (<= x 4.4e-41) (/ -1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B);
double tmp;
if (x <= -0.52) {
tmp = t_0;
} else if (x <= -1.26e-27) {
tmp = -x / B;
} else if (x <= 4.4e-41) {
tmp = -1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
if (x <= (-0.52d0)) then
tmp = t_0
else if (x <= (-1.26d-27)) then
tmp = -x / b
else if (x <= 4.4d-41) then
tmp = (-1.0d0) / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
double tmp;
if (x <= -0.52) {
tmp = t_0;
} else if (x <= -1.26e-27) {
tmp = -x / B;
} else if (x <= 4.4e-41) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (x * (-1.0 / math.tan(B))) + (-1.0 / B) tmp = 0 if x <= -0.52: tmp = t_0 elif x <= -1.26e-27: tmp = -x / B elif x <= 4.4e-41: tmp = -1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)) tmp = 0.0 if (x <= -0.52) tmp = t_0; elseif (x <= -1.26e-27) tmp = Float64(Float64(-x) / B); elseif (x <= 4.4e-41) tmp = Float64(-1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (x * (-1.0 / tan(B))) + (-1.0 / B); tmp = 0.0; if (x <= -0.52) tmp = t_0; elseif (x <= -1.26e-27) tmp = -x / B; elseif (x <= 4.4e-41) tmp = -1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.52], t$95$0, If[LessEqual[x, -1.26e-27], N[((-x) / B), $MachinePrecision], If[LessEqual[x, 4.4e-41], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{if}\;x \leq -0.52:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.26 \cdot 10^{-27}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-41}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if x < -0.52000000000000002 or 4.4e-41 < x Initial program 84.6%
Taylor expanded in F around -inf 95.4%
Taylor expanded in B around 0 96.5%
if -0.52000000000000002 < x < -1.2599999999999999e-27Initial program 85.9%
Taylor expanded in F around -inf 0.9%
Taylor expanded in x around inf 87.0%
mul-1-neg87.0%
associate-/l*86.3%
distribute-neg-frac86.3%
Simplified86.3%
Taylor expanded in B around 0 86.2%
associate-*r/86.2%
neg-mul-186.2%
Simplified86.2%
if -1.2599999999999999e-27 < x < 4.4e-41Initial program 66.3%
Taylor expanded in F around -inf 33.5%
Taylor expanded in B around 0 25.7%
*-commutative25.7%
Simplified25.7%
Taylor expanded in x around 0 33.5%
Final simplification58.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.95e-61) (- (/ -1.0 (sin B)) (/ x B)) (- (/ (- x) B) (* -0.3333333333333333 (* B x)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e-61) {
tmp = (-1.0 / sin(B)) - (x / B);
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
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.95d-61)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else
tmp = (-x / b) - ((-0.3333333333333333d0) * (b * x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e-61) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.95e-61: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = (-x / B) - (-0.3333333333333333 * (B * x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.95e-61) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.3333333333333333 * Float64(B * x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.95e-61) tmp = (-1.0 / sin(B)) - (x / B); else tmp = (-x / B) - (-0.3333333333333333 * (B * x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.95e-61], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{-61}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\end{array}
\end{array}
if F < -1.95000000000000016e-61Initial program 54.2%
Taylor expanded in F around -inf 87.6%
Taylor expanded in B around 0 73.0%
if -1.95000000000000016e-61 < F Initial program 83.4%
Taylor expanded in F around -inf 40.6%
Taylor expanded in x around inf 63.6%
mul-1-neg63.6%
associate-/l*63.5%
distribute-neg-frac63.5%
Simplified63.5%
Taylor expanded in B around 0 35.6%
distribute-lft-out35.6%
distribute-rgt-out--35.6%
metadata-eval35.6%
*-commutative35.6%
associate-*r*35.6%
neg-mul-135.6%
remove-double-neg35.6%
remove-double-neg35.6%
*-commutative35.6%
*-commutative35.6%
Simplified35.6%
Final simplification47.9%
(FPCore (F B x) :precision binary64 (if (<= F -2.35e-11) (/ -1.0 (sin B)) (- (/ (- x) B) (* -0.3333333333333333 (* B x)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-11) {
tmp = -1.0 / sin(B);
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
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.35d-11)) then
tmp = (-1.0d0) / sin(b)
else
tmp = (-x / b) - ((-0.3333333333333333d0) * (b * x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-11) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.35e-11: tmp = -1.0 / math.sin(B) else: tmp = (-x / B) - (-0.3333333333333333 * (B * x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.35e-11) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.3333333333333333 * Float64(B * x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.35e-11) tmp = -1.0 / sin(B); else tmp = (-x / B) - (-0.3333333333333333 * (B * x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.35e-11], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.35 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\end{array}
\end{array}
if F < -2.34999999999999996e-11Initial program 46.6%
Taylor expanded in F around -inf 98.4%
Taylor expanded in B around 0 65.9%
*-commutative65.9%
Simplified65.9%
Taylor expanded in x around 0 67.9%
if -2.34999999999999996e-11 < F Initial program 84.4%
Taylor expanded in F around -inf 39.5%
Taylor expanded in x around inf 60.7%
mul-1-neg60.7%
associate-/l*60.7%
distribute-neg-frac60.7%
Simplified60.7%
Taylor expanded in B around 0 34.1%
distribute-lft-out34.1%
distribute-rgt-out--34.1%
metadata-eval34.1%
*-commutative34.1%
associate-*r*34.1%
neg-mul-134.1%
remove-double-neg34.1%
remove-double-neg34.1%
*-commutative34.1%
*-commutative34.1%
Simplified34.1%
Final simplification43.6%
(FPCore (F B x) :precision binary64 (if (<= F -7.2e-59) (/ (- -1.0 x) B) (- (/ (- x) B) (* -0.3333333333333333 (* B x)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-59) {
tmp = (-1.0 - x) / B;
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
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.2d-59)) then
tmp = ((-1.0d0) - x) / b
else
tmp = (-x / b) - ((-0.3333333333333333d0) * (b * x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-59) {
tmp = (-1.0 - x) / B;
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.2e-59: tmp = (-1.0 - x) / B else: tmp = (-x / B) - (-0.3333333333333333 * (B * x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.2e-59) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.3333333333333333 * Float64(B * x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.2e-59) tmp = (-1.0 - x) / B; else tmp = (-x / B) - (-0.3333333333333333 * (B * x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.2e-59], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{-59}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\end{array}
\end{array}
if F < -7.20000000000000001e-59Initial program 53.6%
Taylor expanded in F around -inf 88.6%
Taylor expanded in B around 0 45.5%
Taylor expanded in B around 0 45.3%
associate-*r/45.3%
distribute-lft-in45.3%
metadata-eval45.3%
neg-mul-145.3%
unsub-neg45.3%
Simplified45.3%
if -7.20000000000000001e-59 < F Initial program 83.5%
Taylor expanded in F around -inf 40.4%
Taylor expanded in x around inf 63.2%
mul-1-neg63.2%
associate-/l*63.2%
distribute-neg-frac63.2%
Simplified63.2%
Taylor expanded in B around 0 35.4%
distribute-lft-out35.4%
distribute-rgt-out--35.4%
metadata-eval35.4%
*-commutative35.4%
associate-*r*35.4%
neg-mul-135.4%
remove-double-neg35.4%
remove-double-neg35.4%
*-commutative35.4%
*-commutative35.4%
Simplified35.4%
Final simplification38.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.15e-58) (+ (* B -0.16666666666666666) (/ (- -1.0 x) B)) (- (/ (- x) B) (* -0.3333333333333333 (* B x)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-58) {
tmp = (B * -0.16666666666666666) + ((-1.0 - x) / B);
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
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-58)) then
tmp = (b * (-0.16666666666666666d0)) + (((-1.0d0) - x) / b)
else
tmp = (-x / b) - ((-0.3333333333333333d0) * (b * x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-58) {
tmp = (B * -0.16666666666666666) + ((-1.0 - x) / B);
} else {
tmp = (-x / B) - (-0.3333333333333333 * (B * x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.15e-58: tmp = (B * -0.16666666666666666) + ((-1.0 - x) / B) else: tmp = (-x / B) - (-0.3333333333333333 * (B * x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.15e-58) tmp = Float64(Float64(B * -0.16666666666666666) + Float64(Float64(-1.0 - x) / B)); else tmp = Float64(Float64(Float64(-x) / B) - Float64(-0.3333333333333333 * Float64(B * x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.15e-58) tmp = (B * -0.16666666666666666) + ((-1.0 - x) / B); else tmp = (-x / B) - (-0.3333333333333333 * (B * x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.15e-58], N[(N[(B * -0.16666666666666666), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / B), $MachinePrecision] - N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{-58}:\\
\;\;\;\;B \cdot -0.16666666666666666 + \frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B} - -0.3333333333333333 \cdot \left(B \cdot x\right)\\
\end{array}
\end{array}
if F < -1.1499999999999999e-58Initial program 53.6%
Taylor expanded in F around -inf 88.6%
Taylor expanded in B around 0 45.5%
Taylor expanded in x around 0 45.7%
*-commutative45.7%
Simplified45.7%
if -1.1499999999999999e-58 < F Initial program 83.5%
Taylor expanded in F around -inf 40.4%
Taylor expanded in x around inf 63.2%
mul-1-neg63.2%
associate-/l*63.2%
distribute-neg-frac63.2%
Simplified63.2%
Taylor expanded in B around 0 35.4%
distribute-lft-out35.4%
distribute-rgt-out--35.4%
metadata-eval35.4%
*-commutative35.4%
associate-*r*35.4%
neg-mul-135.4%
remove-double-neg35.4%
remove-double-neg35.4%
*-commutative35.4%
*-commutative35.4%
Simplified35.4%
Final simplification38.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.25e-57) (/ (- -1.0 x) B) (* x (+ (* B 0.3333333333333333) (/ -1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-57) {
tmp = (-1.0 - x) / B;
} else {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.25d-57)) then
tmp = ((-1.0d0) - x) / b
else
tmp = x * ((b * 0.3333333333333333d0) + ((-1.0d0) / b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-57) {
tmp = (-1.0 - x) / B;
} else {
tmp = x * ((B * 0.3333333333333333) + (-1.0 / B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e-57: tmp = (-1.0 - x) / B else: tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e-57) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(x * Float64(Float64(B * 0.3333333333333333) + Float64(-1.0 / B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.25e-57) tmp = (-1.0 - x) / B; else tmp = x * ((B * 0.3333333333333333) + (-1.0 / B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-57], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x * N[(N[(B * 0.3333333333333333), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333 + \frac{-1}{B}\right)\\
\end{array}
\end{array}
if F < -1.25e-57Initial program 53.6%
Taylor expanded in F around -inf 88.6%
Taylor expanded in B around 0 45.5%
Taylor expanded in B around 0 45.3%
associate-*r/45.3%
distribute-lft-in45.3%
metadata-eval45.3%
neg-mul-145.3%
unsub-neg45.3%
Simplified45.3%
if -1.25e-57 < F Initial program 83.5%
Taylor expanded in F around -inf 40.4%
Taylor expanded in B around 0 24.3%
Taylor expanded in x around inf 35.3%
Final simplification38.5%
(FPCore (F B x) :precision binary64 (if (<= F -1.95e-53) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e-53) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.95d-53)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e-53) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.95e-53: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.95e-53) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.95e-53) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.95e-53], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{-53}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.9500000000000001e-53Initial program 52.5%
Taylor expanded in F around -inf 90.6%
Taylor expanded in B around 0 46.5%
Taylor expanded in B around 0 46.3%
associate-*r/46.3%
distribute-lft-in46.3%
metadata-eval46.3%
neg-mul-146.3%
unsub-neg46.3%
Simplified46.3%
if -1.9500000000000001e-53 < F Initial program 83.6%
Taylor expanded in F around -inf 40.1%
Taylor expanded in x around inf 62.6%
mul-1-neg62.6%
associate-/l*62.5%
distribute-neg-frac62.5%
Simplified62.5%
Taylor expanded in B around 0 34.8%
associate-*r/34.8%
neg-mul-134.8%
Simplified34.8%
Final simplification38.5%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -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 = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 73.8%
Taylor expanded in F around -inf 56.0%
Taylor expanded in x around inf 53.0%
mul-1-neg53.0%
associate-/l*52.9%
distribute-neg-frac52.9%
Simplified52.9%
Taylor expanded in B around 0 29.1%
associate-*r/29.1%
neg-mul-129.1%
Simplified29.1%
Final simplification29.1%
herbie shell --seed 2023273
(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))))))