
(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 22 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 -8e+18)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 4.7e+29)
(- (* 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 <= -8e+18) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 4.7e+29) {
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 <= -8e+18) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 4.7e+29) 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, -8e+18], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.7e+29], 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 -8 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 4.7 \cdot 10^{+29}:\\
\;\;\;\;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 < -8e18Initial program 57.6%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -8e18 < F < 4.7000000000000002e29Initial program 98.6%
Simplified99.6%
if 4.7000000000000002e29 < F Initial program 50.7%
Simplified66.6%
Taylor expanded in x around 0 66.6%
associate-*l/66.6%
*-lft-identity66.6%
+-commutative66.6%
unpow266.6%
fma-undefine66.6%
Simplified66.6%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+48)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 4.4e+29)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+48) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 4.4e+29) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / 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 <= -2e+48) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 4.4e+29) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / 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, -2e+48], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.4e+29], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $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 -2 \cdot 10^{+48}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 4.4 \cdot 10^{+29}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.00000000000000009e48Initial program 54.4%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -2.00000000000000009e48 < F < 4.4000000000000003e29Initial program 98.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
if 4.4000000000000003e29 < F Initial program 50.7%
Simplified66.6%
Taylor expanded in x around 0 66.6%
associate-*l/66.6%
*-lft-identity66.6%
+-commutative66.6%
unpow266.6%
fma-undefine66.6%
Simplified66.6%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (/ (tan B) x))))
(if (<= F -1e+23)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 12500000.0)
(+ t_0 (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) (/ x (tan B)))))))
double code(double F, double B, double x) {
double t_0 = -1.0 / (tan(B) / x);
double tmp;
if (F <= -1e+23) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 12500000.0) {
tmp = t_0 + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) / (tan(b) / x)
if (f <= (-1d+23)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 12500000.0d0) then
tmp = t_0 + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 / (Math.tan(B) / x);
double tmp;
if (F <= -1e+23) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 12500000.0) {
tmp = t_0 + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / (math.tan(B) / x) tmp = 0 if F <= -1e+23: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 12500000.0: tmp = t_0 + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - (x / math.tan(B)) return tmp
function code(F, B, x) t_0 = Float64(-1.0 / Float64(tan(B) / x)) tmp = 0.0 if (F <= -1e+23) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 12500000.0) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / (tan(B) / x); tmp = 0.0; if (F <= -1e+23) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 12500000.0) tmp = t_0 + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+23], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 12500000.0], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\frac{\tan B}{x}}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+23}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 12500000:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -9.9999999999999992e22Initial program 57.6%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -9.9999999999999992e22 < F < 1.25e7Initial program 99.4%
div-inv37.4%
clear-num37.4%
Applied egg-rr99.5%
if 1.25e7 < F Initial program 53.2%
Simplified69.2%
Taylor expanded in x around 0 69.2%
associate-*l/69.2%
*-lft-identity69.2%
+-commutative69.2%
unpow269.2%
fma-undefine69.2%
Simplified69.2%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -4e+18)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 115000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e+18) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 115000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4d+18)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 115000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
else
tmp = (1.0d0 / sin(b)) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4e+18) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 115000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(B)));
} else {
tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4e+18: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 115000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4e+18) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 115000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4e+18) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 115000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B))); else tmp = (1.0 / sin(B)) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4e+18], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 115000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 115000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -4e18Initial program 57.6%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -4e18 < F < 1.15e8Initial program 99.4%
if 1.15e8 < F Initial program 53.2%
Simplified69.2%
Taylor expanded in x around 0 69.2%
associate-*l/69.2%
*-lft-identity69.2%
+-commutative69.2%
unpow269.2%
fma-undefine69.2%
Simplified69.2%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 1.42)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 1.42) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 1.42d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 1.42) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 1.42: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 1.42) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 1.42) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 59.9%
Taylor expanded in F around -inf 97.5%
div-inv97.6%
clear-num97.6%
Applied egg-rr97.6%
if -1.3999999999999999 < F < 1.4199999999999999Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.5%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.9%
if 1.4199999999999999 < F Initial program 53.8%
Simplified69.6%
Taylor expanded in x around 0 69.6%
associate-*l/69.6%
*-lft-identity69.6%
+-commutative69.6%
unpow269.6%
fma-undefine69.6%
Simplified69.6%
Taylor expanded in F around inf 99.6%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ x B))))
(if (<= F -4e+18)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F -4.8e-123)
t_0
(if (<= F 1.35e-127)
(* x (- (/ (cos B) (sin B))))
(if (<= F 5500000.0) t_0 (- (/ 1.0 (sin B)) (/ x (tan B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double tmp;
if (F <= -4e+18) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= -4.8e-123) {
tmp = t_0;
} else if (F <= 1.35e-127) {
tmp = x * -(cos(B) / sin(B));
} else if (F <= 5500000.0) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
if (f <= (-4d+18)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= (-4.8d-123)) then
tmp = t_0
else if (f <= 1.35d-127) then
tmp = x * -(cos(b) / sin(b))
else if (f <= 5500000.0d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double tmp;
if (F <= -4e+18) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= -4.8e-123) {
tmp = t_0;
} else if (F <= 1.35e-127) {
tmp = x * -(Math.cos(B) / Math.sin(B));
} else if (F <= 5500000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) tmp = 0 if F <= -4e+18: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= -4.8e-123: tmp = t_0 elif F <= 1.35e-127: tmp = x * -(math.cos(B) / math.sin(B)) elif F <= 5500000.0: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - (x / math.tan(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) tmp = 0.0 if (F <= -4e+18) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= -4.8e-123) tmp = t_0; elseif (F <= 1.35e-127) tmp = Float64(x * Float64(-Float64(cos(B) / sin(B)))); elseif (F <= 5500000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); tmp = 0.0; if (F <= -4e+18) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= -4.8e-123) tmp = t_0; elseif (F <= 1.35e-127) tmp = x * -(cos(B) / sin(B)); elseif (F <= 5500000.0) tmp = t_0; else tmp = (1.0 / sin(B)) - (x / tan(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[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+18], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.8e-123], t$95$0, If[LessEqual[F, 1.35e-127], N[(x * (-N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5500000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -4.8 \cdot 10^{-123}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{-127}:\\
\;\;\;\;x \cdot \left(-\frac{\cos B}{\sin B}\right)\\
\mathbf{elif}\;F \leq 5500000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -4e18Initial program 57.6%
Taylor expanded in F around -inf 99.7%
div-inv99.8%
clear-num99.8%
Applied egg-rr99.8%
if -4e18 < F < -4.8e-123 or 1.35e-127 < F < 5.5e6Initial program 99.3%
Taylor expanded in B around 0 84.5%
associate-*r/84.5%
neg-mul-184.5%
Simplified84.5%
if -4.8e-123 < F < 1.35e-127Initial program 99.5%
Taylor expanded in F around -inf 36.1%
Taylor expanded in x around inf 88.0%
mul-1-neg88.0%
associate-/l*88.0%
Simplified88.0%
if 5.5e6 < F Initial program 53.2%
Simplified69.2%
Taylor expanded in x around 0 69.2%
associate-*l/69.2%
*-lft-identity69.2%
+-commutative69.2%
unpow269.2%
fma-undefine69.2%
Simplified69.2%
Taylor expanded in F around inf 99.8%
Final simplification94.1%
(FPCore (F B x)
:precision binary64
(if (<= F -4e-117)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 (sin B)))
(if (<= F 7.5e-103)
(* x (- (/ (cos B) (sin B))))
(if (<= F 0.000225)
(/ (- (/ F (sqrt (+ 2.0 (* x 2.0)))) x) B)
(- (/ 1.0 (sin B)) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-117) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B));
} else if (F <= 7.5e-103) {
tmp = x * -(cos(B) / sin(B));
} else if (F <= 0.000225) {
tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4d-117)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / sin(b))
else if (f <= 7.5d-103) then
tmp = x * -(cos(b) / sin(b))
else if (f <= 0.000225d0) then
tmp = ((f / sqrt((2.0d0 + (x * 2.0d0)))) - x) / b
else
tmp = (1.0d0 / sin(b)) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4e-117) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / Math.sin(B));
} else if (F <= 7.5e-103) {
tmp = x * -(Math.cos(B) / Math.sin(B));
} else if (F <= 0.000225) {
tmp = ((F / Math.sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / Math.sin(B)) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4e-117: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / math.sin(B)) elif F <= 7.5e-103: tmp = x * -(math.cos(B) / math.sin(B)) elif F <= 0.000225: tmp = ((F / math.sqrt((2.0 + (x * 2.0)))) - x) / B else: tmp = (1.0 / math.sin(B)) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4e-117) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / sin(B))); elseif (F <= 7.5e-103) tmp = Float64(x * Float64(-Float64(cos(B) / sin(B)))); elseif (F <= 0.000225) tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + Float64(x * 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4e-117) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / sin(B)); elseif (F <= 7.5e-103) tmp = x * -(cos(B) / sin(B)); elseif (F <= 0.000225) tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B; else tmp = (1.0 / sin(B)) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4e-117], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-103], N[(x * (-N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.000225], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-117}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-103}:\\
\;\;\;\;x \cdot \left(-\frac{\cos B}{\sin B}\right)\\
\mathbf{elif}\;F \leq 0.000225:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -4.00000000000000012e-117Initial program 67.6%
Taylor expanded in F around -inf 88.0%
div-inv88.1%
clear-num88.1%
Applied egg-rr88.1%
if -4.00000000000000012e-117 < F < 7.5e-103Initial program 99.5%
Taylor expanded in F around -inf 34.6%
Taylor expanded in x around inf 85.7%
mul-1-neg85.7%
associate-/l*85.7%
Simplified85.7%
if 7.5e-103 < F < 2.2499999999999999e-4Initial program 99.1%
Simplified99.3%
Taylor expanded in B around 0 65.9%
pow165.9%
sqrt-div66.2%
metadata-eval66.2%
associate-+r+66.2%
add-sqr-sqrt66.2%
unpow266.2%
hypot-define66.2%
+-commutative66.2%
fma-define66.2%
Applied egg-rr66.2%
unpow166.2%
associate-*r/66.4%
*-rgt-identity66.4%
Simplified66.4%
Taylor expanded in F around 0 66.4%
if 2.2499999999999999e-4 < F Initial program 53.8%
Simplified69.6%
Taylor expanded in x around 0 69.6%
associate-*l/69.6%
*-lft-identity69.6%
+-commutative69.6%
unpow269.6%
fma-undefine69.6%
Simplified69.6%
Taylor expanded in F around inf 99.6%
Final simplification89.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e-117)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.9e-111)
(* x (- (/ (cos B) (sin B))))
(if (<= F 0.00072)
(/ (- (/ F (sqrt (+ 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 / tan(B);
double tmp;
if (F <= -4e-117) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.9e-111) {
tmp = x * -(cos(B) / sin(B));
} else if (F <= 0.00072) {
tmp = ((F / sqrt((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 / tan(b)
if (f <= (-4d-117)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.9d-111) then
tmp = x * -(cos(b) / sin(b))
else if (f <= 0.00072d0) then
tmp = ((f / sqrt((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 / Math.tan(B);
double tmp;
if (F <= -4e-117) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.9e-111) {
tmp = x * -(Math.cos(B) / Math.sin(B));
} else if (F <= 0.00072) {
tmp = ((F / Math.sqrt((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 / math.tan(B) tmp = 0 if F <= -4e-117: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.9e-111: tmp = x * -(math.cos(B) / math.sin(B)) elif F <= 0.00072: tmp = ((F / math.sqrt((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(x / tan(B)) tmp = 0.0 if (F <= -4e-117) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.9e-111) tmp = Float64(x * Float64(-Float64(cos(B) / sin(B)))); elseif (F <= 0.00072) tmp = Float64(Float64(Float64(F / sqrt(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 / tan(B); tmp = 0.0; if (F <= -4e-117) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.9e-111) tmp = x * -(cos(B) / sin(B)); elseif (F <= 0.00072) tmp = ((F / sqrt((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[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e-117], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.9e-111], N[(x * (-N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.00072], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(x * 2.0), $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}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{-117}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-111}:\\
\;\;\;\;x \cdot \left(-\frac{\cos B}{\sin B}\right)\\
\mathbf{elif}\;F \leq 0.00072:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.00000000000000012e-117Initial program 67.6%
Simplified76.2%
Taylor expanded in x around 0 76.2%
associate-*l/76.2%
*-lft-identity76.2%
+-commutative76.2%
unpow276.2%
fma-undefine76.2%
Simplified76.2%
Taylor expanded in F around -inf 88.1%
if -4.00000000000000012e-117 < F < 2.90000000000000002e-111Initial program 99.5%
Taylor expanded in F around -inf 34.6%
Taylor expanded in x around inf 85.7%
mul-1-neg85.7%
associate-/l*85.7%
Simplified85.7%
if 2.90000000000000002e-111 < F < 7.20000000000000045e-4Initial program 99.1%
Simplified99.3%
Taylor expanded in B around 0 65.9%
pow165.9%
sqrt-div66.2%
metadata-eval66.2%
associate-+r+66.2%
add-sqr-sqrt66.2%
unpow266.2%
hypot-define66.2%
+-commutative66.2%
fma-define66.2%
Applied egg-rr66.2%
unpow166.2%
associate-*r/66.4%
*-rgt-identity66.4%
Simplified66.4%
Taylor expanded in F around 0 66.4%
if 7.20000000000000045e-4 < F Initial program 53.8%
Simplified69.6%
Taylor expanded in x around 0 69.6%
associate-*l/69.6%
*-lft-identity69.6%
+-commutative69.6%
unpow269.6%
fma-undefine69.6%
Simplified69.6%
Taylor expanded in F around inf 99.6%
Final simplification89.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e-117)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.9e-113)
(* x (- (/ (cos B) (sin B))))
(if (<= F 18000000000.0)
(/ (- (/ F (sqrt (+ 2.0 (* x 2.0)))) 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 <= -4e-117) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.9e-113) {
tmp = x * -(cos(B) / sin(B));
} else if (F <= 18000000000.0) {
tmp = ((F / sqrt((2.0 + (x * 2.0)))) - 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 <= (-4d-117)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.9d-113) then
tmp = x * -(cos(b) / sin(b))
else if (f <= 18000000000.0d0) then
tmp = ((f / sqrt((2.0d0 + (x * 2.0d0)))) - 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 <= -4e-117) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.9e-113) {
tmp = x * -(Math.cos(B) / Math.sin(B));
} else if (F <= 18000000000.0) {
tmp = ((F / Math.sqrt((2.0 + (x * 2.0)))) - 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 <= -4e-117: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.9e-113: tmp = x * -(math.cos(B) / math.sin(B)) elif F <= 18000000000.0: tmp = ((F / math.sqrt((2.0 + (x * 2.0)))) - 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 <= -4e-117) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.9e-113) tmp = Float64(x * Float64(-Float64(cos(B) / sin(B)))); elseif (F <= 18000000000.0) tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + Float64(x * 2.0)))) - 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 <= -4e-117) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.9e-113) tmp = x * -(cos(B) / sin(B)); elseif (F <= 18000000000.0) tmp = ((F / sqrt((2.0 + (x * 2.0)))) - 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, -4e-117], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.9e-113], N[(x * (-N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 18000000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $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 -4 \cdot 10^{-117}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-113}:\\
\;\;\;\;x \cdot \left(-\frac{\cos B}{\sin B}\right)\\
\mathbf{elif}\;F \leq 18000000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -4.00000000000000012e-117Initial program 67.6%
Simplified76.2%
Taylor expanded in x around 0 76.2%
associate-*l/76.2%
*-lft-identity76.2%
+-commutative76.2%
unpow276.2%
fma-undefine76.2%
Simplified76.2%
Taylor expanded in F around -inf 88.1%
if -4.00000000000000012e-117 < F < 2.90000000000000004e-113Initial program 99.5%
Taylor expanded in F around -inf 34.6%
Taylor expanded in x around inf 85.7%
mul-1-neg85.7%
associate-/l*85.7%
Simplified85.7%
if 2.90000000000000004e-113 < F < 1.8e10Initial program 99.1%
Simplified99.3%
Taylor expanded in B around 0 60.7%
pow160.7%
sqrt-div60.9%
metadata-eval60.9%
associate-+r+60.9%
add-sqr-sqrt60.9%
unpow260.9%
hypot-define60.9%
+-commutative60.9%
fma-define60.9%
Applied egg-rr60.9%
unpow160.9%
associate-*r/61.0%
*-rgt-identity61.0%
Simplified61.0%
Taylor expanded in F around 0 61.1%
if 1.8e10 < F Initial program 52.6%
Simplified68.8%
Taylor expanded in x around 0 68.8%
associate-*l/68.8%
*-lft-identity68.8%
+-commutative68.8%
unpow268.8%
fma-undefine68.8%
Simplified68.8%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 79.9%
Final simplification82.7%
(FPCore (F B x)
:precision binary64
(if (<= F -0.085)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1e-128)
(/ (* (- x) (cos B)) (sin B))
(if (<= F 18000000000.0)
(/ (- (/ F (sqrt (+ 2.0 (* x 2.0)))) x) B)
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.085) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1e-128) {
tmp = (-x * cos(B)) / sin(B);
} else if (F <= 18000000000.0) {
tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.085d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1d-128) then
tmp = (-x * cos(b)) / sin(b)
else if (f <= 18000000000.0d0) then
tmp = ((f / sqrt((2.0d0 + (x * 2.0d0)))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.085) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1e-128) {
tmp = (-x * Math.cos(B)) / Math.sin(B);
} else if (F <= 18000000000.0) {
tmp = ((F / Math.sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.085: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1e-128: tmp = (-x * math.cos(B)) / math.sin(B) elif F <= 18000000000.0: tmp = ((F / math.sqrt((2.0 + (x * 2.0)))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.085) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1e-128) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (F <= 18000000000.0) tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + Float64(x * 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.085) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1e-128) tmp = (-x * cos(B)) / sin(B); elseif (F <= 18000000000.0) tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.085], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-128], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 18000000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.085:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 10^{-128}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 18000000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.0850000000000000061Initial program 60.4%
Taylor expanded in F around -inf 96.4%
Taylor expanded in B around 0 76.9%
associate-*r/41.8%
neg-mul-141.8%
Simplified76.9%
if -0.0850000000000000061 < F < 1.00000000000000005e-128Initial program 99.5%
Taylor expanded in F around -inf 37.9%
Taylor expanded in x around inf 78.3%
associate-*r/78.3%
mul-1-neg78.3%
*-commutative78.3%
Simplified78.3%
if 1.00000000000000005e-128 < F < 1.8e10Initial program 99.1%
Simplified99.3%
Taylor expanded in B around 0 60.7%
pow160.7%
sqrt-div60.9%
metadata-eval60.9%
associate-+r+60.9%
add-sqr-sqrt60.9%
unpow260.9%
hypot-define60.9%
+-commutative60.9%
fma-define60.9%
Applied egg-rr60.9%
unpow160.9%
associate-*r/61.0%
*-rgt-identity61.0%
Simplified61.0%
Taylor expanded in F around 0 61.1%
if 1.8e10 < F Initial program 52.6%
Simplified68.8%
Taylor expanded in x around 0 68.8%
associate-*l/68.8%
*-lft-identity68.8%
+-commutative68.8%
unpow268.8%
fma-undefine68.8%
Simplified68.8%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 79.9%
Final simplification76.8%
(FPCore (F B x)
:precision binary64
(if (<= F -0.095)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7.2e-115)
(* x (- (/ (cos B) (sin B))))
(if (<= F 18000000000.0)
(/ (- (/ F (sqrt (+ 2.0 (* x 2.0)))) x) B)
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.095) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7.2e-115) {
tmp = x * -(cos(B) / sin(B));
} else if (F <= 18000000000.0) {
tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.095d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 7.2d-115) then
tmp = x * -(cos(b) / sin(b))
else if (f <= 18000000000.0d0) then
tmp = ((f / sqrt((2.0d0 + (x * 2.0d0)))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.095) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 7.2e-115) {
tmp = x * -(Math.cos(B) / Math.sin(B));
} else if (F <= 18000000000.0) {
tmp = ((F / Math.sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.095: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 7.2e-115: tmp = x * -(math.cos(B) / math.sin(B)) elif F <= 18000000000.0: tmp = ((F / math.sqrt((2.0 + (x * 2.0)))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.095) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7.2e-115) tmp = Float64(x * Float64(-Float64(cos(B) / sin(B)))); elseif (F <= 18000000000.0) tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + Float64(x * 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.095) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 7.2e-115) tmp = x * -(cos(B) / sin(B)); elseif (F <= 18000000000.0) tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.095], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e-115], N[(x * (-N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 18000000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.095:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{-115}:\\
\;\;\;\;x \cdot \left(-\frac{\cos B}{\sin B}\right)\\
\mathbf{elif}\;F \leq 18000000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.095000000000000001Initial program 60.4%
Taylor expanded in F around -inf 96.4%
Taylor expanded in B around 0 76.9%
associate-*r/41.8%
neg-mul-141.8%
Simplified76.9%
if -0.095000000000000001 < F < 7.20000000000000018e-115Initial program 99.5%
Taylor expanded in F around -inf 37.9%
Taylor expanded in x around inf 78.3%
mul-1-neg78.3%
associate-/l*78.2%
Simplified78.2%
if 7.20000000000000018e-115 < F < 1.8e10Initial program 99.1%
Simplified99.3%
Taylor expanded in B around 0 60.7%
pow160.7%
sqrt-div60.9%
metadata-eval60.9%
associate-+r+60.9%
add-sqr-sqrt60.9%
unpow260.9%
hypot-define60.9%
+-commutative60.9%
fma-define60.9%
Applied egg-rr60.9%
unpow160.9%
associate-*r/61.0%
*-rgt-identity61.0%
Simplified61.0%
Taylor expanded in F around 0 61.1%
if 1.8e10 < F Initial program 52.6%
Simplified68.8%
Taylor expanded in x around 0 68.8%
associate-*l/68.8%
*-lft-identity68.8%
+-commutative68.8%
unpow268.8%
fma-undefine68.8%
Simplified68.8%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 79.9%
Final simplification76.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))))
(if (<= F -2e+244)
t_0
(if (<= F -5.8e+195)
(/ (- -1.0 x) B)
(if (<= F -0.13)
t_0
(if (<= F 5.1e+19)
(/ x (- B))
(if (<= F 3e+67) (/ 1.0 (sin B)) (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double tmp;
if (F <= -2e+244) {
tmp = t_0;
} else if (F <= -5.8e+195) {
tmp = (-1.0 - x) / B;
} else if (F <= -0.13) {
tmp = t_0;
} else if (F <= 5.1e+19) {
tmp = x / -B;
} else if (F <= 3e+67) {
tmp = 1.0 / sin(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) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) / sin(b)
if (f <= (-2d+244)) then
tmp = t_0
else if (f <= (-5.8d+195)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-0.13d0)) then
tmp = t_0
else if (f <= 5.1d+19) then
tmp = x / -b
else if (f <= 3d+67) then
tmp = 1.0d0 / sin(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -1.0 / Math.sin(B);
double tmp;
if (F <= -2e+244) {
tmp = t_0;
} else if (F <= -5.8e+195) {
tmp = (-1.0 - x) / B;
} else if (F <= -0.13) {
tmp = t_0;
} else if (F <= 5.1e+19) {
tmp = x / -B;
} else if (F <= 3e+67) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / math.sin(B) tmp = 0 if F <= -2e+244: tmp = t_0 elif F <= -5.8e+195: tmp = (-1.0 - x) / B elif F <= -0.13: tmp = t_0 elif F <= 5.1e+19: tmp = x / -B elif F <= 3e+67: tmp = 1.0 / math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -2e+244) tmp = t_0; elseif (F <= -5.8e+195) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -0.13) tmp = t_0; elseif (F <= 5.1e+19) tmp = Float64(x / Float64(-B)); elseif (F <= 3e+67) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / sin(B); tmp = 0.0; if (F <= -2e+244) tmp = t_0; elseif (F <= -5.8e+195) tmp = (-1.0 - x) / B; elseif (F <= -0.13) tmp = t_0; elseif (F <= 5.1e+19) tmp = x / -B; elseif (F <= 3e+67) tmp = 1.0 / sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+244], t$95$0, If[LessEqual[F, -5.8e+195], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -0.13], t$95$0, If[LessEqual[F, 5.1e+19], N[(x / (-B)), $MachinePrecision], If[LessEqual[F, 3e+67], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+244}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -5.8 \cdot 10^{+195}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -0.13:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{+19}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{+67}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.00000000000000015e244 or -5.79999999999999984e195 < F < -0.13Initial program 64.9%
Simplified71.7%
Taylor expanded in x around 0 71.7%
associate-*l/71.7%
*-lft-identity71.7%
+-commutative71.7%
unpow271.7%
fma-undefine71.7%
Simplified71.7%
Taylor expanded in F around -inf 95.6%
Taylor expanded in x around 0 61.2%
if -2.00000000000000015e244 < F < -5.79999999999999984e195Initial program 43.8%
Simplified68.1%
Taylor expanded in B around 0 50.1%
Taylor expanded in F around -inf 75.8%
if -0.13 < F < 5.1e19Initial program 98.5%
Simplified99.6%
Taylor expanded in B around 0 54.7%
Taylor expanded in F around 0 36.7%
associate-*r/36.7%
neg-mul-136.7%
Simplified36.7%
if 5.1e19 < F < 3.0000000000000001e67Initial program 93.4%
Simplified99.2%
Taylor expanded in x around 0 99.4%
associate-*l/99.2%
*-lft-identity99.2%
+-commutative99.2%
unpow299.2%
fma-undefine99.2%
Simplified99.2%
Taylor expanded in F around inf 99.5%
Taylor expanded in x around 0 74.0%
if 3.0000000000000001e67 < F Initial program 42.1%
Simplified59.8%
Taylor expanded in B around 0 37.9%
Taylor expanded in F around inf 64.3%
Final simplification53.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1.6e-33)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 18000000000.0)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e-33) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 18000000000.0) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.6d-33)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 18000000000.0d0) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e-33) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 18000000000.0) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.6e-33: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 18000000000.0: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.6e-33) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 18000000000.0) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.6e-33) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 18000000000.0) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.6e-33], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 18000000000.0], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 18000000000:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.59999999999999988e-33Initial program 63.3%
Taylor expanded in F around -inf 93.3%
Taylor expanded in B around 0 74.0%
associate-*r/44.9%
neg-mul-144.9%
Simplified74.0%
if -1.59999999999999988e-33 < F < 1.8e10Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 54.9%
Taylor expanded in F around 0 55.0%
if 1.8e10 < F Initial program 52.6%
Simplified68.8%
Taylor expanded in x around 0 68.8%
associate-*l/68.8%
*-lft-identity68.8%
+-commutative68.8%
unpow268.8%
fma-undefine68.8%
Simplified68.8%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 79.9%
Final simplification68.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.6e-33)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 18000000000.0)
(/ (- (/ F (sqrt (+ 2.0 (* x 2.0)))) x) B)
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e-33) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 18000000000.0) {
tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.6d-33)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 18000000000.0d0) then
tmp = ((f / sqrt((2.0d0 + (x * 2.0d0)))) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e-33) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 18000000000.0) {
tmp = ((F / Math.sqrt((2.0 + (x * 2.0)))) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.6e-33: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 18000000000.0: tmp = ((F / math.sqrt((2.0 + (x * 2.0)))) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.6e-33) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 18000000000.0) tmp = Float64(Float64(Float64(F / sqrt(Float64(2.0 + Float64(x * 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.6e-33) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 18000000000.0) tmp = ((F / sqrt((2.0 + (x * 2.0)))) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.6e-33], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 18000000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 18000000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.59999999999999988e-33Initial program 63.3%
Taylor expanded in F around -inf 93.3%
Taylor expanded in B around 0 74.0%
associate-*r/44.9%
neg-mul-144.9%
Simplified74.0%
if -1.59999999999999988e-33 < F < 1.8e10Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 54.9%
pow154.9%
sqrt-div54.9%
metadata-eval54.9%
associate-+r+54.9%
add-sqr-sqrt54.9%
unpow254.9%
hypot-define54.9%
+-commutative54.9%
fma-define54.9%
Applied egg-rr54.9%
unpow154.9%
associate-*r/54.9%
*-rgt-identity54.9%
Simplified54.9%
Taylor expanded in F around 0 54.9%
if 1.8e10 < F Initial program 52.6%
Simplified68.8%
Taylor expanded in x around 0 68.8%
associate-*l/68.8%
*-lft-identity68.8%
+-commutative68.8%
unpow268.8%
fma-undefine68.8%
Simplified68.8%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 79.9%
Final simplification68.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))))
(if (<= F -2.1e+242)
t_0
(if (<= F -5.7e+195)
(/ (- -1.0 x) B)
(if (<= F -0.21)
t_0
(if (<= F 1.05e-136) (/ x (- B)) (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double tmp;
if (F <= -2.1e+242) {
tmp = t_0;
} else if (F <= -5.7e+195) {
tmp = (-1.0 - x) / B;
} else if (F <= -0.21) {
tmp = t_0;
} else if (F <= 1.05e-136) {
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) :: t_0
real(8) :: tmp
t_0 = (-1.0d0) / sin(b)
if (f <= (-2.1d+242)) then
tmp = t_0
else if (f <= (-5.7d+195)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-0.21d0)) then
tmp = t_0
else if (f <= 1.05d-136) 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 t_0 = -1.0 / Math.sin(B);
double tmp;
if (F <= -2.1e+242) {
tmp = t_0;
} else if (F <= -5.7e+195) {
tmp = (-1.0 - x) / B;
} else if (F <= -0.21) {
tmp = t_0;
} else if (F <= 1.05e-136) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = -1.0 / math.sin(B) tmp = 0 if F <= -2.1e+242: tmp = t_0 elif F <= -5.7e+195: tmp = (-1.0 - x) / B elif F <= -0.21: tmp = t_0 elif F <= 1.05e-136: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -2.1e+242) tmp = t_0; elseif (F <= -5.7e+195) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -0.21) tmp = t_0; elseif (F <= 1.05e-136) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -1.0 / sin(B); tmp = 0.0; if (F <= -2.1e+242) tmp = t_0; elseif (F <= -5.7e+195) tmp = (-1.0 - x) / B; elseif (F <= -0.21) tmp = t_0; elseif (F <= 1.05e-136) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.1e+242], t$95$0, If[LessEqual[F, -5.7e+195], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -0.21], t$95$0, If[LessEqual[F, 1.05e-136], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -2.1 \cdot 10^{+242}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -5.7 \cdot 10^{+195}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -0.21:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.0999999999999999e242 or -5.7000000000000002e195 < F < -0.209999999999999992Initial program 64.9%
Simplified71.7%
Taylor expanded in x around 0 71.7%
associate-*l/71.7%
*-lft-identity71.7%
+-commutative71.7%
unpow271.7%
fma-undefine71.7%
Simplified71.7%
Taylor expanded in F around -inf 95.6%
Taylor expanded in x around 0 61.2%
if -2.0999999999999999e242 < F < -5.7000000000000002e195Initial program 43.8%
Simplified68.1%
Taylor expanded in B around 0 50.1%
Taylor expanded in F around -inf 75.8%
if -0.209999999999999992 < F < 1.0499999999999999e-136Initial program 99.5%
Simplified99.6%
Taylor expanded in B around 0 53.1%
Taylor expanded in F around 0 42.2%
associate-*r/42.2%
neg-mul-142.2%
Simplified42.2%
if 1.0499999999999999e-136 < F Initial program 64.2%
Simplified76.4%
Taylor expanded in B around 0 43.5%
Taylor expanded in F around inf 48.8%
Final simplification51.2%
(FPCore (F B x) :precision binary64 (if (<= F 5e+19) (- (/ -1.0 B) (/ x (tan B))) (if (<= F 3.7e+67) (/ 1.0 (sin B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= 5e+19) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 3.7e+67) {
tmp = 1.0 / sin(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 <= 5d+19) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 3.7d+67) then
tmp = 1.0d0 / sin(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 <= 5e+19) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 3.7e+67) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 5e+19: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 3.7e+67: tmp = 1.0 / math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 5e+19) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 3.7e+67) tmp = Float64(1.0 / sin(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 <= 5e+19) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 3.7e+67) tmp = 1.0 / sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 5e+19], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.7e+67], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5 \cdot 10^{+19}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 3.7 \cdot 10^{+67}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5e19Initial program 82.9%
Simplified87.8%
Taylor expanded in F around -inf 59.8%
Taylor expanded in B around 0 58.1%
if 5e19 < F < 3.6999999999999997e67Initial program 93.4%
Simplified99.2%
Taylor expanded in x around 0 99.4%
associate-*l/99.2%
*-lft-identity99.2%
+-commutative99.2%
unpow299.2%
fma-undefine99.2%
Simplified99.2%
Taylor expanded in F around inf 99.5%
Taylor expanded in x around 0 74.0%
if 3.6999999999999997e67 < F Initial program 42.1%
Simplified59.8%
Taylor expanded in B around 0 37.9%
Taylor expanded in F around inf 64.3%
(FPCore (F B x) :precision binary64 (if (<= F -0.16) (- (/ -1.0 (sin B)) (/ x B)) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.16) {
tmp = (-1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.16d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.16) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.16: tmp = (-1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.16) tmp = (-1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.16:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -0.160000000000000003Initial program 60.4%
Taylor expanded in F around -inf 96.4%
Taylor expanded in B around 0 76.9%
associate-*r/41.8%
neg-mul-141.8%
Simplified76.9%
if -0.160000000000000003 < F Initial program 80.0%
Simplified86.8%
Taylor expanded in x around 0 86.8%
associate-*l/86.8%
*-lft-identity86.8%
+-commutative86.8%
unpow286.8%
fma-undefine86.8%
Simplified86.8%
Taylor expanded in F around inf 63.8%
Taylor expanded in B around 0 62.2%
Final simplification66.5%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ x (tan B)))) (if (<= F -6.5e-226) (- (/ -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 <= -6.5e-226) {
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 <= (-6.5d-226)) 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 <= -6.5e-226) {
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 <= -6.5e-226: 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 <= -6.5e-226) 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 <= -6.5e-226) 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, -6.5e-226], 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 -6.5 \cdot 10^{-226}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -6.50000000000000033e-226Initial program 73.5%
Simplified80.5%
Taylor expanded in F around -inf 78.4%
Taylor expanded in B around 0 65.8%
if -6.50000000000000033e-226 < F Initial program 74.9%
Simplified83.5%
Taylor expanded in x around 0 83.5%
associate-*l/83.5%
*-lft-identity83.5%
+-commutative83.5%
unpow283.5%
fma-undefine83.5%
Simplified83.5%
Taylor expanded in F around inf 69.3%
Taylor expanded in B around 0 63.9%
(FPCore (F B x) :precision binary64 (if (<= F -7.5e-138) (/ (- -1.0 x) B) (if (<= F 1.05e-136) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-138) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.05e-136) {
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 <= (-7.5d-138)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.05d-136) 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 <= -7.5e-138) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.05e-136) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.5e-138: tmp = (-1.0 - x) / B elif F <= 1.05e-136: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.5e-138) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.05e-136) 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 <= -7.5e-138) tmp = (-1.0 - x) / B; elseif (F <= 1.05e-136) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.5e-138], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.05e-136], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.5 \cdot 10^{-138}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-136}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.4999999999999995e-138Initial program 69.8%
Simplified77.8%
Taylor expanded in B around 0 40.5%
Taylor expanded in F around -inf 46.6%
if -7.4999999999999995e-138 < F < 1.0499999999999999e-136Initial program 99.6%
Simplified99.8%
Taylor expanded in B around 0 54.9%
Taylor expanded in F around 0 48.1%
associate-*r/48.1%
neg-mul-148.1%
Simplified48.1%
if 1.0499999999999999e-136 < F Initial program 64.2%
Simplified76.4%
Taylor expanded in B around 0 43.5%
Taylor expanded in F around inf 48.8%
Final simplification47.8%
(FPCore (F B x) :precision binary64 (if (or (<= x -5.2e-107) (not (<= x 9.5e-31))) (/ x (- B)) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -5.2e-107) || !(x <= 9.5e-31)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-5.2d-107)) .or. (.not. (x <= 9.5d-31))) then
tmp = x / -b
else
tmp = (-1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -5.2e-107) || !(x <= 9.5e-31)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -5.2e-107) or not (x <= 9.5e-31): tmp = x / -B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -5.2e-107) || !(x <= 9.5e-31)) 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 ((x <= -5.2e-107) || ~((x <= 9.5e-31))) tmp = x / -B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -5.2e-107], N[Not[LessEqual[x, 9.5e-31]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{-107} \lor \neg \left(x \leq 9.5 \cdot 10^{-31}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -5.2000000000000001e-107 or 9.5000000000000008e-31 < x Initial program 84.0%
Simplified96.8%
Taylor expanded in B around 0 56.4%
Taylor expanded in F around 0 51.5%
associate-*r/51.5%
neg-mul-151.5%
Simplified51.5%
if -5.2000000000000001e-107 < x < 9.5000000000000008e-31Initial program 63.9%
Simplified66.6%
Taylor expanded in B around 0 32.5%
Taylor expanded in F around -inf 18.8%
Taylor expanded in x around 0 18.8%
Final simplification35.6%
(FPCore (F B x) :precision binary64 (if (<= F -7.5e-138) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-138) {
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 <= (-7.5d-138)) 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 <= -7.5e-138) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.5e-138: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.5e-138) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.5e-138) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.5e-138], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.5 \cdot 10^{-138}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -7.4999999999999995e-138Initial program 69.8%
Simplified77.8%
Taylor expanded in B around 0 40.5%
Taylor expanded in F around -inf 46.6%
if -7.4999999999999995e-138 < F Initial program 77.1%
Simplified84.9%
Taylor expanded in B around 0 47.6%
Taylor expanded in F around 0 33.5%
associate-*r/33.5%
neg-mul-133.5%
Simplified33.5%
Final simplification38.6%
(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 74.3%
Simplified82.2%
Taylor expanded in B around 0 44.8%
Taylor expanded in F around -inf 32.3%
Taylor expanded in x around 0 11.5%
herbie shell --seed 2024116
(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))))))