
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+83)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 6e+27)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+83) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 6e+27) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+83) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 6e+27) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+83], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6e+27], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+83}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+27}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.00000000000000003e83Initial program 41.9%
Simplified68.5%
Taylor expanded in F around -inf 99.9%
if -1.00000000000000003e83 < F < 5.99999999999999953e27Initial program 99.3%
Simplified99.6%
if 5.99999999999999953e27 < F Initial program 52.7%
Simplified71.5%
Taylor expanded in F around inf 99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -500000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7e-30)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -500000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7e-30) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-500000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7d-30) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -500000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7e-30) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -500000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7e-30: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -500000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7e-30) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -500000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7e-30) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -500000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7e-30], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -500000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-30}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5e5Initial program 55.3%
Simplified75.8%
Taylor expanded in F around -inf 99.8%
if -5e5 < F < 7.0000000000000006e-30Initial program 99.3%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-/l*99.6%
Simplified99.6%
if 7.0000000000000006e-30 < F Initial program 59.0%
Simplified75.3%
Taylor expanded in F around inf 99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.011)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -4.5e-214)
(- (* F (/ (sqrt 0.5) (sin B))) (/ x B))
(if (<= F 1.1e-170)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 7e-30)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (sin B))) (/ x B))
(- (/ 1.0 (sin B)) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.011) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -4.5e-214) {
tmp = (F * (sqrt(0.5) / sin(B))) - (x / B);
} else if (F <= 1.1e-170) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 7e-30) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - (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 / tan(b)
if (f <= (-0.011d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-4.5d-214)) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - (x / b)
else if (f <= 1.1d-170) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 7d-30) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / sin(b))) - (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 / Math.tan(B);
double tmp;
if (F <= -0.011) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -4.5e-214) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x / B);
} else if (F <= 1.1e-170) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 7e-30) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / Math.sin(B))) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.011: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -4.5e-214: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B) elif F <= 1.1e-170: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 7e-30: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / math.sin(B))) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.011) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -4.5e-214) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B)); elseif (F <= 1.1e-170) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 7e-30) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / sin(B))) - Float64(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 / tan(B); tmp = 0.0; if (F <= -0.011) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -4.5e-214) tmp = (F * (sqrt(0.5) / sin(B))) - (x / B); elseif (F <= 1.1e-170) tmp = (x * cos(B)) / -sin(B); elseif (F <= 7e-30) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - (x / B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.011], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -4.5e-214], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-170], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 7e-30], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.011:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -4.5 \cdot 10^{-214}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-170}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-30}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.010999999999999999Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
if -0.010999999999999999 < F < -4.5000000000000001e-214Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 77.5%
Taylor expanded in x around 0 77.5%
associate-/l*99.5%
Simplified77.5%
if -4.5000000000000001e-214 < F < 1.10000000000000007e-170Initial program 99.3%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.7%
metadata-eval99.7%
metadata-eval99.7%
unpow-prod-down99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
Applied egg-rr99.7%
pow-sqr99.7%
metadata-eval99.7%
unpow-199.7%
fma-undefine99.7%
*-commutative99.7%
fma-undefine99.7%
unpow299.7%
+-commutative99.7%
fma-define99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 92.2%
if 1.10000000000000007e-170 < F < 7.0000000000000006e-30Initial program 99.3%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 81.0%
if 7.0000000000000006e-30 < F Initial program 59.0%
Simplified75.3%
Taylor expanded in F around inf 99.7%
Final simplification91.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* F (/ (sqrt 0.5) (sin B))) (/ x B))) (t_1 (/ x (tan B))))
(if (<= F -0.00105)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -2.3e-213)
t_0
(if (<= F 7.4e-172)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 7e-30) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = (F * (sqrt(0.5) / sin(B))) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -0.00105) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -2.3e-213) {
tmp = t_0;
} else if (F <= 7.4e-172) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 7e-30) {
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 * (sqrt(0.5d0) / sin(b))) - (x / b)
t_1 = x / tan(b)
if (f <= (-0.00105d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-2.3d-213)) then
tmp = t_0
else if (f <= 7.4d-172) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 7d-30) 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.sqrt(0.5) / Math.sin(B))) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.00105) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -2.3e-213) {
tmp = t_0;
} else if (F <= 7.4e-172) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 7e-30) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = (F * (math.sqrt(0.5) / math.sin(B))) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -0.00105: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -2.3e-213: tmp = t_0 elif F <= 7.4e-172: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 7e-30: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.00105) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -2.3e-213) tmp = t_0; elseif (F <= 7.4e-172) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 7e-30) 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 * (sqrt(0.5) / sin(B))) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -0.00105) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -2.3e-213) tmp = t_0; elseif (F <= 7.4e-172) tmp = (x * cos(B)) / -sin(B); elseif (F <= 7e-30) 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[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00105], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2.3e-213], t$95$0, If[LessEqual[F, 7.4e-172], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 7e-30], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \frac{\sqrt{0.5}}{\sin B} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.00105:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -2.3 \cdot 10^{-213}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 7.4 \cdot 10^{-172}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -0.00104999999999999994Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
if -0.00104999999999999994 < F < -2.30000000000000003e-213 or 7.40000000000000001e-172 < F < 7.0000000000000006e-30Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 78.9%
Taylor expanded in x around 0 78.9%
associate-/l*99.5%
Simplified78.9%
if -2.30000000000000003e-213 < F < 7.40000000000000001e-172Initial program 99.3%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.7%
metadata-eval99.7%
metadata-eval99.7%
unpow-prod-down99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
Applied egg-rr99.7%
pow-sqr99.7%
metadata-eval99.7%
unpow-199.7%
fma-undefine99.7%
*-commutative99.7%
fma-undefine99.7%
unpow299.7%
+-commutative99.7%
fma-define99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 92.2%
if 7.0000000000000006e-30 < F Initial program 59.0%
Simplified75.3%
Taylor expanded in F around inf 99.7%
Final simplification91.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9.5e-11)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -3e-213)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) (/ x B))
(if (<= F 1.82e-53)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -9.5e-11) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -3e-213) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 1.82e-53) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-9.5d-11)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-3d-213)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - (x / b)
else if (f <= 1.82d-53) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -9.5e-11) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -3e-213) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 1.82e-53) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -9.5e-11: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -3e-213: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B) elif F <= 1.82e-53: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9.5e-11) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -3e-213) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - Float64(x / B)); elseif (F <= 1.82e-53) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -9.5e-11) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -3e-213) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B); elseif (F <= 1.82e-53) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9.5e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3e-213], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.82e-53], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -3 \cdot 10^{-213}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.82 \cdot 10^{-53}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -9.49999999999999951e-11Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
if -9.49999999999999951e-11 < F < -2.99999999999999986e-213Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 77.5%
Taylor expanded in B around 0 52.8%
if -2.99999999999999986e-213 < F < 1.8199999999999999e-53Initial program 99.3%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 77.7%
if 1.8199999999999999e-53 < F Initial program 61.5%
Simplified76.8%
Taylor expanded in F around inf 94.0%
Final simplification82.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.06e-7)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -3e-213)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) (/ x B))
(if (<= F 2.65e-53)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 5.4e+253)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B))
(- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.06e-7) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -3e-213) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 2.65e-53) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 5.4e+253) {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.06d-7)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-3d-213)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - (x / b)
else if (f <= 2.65d-53) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 5.4d+253) then
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.06e-7) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -3e-213) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 2.65e-53) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 5.4e+253) {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.06e-7: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -3e-213: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B) elif F <= 2.65e-53: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 5.4e+253: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.06e-7) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -3e-213) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - Float64(x / B)); elseif (F <= 2.65e-53) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 5.4e+253) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.06e-7) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -3e-213) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B); elseif (F <= 2.65e-53) tmp = (x * cos(B)) / -sin(B); elseif (F <= 5.4e+253) tmp = (F * (1.0 / (F * sin(B)))) - (x / B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.06e-7], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3e-213], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e-53], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5.4e+253], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.06 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -3 \cdot 10^{-213}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{-53}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{+253}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.06e-7Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
if -1.06e-7 < F < -2.99999999999999986e-213Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 77.5%
Taylor expanded in B around 0 52.8%
if -2.99999999999999986e-213 < F < 2.65e-53Initial program 99.3%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 77.7%
if 2.65e-53 < F < 5.40000000000000005e253Initial program 64.6%
Simplified80.2%
Taylor expanded in F around inf 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in B around 0 75.6%
if 5.40000000000000005e253 < F Initial program 50.3%
Simplified64.9%
Taylor expanded in F around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 78.9%
Final simplification78.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.35e-8)
(- (/ -1.0 B) t_0)
(if (<= F -2.9e-213)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) (/ x B))
(if (<= F 2.65e-53)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 5.5e+254)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B))
(- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.35e-8) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -2.9e-213) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 2.65e-53) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 5.5e+254) {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.35d-8)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-2.9d-213)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - (x / b)
else if (f <= 2.65d-53) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 5.5d+254) then
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.35e-8) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -2.9e-213) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 2.65e-53) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 5.5e+254) {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.35e-8: tmp = (-1.0 / B) - t_0 elif F <= -2.9e-213: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B) elif F <= 2.65e-53: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 5.5e+254: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.35e-8) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -2.9e-213) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - Float64(x / B)); elseif (F <= 2.65e-53) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 5.5e+254) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.35e-8) tmp = (-1.0 / B) - t_0; elseif (F <= -2.9e-213) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B); elseif (F <= 2.65e-53) tmp = (x * cos(B)) / -sin(B); elseif (F <= 5.5e+254) tmp = (F * (1.0 / (F * sin(B)))) - (x / B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35e-8], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.9e-213], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e-53], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5.5e+254], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{-8}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -2.9 \cdot 10^{-213}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{-53}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{+254}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.35000000000000001e-8Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.2%
if -1.35000000000000001e-8 < F < -2.8999999999999999e-213Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 77.5%
Taylor expanded in B around 0 52.8%
if -2.8999999999999999e-213 < F < 2.65e-53Initial program 99.3%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 77.7%
if 2.65e-53 < F < 5.50000000000000004e254Initial program 64.6%
Simplified80.2%
Taylor expanded in F around inf 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in B around 0 75.6%
if 5.50000000000000004e254 < F Initial program 50.3%
Simplified64.9%
Taylor expanded in F around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 78.9%
Final simplification72.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.6e-5)
(- (/ -1.0 B) t_0)
(if (<= F -2.7e-218)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) (/ x B))
(if (<= F 2.65e-53)
(* x (/ (cos B) (- (sin B))))
(if (<= F 6e+253)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B))
(- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.6e-5) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -2.7e-218) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 2.65e-53) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 6e+253) {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-3.6d-5)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-2.7d-218)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - (x / b)
else if (f <= 2.65d-53) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 6d+253) then
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -3.6e-5) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -2.7e-218) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 2.65e-53) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 6e+253) {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.6e-5: tmp = (-1.0 / B) - t_0 elif F <= -2.7e-218: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B) elif F <= 2.65e-53: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 6e+253: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.6e-5) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -2.7e-218) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - Float64(x / B)); elseif (F <= 2.65e-53) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 6e+253) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3.6e-5) tmp = (-1.0 / B) - t_0; elseif (F <= -2.7e-218) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B); elseif (F <= 2.65e-53) tmp = x * (cos(B) / -sin(B)); elseif (F <= 6e+253) tmp = (F * (1.0 / (F * sin(B)))) - (x / B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.6e-5], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.7e-218], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e-53], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e+253], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -2.7 \cdot 10^{-218}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{-53}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+253}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -3.60000000000000009e-5Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.2%
if -3.60000000000000009e-5 < F < -2.7e-218Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 78.4%
Taylor expanded in B around 0 54.6%
if -2.7e-218 < F < 2.65e-53Initial program 99.3%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 77.1%
mul-1-neg77.1%
associate-/l*76.9%
distribute-lft-neg-in76.9%
Simplified76.9%
if 2.65e-53 < F < 5.9999999999999996e253Initial program 64.6%
Simplified80.2%
Taylor expanded in F around inf 92.3%
*-commutative92.3%
Simplified92.3%
Taylor expanded in B around 0 75.6%
if 5.9999999999999996e253 < F Initial program 50.3%
Simplified64.9%
Taylor expanded in F around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 78.9%
Final simplification72.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (- (/ 1.0 B) t_0)))
(if (<= F -0.0014)
(- (/ -1.0 B) t_0)
(if (<= F -1.9e-216)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) (/ x B))
(if (<= F 3e-247)
t_1
(if (<= F 7e-30)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= F 5e+254) (- (* F (/ 1.0 (* F (sin B)))) (/ x B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = (1.0 / B) - t_0;
double tmp;
if (F <= -0.0014) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -1.9e-216) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 3e-247) {
tmp = t_1;
} else if (F <= 7e-30) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (F <= 5e+254) {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / tan(b)
t_1 = (1.0d0 / b) - t_0
if (f <= (-0.0014d0)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-1.9d-216)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - (x / b)
else if (f <= 3d-247) then
tmp = t_1
else if (f <= 7d-30) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (f <= 5d+254) then
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double t_1 = (1.0 / B) - t_0;
double tmp;
if (F <= -0.0014) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -1.9e-216) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B);
} else if (F <= 3e-247) {
tmp = t_1;
} else if (F <= 7e-30) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (F <= 5e+254) {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
} else {
tmp = t_1;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = (1.0 / B) - t_0 tmp = 0 if F <= -0.0014: tmp = (-1.0 / B) - t_0 elif F <= -1.9e-216: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B) elif F <= 3e-247: tmp = t_1 elif F <= 7e-30: tmp = ((F * math.sqrt(0.5)) - x) / B elif F <= 5e+254: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) else: tmp = t_1 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(Float64(1.0 / B) - t_0) tmp = 0.0 if (F <= -0.0014) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -1.9e-216) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - Float64(x / B)); elseif (F <= 3e-247) tmp = t_1; elseif (F <= 7e-30) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (F <= 5e+254) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); else tmp = t_1; end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = (1.0 / B) - t_0; tmp = 0.0; if (F <= -0.0014) tmp = (-1.0 / B) - t_0; elseif (F <= -1.9e-216) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - (x / B); elseif (F <= 3e-247) tmp = t_1; elseif (F <= 7e-30) tmp = ((F * sqrt(0.5)) - x) / B; elseif (F <= 5e+254) tmp = (F * (1.0 / (F * sin(B)))) - (x / B); else tmp = t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -0.0014], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.9e-216], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3e-247], t$95$1, If[LessEqual[F, 7e-30], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5e+254], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{B} - t\_0\\
\mathbf{if}\;F \leq -0.0014:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -1.9 \cdot 10^{-216}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-247}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-30}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+254}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if F < -0.00139999999999999999Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.2%
if -0.00139999999999999999 < F < -1.9e-216Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 78.0%
Taylor expanded in B around 0 53.7%
if -1.9e-216 < F < 2.9999999999999997e-247 or 4.99999999999999994e254 < F Initial program 84.1%
Simplified88.8%
Taylor expanded in F around inf 60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in B around 0 72.6%
if 2.9999999999999997e-247 < F < 7.0000000000000006e-30Initial program 99.3%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in B around 0 57.4%
if 7.0000000000000006e-30 < F < 4.99999999999999994e254Initial program 61.6%
Simplified78.5%
Taylor expanded in F around inf 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 81.5%
Final simplification69.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (- (/ 1.0 B) t_0)))
(if (<= F -1.1e-5)
(- (/ -1.0 B) t_0)
(if (<= F -2.8e-217)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) B)) (/ x B))
(if (<= F 1.08e-244)
t_1
(if (<= F 7e-30)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= F 2.7e+254)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B))
t_1)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = (1.0 / B) - t_0;
double tmp;
if (F <= -1.1e-5) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -2.8e-217) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / B)) - (x / B);
} else if (F <= 1.08e-244) {
tmp = t_1;
} else if (F <= 7e-30) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (F <= 2.7e+254) {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = x / tan(b)
t_1 = (1.0d0 / b) - t_0
if (f <= (-1.1d-5)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= (-2.8d-217)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / b)) - (x / b)
else if (f <= 1.08d-244) then
tmp = t_1
else if (f <= 7d-30) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (f <= 2.7d+254) then
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double t_1 = (1.0 / B) - t_0;
double tmp;
if (F <= -1.1e-5) {
tmp = (-1.0 / B) - t_0;
} else if (F <= -2.8e-217) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / B)) - (x / B);
} else if (F <= 1.08e-244) {
tmp = t_1;
} else if (F <= 7e-30) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (F <= 2.7e+254) {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
} else {
tmp = t_1;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = (1.0 / B) - t_0 tmp = 0 if F <= -1.1e-5: tmp = (-1.0 / B) - t_0 elif F <= -2.8e-217: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / B)) - (x / B) elif F <= 1.08e-244: tmp = t_1 elif F <= 7e-30: tmp = ((F * math.sqrt(0.5)) - x) / B elif F <= 2.7e+254: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) else: tmp = t_1 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(Float64(1.0 / B) - t_0) tmp = 0.0 if (F <= -1.1e-5) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= -2.8e-217) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / B)) - Float64(x / B)); elseif (F <= 1.08e-244) tmp = t_1; elseif (F <= 7e-30) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (F <= 2.7e+254) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); else tmp = t_1; end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = (1.0 / B) - t_0; tmp = 0.0; if (F <= -1.1e-5) tmp = (-1.0 / B) - t_0; elseif (F <= -2.8e-217) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / B)) - (x / B); elseif (F <= 1.08e-244) tmp = t_1; elseif (F <= 7e-30) tmp = ((F * sqrt(0.5)) - x) / B; elseif (F <= 2.7e+254) tmp = (F * (1.0 / (F * sin(B)))) - (x / B); else tmp = t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[F, -1.1e-5], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.8e-217], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.08e-244], t$95$1, If[LessEqual[F, 7e-30], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.7e+254], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{B} - t\_0\\
\mathbf{if}\;F \leq -1.1 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -2.8 \cdot 10^{-217}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.08 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-30}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+254}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if F < -1.1e-5Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.2%
if -1.1e-5 < F < -2.8e-217Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 78.0%
Taylor expanded in B around 0 53.7%
if -2.8e-217 < F < 1.07999999999999996e-244 or 2.70000000000000022e254 < F Initial program 84.1%
Simplified88.8%
Taylor expanded in F around inf 60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in B around 0 72.6%
if 1.07999999999999996e-244 < F < 7.0000000000000006e-30Initial program 99.3%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in B around 0 57.4%
if 7.0000000000000006e-30 < F < 2.70000000000000022e254Initial program 61.6%
Simplified78.5%
Taylor expanded in F around inf 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 81.5%
Final simplification69.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt 0.5)) x) B))
(t_1 (/ x (tan B)))
(t_2 (- (/ 1.0 B) t_1)))
(if (<= F -0.000105)
(- (/ -1.0 B) t_1)
(if (<= F -5e-217)
t_0
(if (<= F 2.75e-247)
t_2
(if (<= F 7e-30)
t_0
(if (<= F 6.5e+252)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B))
t_2)))))))
double code(double F, double B, double x) {
double t_0 = ((F * sqrt(0.5)) - x) / B;
double t_1 = x / tan(B);
double t_2 = (1.0 / B) - t_1;
double tmp;
if (F <= -0.000105) {
tmp = (-1.0 / B) - t_1;
} else if (F <= -5e-217) {
tmp = t_0;
} else if (F <= 2.75e-247) {
tmp = t_2;
} else if (F <= 7e-30) {
tmp = t_0;
} else if (F <= 6.5e+252) {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_0 = ((f * sqrt(0.5d0)) - x) / b
t_1 = x / tan(b)
t_2 = (1.0d0 / b) - t_1
if (f <= (-0.000105d0)) then
tmp = ((-1.0d0) / b) - t_1
else if (f <= (-5d-217)) then
tmp = t_0
else if (f <= 2.75d-247) then
tmp = t_2
else if (f <= 7d-30) then
tmp = t_0
else if (f <= 6.5d+252) then
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F * Math.sqrt(0.5)) - x) / B;
double t_1 = x / Math.tan(B);
double t_2 = (1.0 / B) - t_1;
double tmp;
if (F <= -0.000105) {
tmp = (-1.0 / B) - t_1;
} else if (F <= -5e-217) {
tmp = t_0;
} else if (F <= 2.75e-247) {
tmp = t_2;
} else if (F <= 7e-30) {
tmp = t_0;
} else if (F <= 6.5e+252) {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
} else {
tmp = t_2;
}
return tmp;
}
def code(F, B, x): t_0 = ((F * math.sqrt(0.5)) - x) / B t_1 = x / math.tan(B) t_2 = (1.0 / B) - t_1 tmp = 0 if F <= -0.000105: tmp = (-1.0 / B) - t_1 elif F <= -5e-217: tmp = t_0 elif F <= 2.75e-247: tmp = t_2 elif F <= 7e-30: tmp = t_0 elif F <= 6.5e+252: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) else: tmp = t_2 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B) t_1 = Float64(x / tan(B)) t_2 = Float64(Float64(1.0 / B) - t_1) tmp = 0.0 if (F <= -0.000105) tmp = Float64(Float64(-1.0 / B) - t_1); elseif (F <= -5e-217) tmp = t_0; elseif (F <= 2.75e-247) tmp = t_2; elseif (F <= 7e-30) tmp = t_0; elseif (F <= 6.5e+252) tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); else tmp = t_2; end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F * sqrt(0.5)) - x) / B; t_1 = x / tan(B); t_2 = (1.0 / B) - t_1; tmp = 0.0; if (F <= -0.000105) tmp = (-1.0 / B) - t_1; elseif (F <= -5e-217) tmp = t_0; elseif (F <= 2.75e-247) tmp = t_2; elseif (F <= 7e-30) tmp = t_0; elseif (F <= 6.5e+252) tmp = (F * (1.0 / (F * sin(B)))) - (x / B); else tmp = t_2; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[F, -0.000105], N[(N[(-1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -5e-217], t$95$0, If[LessEqual[F, 2.75e-247], t$95$2, If[LessEqual[F, 7e-30], t$95$0, If[LessEqual[F, 6.5e+252], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{0.5} - x}{B}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{1}{B} - t\_1\\
\mathbf{if}\;F \leq -0.000105:\\
\;\;\;\;\frac{-1}{B} - t\_1\\
\mathbf{elif}\;F \leq -5 \cdot 10^{-217}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.75 \cdot 10^{-247}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{+252}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if F < -1.05e-4Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.2%
if -1.05e-4 < F < -5.0000000000000002e-217 or 2.74999999999999997e-247 < F < 7.0000000000000006e-30Initial program 99.2%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in B around 0 55.4%
if -5.0000000000000002e-217 < F < 2.74999999999999997e-247 or 6.5e252 < F Initial program 84.1%
Simplified88.8%
Taylor expanded in F around inf 60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in B around 0 72.6%
if 7.0000000000000006e-30 < F < 6.5e252Initial program 61.6%
Simplified78.5%
Taylor expanded in F around inf 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 81.5%
Final simplification69.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.35e-6)
(- (/ -1.0 B) t_0)
(if (or (<= F -6e-217) (and (not (<= F 1.35e-248)) (<= F 2.5e-56)))
(/ (- (* F (sqrt 0.5)) x) B)
(- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.35e-6) {
tmp = (-1.0 / B) - t_0;
} else if ((F <= -6e-217) || (!(F <= 1.35e-248) && (F <= 2.5e-56))) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.35d-6)) then
tmp = ((-1.0d0) / b) - t_0
else if ((f <= (-6d-217)) .or. (.not. (f <= 1.35d-248)) .and. (f <= 2.5d-56)) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.35e-6) {
tmp = (-1.0 / B) - t_0;
} else if ((F <= -6e-217) || (!(F <= 1.35e-248) && (F <= 2.5e-56))) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.35e-6: tmp = (-1.0 / B) - t_0 elif (F <= -6e-217) or (not (F <= 1.35e-248) and (F <= 2.5e-56)): tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.35e-6) tmp = Float64(Float64(-1.0 / B) - t_0); elseif ((F <= -6e-217) || (!(F <= 1.35e-248) && (F <= 2.5e-56))) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.35e-6) tmp = (-1.0 / B) - t_0; elseif ((F <= -6e-217) || (~((F <= 1.35e-248)) && (F <= 2.5e-56))) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35e-6], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, -6e-217], And[N[Not[LessEqual[F, 1.35e-248]], $MachinePrecision], LessEqual[F, 2.5e-56]]], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{-6}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-217} \lor \neg \left(F \leq 1.35 \cdot 10^{-248}\right) \land F \leq 2.5 \cdot 10^{-56}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.34999999999999999e-6Initial program 56.0%
Simplified76.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 79.2%
if -1.34999999999999999e-6 < F < -6.00000000000000009e-217 or 1.35e-248 < F < 2.49999999999999999e-56Initial program 99.2%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-/l*99.6%
Simplified99.6%
Taylor expanded in B around 0 57.2%
if -6.00000000000000009e-217 < F < 1.35e-248 or 2.49999999999999999e-56 < F Initial program 74.1%
Simplified84.4%
Taylor expanded in F around inf 76.6%
*-commutative76.6%
Simplified76.6%
Taylor expanded in B around 0 68.0%
Final simplification66.8%
(FPCore (F B x) :precision binary64 (if (or (<= F 250000000000.0) (not (<= F 1.75e+256))) (- (/ -1.0 B) (/ x (tan B))) (/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((F <= 250000000000.0) || !(F <= 1.75e+256)) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((f <= 250000000000.0d0) .or. (.not. (f <= 1.75d+256))) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((F <= 250000000000.0) || !(F <= 1.75e+256)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (F <= 250000000000.0) or not (F <= 1.75e+256): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((F <= 250000000000.0) || !(F <= 1.75e+256)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((F <= 250000000000.0) || ~((F <= 1.75e+256))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[F, 250000000000.0], N[Not[LessEqual[F, 1.75e+256]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 250000000000 \lor \neg \left(F \leq 1.75 \cdot 10^{+256}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < 2.5e11 or 1.7499999999999999e256 < F Initial program 83.4%
Simplified90.7%
Taylor expanded in F around -inf 57.4%
Taylor expanded in B around 0 57.1%
if 2.5e11 < F < 1.7499999999999999e256Initial program 55.6%
Simplified74.1%
Taylor expanded in F around inf 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 65.9%
Final simplification58.6%
(FPCore (F B x) :precision binary64 (if (<= F -2.15e-48) (/ (- -1.0 x) B) (if (<= F 250000000000.0) (/ x (- B)) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.15e-48) {
tmp = (-1.0 - x) / B;
} else if (F <= 250000000000.0) {
tmp = x / -B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.15d-48)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 250000000000.0d0) then
tmp = x / -b
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.15e-48) {
tmp = (-1.0 - x) / B;
} else if (F <= 250000000000.0) {
tmp = x / -B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.15e-48: tmp = (-1.0 - x) / B elif F <= 250000000000.0: tmp = x / -B else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.15e-48) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 250000000000.0) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.15e-48) tmp = (-1.0 - x) / B; elseif (F <= 250000000000.0) tmp = x / -B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.15e-48], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 250000000000.0], N[(x / (-B)), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.15 \cdot 10^{-48}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 250000000000:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.15e-48Initial program 63.6%
Simplified80.3%
Taylor expanded in B around 0 40.2%
Taylor expanded in F around -inf 44.3%
if -2.15e-48 < F < 2.5e11Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 53.7%
Taylor expanded in F around -inf 21.1%
Taylor expanded in x around inf 37.6%
associate-*r/37.6%
neg-mul-137.6%
Simplified37.6%
if 2.5e11 < F Initial program 54.4%
Simplified72.6%
Taylor expanded in F around inf 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 58.7%
Final simplification44.1%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ x (tan B)))) (if (<= F -1.75e-213) (- (/ -1.0 B) t_0) (- (/ 1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.75e-213) {
tmp = (-1.0 / B) - t_0;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.75d-213)) then
tmp = ((-1.0d0) / b) - t_0
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.75e-213) {
tmp = (-1.0 / B) - t_0;
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.75e-213: tmp = (-1.0 / B) - t_0 else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.75e-213) tmp = Float64(Float64(-1.0 / B) - t_0); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.75e-213) tmp = (-1.0 / B) - t_0; else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.75e-213], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.75 \cdot 10^{-213}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.75000000000000008e-213Initial program 75.0%
Simplified86.4%
Taylor expanded in F around -inf 69.1%
Taylor expanded in B around 0 60.1%
if -1.75000000000000008e-213 < F Initial program 82.0%
Simplified89.2%
Taylor expanded in F around inf 61.1%
*-commutative61.1%
Simplified61.1%
Taylor expanded in B around 0 58.9%
(FPCore (F B x) :precision binary64 (if (<= F -2.65e-48) (/ (- -1.0 x) B) (if (<= F 2.65e-37) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-48) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.65e-37) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.65d-48)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.65d-37) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-48) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.65e-37) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.65e-48: tmp = (-1.0 - x) / B elif F <= 2.65e-37: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.65e-48) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.65e-37) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.65e-48) tmp = (-1.0 - x) / B; elseif (F <= 2.65e-37) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.65e-48], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.65e-37], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.65 \cdot 10^{-48}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{-37}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.65e-48Initial program 63.6%
Simplified80.3%
Taylor expanded in B around 0 40.2%
Taylor expanded in F around -inf 44.3%
if -2.65e-48 < F < 2.64999999999999998e-37Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 52.6%
Taylor expanded in F around -inf 18.8%
Taylor expanded in x around inf 36.4%
associate-*r/36.4%
neg-mul-136.4%
Simplified36.4%
if 2.64999999999999998e-37 < F Initial program 59.6%
Simplified75.7%
Taylor expanded in B around 0 37.9%
Taylor expanded in F around inf 46.2%
Final simplification41.2%
(FPCore (F B x) :precision binary64 (if (<= F -2.6e-48) (/ (- -1.0 x) B) (if (<= F 750000000000.0) (/ x (- B)) (/ 1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e-48) {
tmp = (-1.0 - x) / B;
} else if (F <= 750000000000.0) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.6d-48)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 750000000000.0d0) then
tmp = x / -b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e-48) {
tmp = (-1.0 - x) / B;
} else if (F <= 750000000000.0) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.6e-48: tmp = (-1.0 - x) / B elif F <= 750000000000.0: tmp = x / -B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.6e-48) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 750000000000.0) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.6e-48) tmp = (-1.0 - x) / B; elseif (F <= 750000000000.0) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.6e-48], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 750000000000.0], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{-48}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 750000000000:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < -2.59999999999999987e-48Initial program 63.6%
Simplified80.3%
Taylor expanded in B around 0 40.2%
Taylor expanded in F around -inf 44.3%
if -2.59999999999999987e-48 < F < 7.5e11Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 53.7%
Taylor expanded in F around -inf 21.1%
Taylor expanded in x around inf 37.6%
associate-*r/37.6%
neg-mul-137.6%
Simplified37.6%
if 7.5e11 < F Initial program 54.4%
Simplified72.6%
Taylor expanded in B around 0 33.5%
Taylor expanded in F around inf 44.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in x around 0 30.0%
Taylor expanded in F around inf 30.0%
Final simplification38.1%
(FPCore (F B x) :precision binary64 (if (<= F 360000000000.0) (/ x (- B)) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 360000000000.0) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 360000000000.0d0) then
tmp = x / -b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 360000000000.0) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 360000000000.0: tmp = x / -B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 360000000000.0) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 360000000000.0) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 360000000000.0], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 360000000000:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 3.6e11Initial program 85.4%
Simplified92.1%
Taylor expanded in B around 0 48.4%
Taylor expanded in F around -inf 30.2%
Taylor expanded in x around inf 32.4%
associate-*r/32.4%
neg-mul-132.4%
Simplified32.4%
if 3.6e11 < F Initial program 54.4%
Simplified72.6%
Taylor expanded in B around 0 33.5%
Taylor expanded in F around inf 44.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in x around 0 30.0%
Taylor expanded in F around inf 30.0%
Final simplification31.9%
(FPCore (F B x) :precision binary64 (if (<= F 250000000000.0) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 250000000000.0) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 250000000000.0d0) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 250000000000.0) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 250000000000.0: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 250000000000.0) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 250000000000.0) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 250000000000.0], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 250000000000:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 2.5e11Initial program 85.4%
Simplified92.1%
Taylor expanded in B around 0 48.4%
Taylor expanded in F around -inf 30.2%
Taylor expanded in x around 0 10.9%
if 2.5e11 < F Initial program 54.4%
Simplified72.6%
Taylor expanded in B around 0 33.5%
Taylor expanded in F around inf 44.5%
*-commutative44.5%
Simplified44.5%
Taylor expanded in x around 0 30.0%
Taylor expanded in F around inf 30.0%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 78.8%
Simplified87.9%
Taylor expanded in B around 0 45.3%
Taylor expanded in F around -inf 26.8%
Taylor expanded in x around 0 9.3%
herbie shell --seed 2024157
(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))))))