
(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 19 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 -6e+164)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 120000000.0)
(- (/ F (* (sin B) (sqrt (fma F F 2.0)))) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -6e+164) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6e+164) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 120000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6e+164], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{+164}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -6.00000000000000001e164Initial program 20.1%
Simplified33.5%
Taylor expanded in x around 0 33.5%
associate-*l/33.5%
*-lft-identity33.5%
+-commutative33.5%
unpow233.5%
fma-undefine33.5%
Simplified33.5%
Taylor expanded in F around -inf 99.7%
if -6.00000000000000001e164 < F < 1.2e8Initial program 98.8%
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%
associate-*r/99.5%
sqrt-div99.5%
metadata-eval99.5%
un-div-inv99.6%
Applied egg-rr99.6%
associate-/l/99.6%
Simplified99.6%
if 1.2e8 < F Initial program 62.9%
Simplified75.2%
Taylor expanded in F around inf 99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -8e+15)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 2.8e+19)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e+15) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 2.8e+19) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8d+15)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 2.8d+19) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8e+15) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 2.8e+19) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8e+15: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 2.8e+19: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8e+15) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 2.8e+19) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8e+15) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 2.8e+19) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e+19], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{+19}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -8e15Initial program 61.8%
Simplified69.9%
Taylor expanded in x around 0 69.9%
associate-*l/69.9%
*-lft-identity69.9%
+-commutative69.9%
unpow269.9%
fma-undefine69.9%
Simplified69.9%
Taylor expanded in F around -inf 99.8%
if -8e15 < F < 2.8e19Initial program 99.4%
if 2.8e19 < F Initial program 61.9%
Simplified74.5%
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 -68000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.00088)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ (/ F (* F (+ 1.0 (/ 1.0 (pow F 2.0))))) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -68000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.00088) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = ((F / (F * (1.0 + (1.0 / pow(F, 2.0))))) / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-68000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.00088d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = ((f / (f * (1.0d0 + (1.0d0 / (f ** 2.0d0))))) / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -68000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.00088) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = ((F / (F * (1.0 + (1.0 / Math.pow(F, 2.0))))) / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -68000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.00088: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = ((F / (F * (1.0 + (1.0 / math.pow(F, 2.0))))) / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -68000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.00088) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(Float64(F / Float64(F * Float64(1.0 + Float64(1.0 / (F ^ 2.0))))) / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -68000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.00088) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = ((F / (F * (1.0 + (1.0 / (F ^ 2.0))))) / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -68000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.00088], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(N[(F / N[(F * N[(1.0 + N[(1.0 / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -68000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.00088:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{F \cdot \left(1 + \frac{1}{{F}^{2}}\right)}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.8e13Initial program 62.6%
Simplified70.4%
Taylor expanded in x around 0 70.5%
associate-*l/70.4%
*-lft-identity70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around -inf 99.8%
if -6.8e13 < F < 8.80000000000000031e-4Initial 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 99.3%
if 8.80000000000000031e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
associate-*r/75.8%
sqrt-div75.8%
metadata-eval75.8%
un-div-inv75.9%
Applied egg-rr75.9%
Taylor expanded in F around inf 99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -68000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.00088)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -68000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.00088) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-68000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.00088d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -68000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.00088) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -68000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.00088: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -68000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.00088) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -68000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.00088) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -68000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.00088], 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] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -68000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.00088:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -6.8e13Initial program 62.6%
Simplified70.4%
Taylor expanded in x around 0 70.5%
associate-*l/70.4%
*-lft-identity70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around -inf 99.8%
if -6.8e13 < F < 8.80000000000000031e-4Initial 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 99.3%
if 8.80000000000000031e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in F around inf 99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -68000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.00088)
(- (* 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 <= -68000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.00088) {
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 <= (-68000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.00088d0) 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 <= -68000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.00088) {
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 <= -68000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.00088: 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 <= -68000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.00088) 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 <= -68000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.00088) 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, -68000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.00088], 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 -68000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.00088:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.8e13Initial program 62.6%
Simplified70.4%
Taylor expanded in x around 0 70.5%
associate-*l/70.4%
*-lft-identity70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around -inf 99.8%
if -6.8e13 < F < 8.80000000000000031e-4Initial 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 99.3%
if 8.80000000000000031e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around inf 99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -68000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.1e-105)
(- (/ (* F (sqrt 0.5)) B) t_0)
(if (<= F 0.00088)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ 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 <= -68000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.1e-105) {
tmp = ((F * sqrt(0.5)) / B) - t_0;
} else if (F <= 0.00088) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (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 <= (-68000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.1d-105) then
tmp = ((f * sqrt(0.5d0)) / b) - t_0
else if (f <= 0.00088d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (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 <= -68000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.1e-105) {
tmp = ((F * Math.sqrt(0.5)) / B) - t_0;
} else if (F <= 0.00088) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (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 <= -68000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.1e-105: tmp = ((F * math.sqrt(0.5)) / B) - t_0 elif F <= 0.00088: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (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 <= -68000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.1e-105) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_0); elseif (F <= 0.00088) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / 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 <= -68000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.1e-105) tmp = ((F * sqrt(0.5)) / B) - t_0; elseif (F <= 0.00088) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (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, -68000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.1e-105], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.00088], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -68000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\
\mathbf{elif}\;F \leq 0.00088:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.8e13Initial program 62.6%
Simplified70.4%
Taylor expanded in x around 0 70.5%
associate-*l/70.4%
*-lft-identity70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around -inf 99.8%
if -6.8e13 < F < 1.10000000000000002e-105Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 99.3%
Taylor expanded in B around 0 87.4%
if 1.10000000000000002e-105 < F < 8.80000000000000031e-4Initial program 99.2%
Taylor expanded in B around 0 89.9%
associate-*r/89.9%
neg-mul-189.9%
Simplified89.9%
if 8.80000000000000031e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around inf 99.3%
Final simplification93.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B))
(t_1 (/ x (tan B))))
(if (<= F -0.0011)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.9e-168)
t_0
(if (<= F 5.4e-110)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 0.00062) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
double t_1 = x / tan(B);
double tmp;
if (F <= -0.0011) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.9e-168) {
tmp = t_0;
} else if (F <= 5.4e-110) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 0.00062) {
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((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
t_1 = x / tan(b)
if (f <= (-0.0011d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-3.9d-168)) then
tmp = t_0
else if (f <= 5.4d-110) then
tmp = (cos(b) * -x) / sin(b)
else if (f <= 0.00062d0) 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((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.0011) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -3.9e-168) {
tmp = t_0;
} else if (F <= 5.4e-110) {
tmp = (Math.cos(B) * -x) / Math.sin(B);
} else if (F <= 0.00062) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B t_1 = x / math.tan(B) tmp = 0 if F <= -0.0011: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -3.9e-168: tmp = t_0 elif F <= 5.4e-110: tmp = (math.cos(B) * -x) / math.sin(B) elif F <= 0.00062: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0011) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.9e-168) tmp = t_0; elseif (F <= 5.4e-110) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 0.00062) 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((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; t_1 = x / tan(B); tmp = 0.0; if (F <= -0.0011) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -3.9e-168) tmp = t_0; elseif (F <= 5.4e-110) tmp = (cos(B) * -x) / sin(B); elseif (F <= 0.00062) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0011], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.9e-168], t$95$0, If[LessEqual[F, 5.4e-110], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00062], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.0011:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -3.9 \cdot 10^{-168}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-110}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.00062:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -0.00110000000000000007Initial program 63.9%
Simplified71.5%
Taylor expanded in x around 0 71.5%
associate-*l/71.5%
*-lft-identity71.5%
+-commutative71.5%
unpow271.5%
fma-undefine71.5%
Simplified71.5%
Taylor expanded in F around -inf 99.8%
if -0.00110000000000000007 < F < -3.90000000000000012e-168 or 5.3999999999999996e-110 < F < 6.2e-4Initial program 99.3%
Simplified99.5%
Taylor expanded in B around 0 60.4%
unpow260.4%
Applied egg-rr60.4%
if -3.90000000000000012e-168 < F < 5.3999999999999996e-110Initial program 99.4%
Taylor expanded in F around -inf 39.8%
Taylor expanded in x around inf 86.9%
if 6.2e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around inf 99.3%
Final simplification87.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B))
(t_1 (/ x (tan B))))
(if (<= F -0.015)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.8e-168)
t_0
(if (<= F 1.42e-109)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 0.0005) t_0 (- (/ 1.0 B) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
double t_1 = x / tan(B);
double tmp;
if (F <= -0.015) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.8e-168) {
tmp = t_0;
} else if (F <= 1.42e-109) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 0.0005) {
tmp = t_0;
} else {
tmp = (1.0 / 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((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
t_1 = x / tan(b)
if (f <= (-0.015d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-3.8d-168)) then
tmp = t_0
else if (f <= 1.42d-109) then
tmp = (cos(b) * -x) / sin(b)
else if (f <= 0.0005d0) then
tmp = t_0
else
tmp = (1.0d0 / 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((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.015) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -3.8e-168) {
tmp = t_0;
} else if (F <= 1.42e-109) {
tmp = (Math.cos(B) * -x) / Math.sin(B);
} else if (F <= 0.0005) {
tmp = t_0;
} else {
tmp = (1.0 / B) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B t_1 = x / math.tan(B) tmp = 0 if F <= -0.015: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -3.8e-168: tmp = t_0 elif F <= 1.42e-109: tmp = (math.cos(B) * -x) / math.sin(B) elif F <= 0.0005: tmp = t_0 else: tmp = (1.0 / B) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.015) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.8e-168) tmp = t_0; elseif (F <= 1.42e-109) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 0.0005) tmp = t_0; else tmp = Float64(Float64(1.0 / B) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; t_1 = x / tan(B); tmp = 0.0; if (F <= -0.015) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -3.8e-168) tmp = t_0; elseif (F <= 1.42e-109) tmp = (cos(B) * -x) / sin(B); elseif (F <= 0.0005) tmp = t_0; else tmp = (1.0 / B) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.015], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.8e-168], t$95$0, If[LessEqual[F, 1.42e-109], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0005], t$95$0, N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.015:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-168}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{-109}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.0005:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_1\\
\end{array}
\end{array}
if F < -0.014999999999999999Initial program 63.9%
Simplified71.5%
Taylor expanded in x around 0 71.5%
associate-*l/71.5%
*-lft-identity71.5%
+-commutative71.5%
unpow271.5%
fma-undefine71.5%
Simplified71.5%
Taylor expanded in F around -inf 99.8%
if -0.014999999999999999 < F < -3.8e-168 or 1.41999999999999994e-109 < F < 5.0000000000000001e-4Initial program 99.3%
Simplified99.5%
Taylor expanded in B around 0 60.4%
unpow260.4%
Applied egg-rr60.4%
if -3.8e-168 < F < 1.41999999999999994e-109Initial program 99.4%
Taylor expanded in F around -inf 39.8%
Taylor expanded in x around inf 86.9%
if 5.0000000000000001e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around inf 99.3%
Taylor expanded in B around 0 71.1%
Final simplification78.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -68000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.00088)
(- (* F (/ (sqrt 0.5) B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -68000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.00088) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-68000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.00088d0) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -68000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.00088) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -68000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.00088: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -68000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.00088) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -68000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.00088) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -68000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.00088], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -68000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.00088:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.8e13Initial program 62.6%
Simplified70.4%
Taylor expanded in x around 0 70.5%
associate-*l/70.4%
*-lft-identity70.4%
+-commutative70.4%
unpow270.4%
fma-undefine70.4%
Simplified70.4%
Taylor expanded in F around -inf 99.8%
if -6.8e13 < F < 8.80000000000000031e-4Initial 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 99.3%
Taylor expanded in B around 0 84.3%
if 8.80000000000000031e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around inf 99.3%
(FPCore (F B x) :precision binary64 (if (<= B 1.7e-5) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B) (/ (* (cos B) (- x)) (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.7e-5) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (cos(B) * -x) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 1.7d-5) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (cos(b) * -x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 1.7e-5) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (Math.cos(B) * -x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 1.7e-5: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (math.cos(B) * -x) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 1.7e-5) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); else tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 1.7e-5) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (cos(B) * -x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 1.7e-5], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\end{array}
\end{array}
if B < 1.7e-5Initial program 79.1%
Simplified85.8%
Taylor expanded in B around 0 54.6%
unpow254.6%
Applied egg-rr54.6%
if 1.7e-5 < B Initial program 88.4%
Taylor expanded in F around -inf 60.6%
Taylor expanded in x around inf 66.9%
Final simplification57.4%
(FPCore (F B x)
:precision binary64
(if (<= F -8e+15)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7.3e-109)
(/ x (- (tan B)))
(if (<= F 0.00072)
(/ (- (* F (sqrt 0.5)) x) B)
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e+15) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7.3e-109) {
tmp = x / -tan(B);
} else if (F <= 0.00072) {
tmp = ((F * sqrt(0.5)) - 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 <= (-8d+15)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 7.3d-109) then
tmp = x / -tan(b)
else if (f <= 0.00072d0) then
tmp = ((f * sqrt(0.5d0)) - 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 <= -8e+15) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 7.3e-109) {
tmp = x / -Math.tan(B);
} else if (F <= 0.00072) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8e+15: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 7.3e-109: tmp = x / -math.tan(B) elif F <= 0.00072: tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8e+15) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7.3e-109) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 0.00072) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - 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 <= -8e+15) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 7.3e-109) tmp = x / -tan(B); elseif (F <= 0.00072) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8e+15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.3e-109], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.00072], N[(N[(N[(F * N[Sqrt[0.5], $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 -8 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.3 \cdot 10^{-109}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 0.00072:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -8e15Initial program 61.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 79.2%
associate-*r/42.4%
neg-mul-142.4%
Simplified79.2%
if -8e15 < F < 7.3000000000000003e-109Initial program 99.4%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around inf 35.4%
Taylor expanded in x around inf 72.7%
mul-1-neg72.7%
associate-/l*72.5%
distribute-rgt-neg-in72.5%
distribute-neg-frac272.5%
Simplified72.5%
add-sqr-sqrt37.4%
pow237.4%
sqrt-prod31.8%
clear-num31.7%
sqrt-div31.7%
add-sqr-sqrt19.7%
sqrt-unprod18.4%
sqr-neg18.4%
sqrt-unprod0.2%
add-sqr-sqrt0.3%
tan-quot0.3%
sqrt-div0.3%
sqrt-prod1.1%
div-inv1.1%
Applied egg-rr72.6%
neg-sub072.6%
distribute-frac-neg272.6%
Simplified72.6%
if 7.3000000000000003e-109 < F < 7.20000000000000045e-4Initial program 99.2%
Simplified99.4%
Taylor expanded in x around 0 99.4%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-undefine99.4%
Simplified99.4%
Taylor expanded in F around 0 99.1%
Taylor expanded in B around 0 61.8%
if 7.20000000000000045e-4 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around inf 99.3%
Taylor expanded in B around 0 71.1%
Final simplification72.3%
(FPCore (F B x) :precision binary64 (if (<= B 7.2e-5) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B) (/ x (- (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 7.2e-5) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = 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 (b <= 7.2d-5) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = x / -tan(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 7.2e-5) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = x / -Math.tan(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 7.2e-5: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = x / -math.tan(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 7.2e-5) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); else tmp = Float64(x / Float64(-tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 7.2e-5) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = x / -tan(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 7.2e-5], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 7.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\end{array}
\end{array}
if B < 7.20000000000000018e-5Initial program 79.1%
Simplified85.8%
Taylor expanded in B around 0 54.6%
unpow254.6%
Applied egg-rr54.6%
if 7.20000000000000018e-5 < B Initial program 88.4%
Simplified88.7%
Taylor expanded in x around 0 88.7%
associate-*l/88.7%
*-lft-identity88.7%
+-commutative88.7%
unpow288.7%
fma-undefine88.7%
Simplified88.7%
Taylor expanded in F around inf 60.3%
Taylor expanded in x around inf 66.9%
mul-1-neg66.9%
associate-/l*66.8%
distribute-rgt-neg-in66.8%
distribute-neg-frac266.8%
Simplified66.8%
add-sqr-sqrt28.2%
pow228.2%
sqrt-prod20.1%
clear-num20.1%
sqrt-div20.1%
add-sqr-sqrt11.5%
sqrt-unprod11.6%
sqr-neg11.6%
sqrt-unprod0.1%
add-sqr-sqrt0.3%
tan-quot0.3%
sqrt-div0.3%
sqrt-prod0.8%
div-inv0.8%
Applied egg-rr66.9%
neg-sub066.9%
distribute-frac-neg266.9%
Simplified66.9%
Final simplification57.4%
(FPCore (F B x)
:precision binary64
(if (<= F 6.3e-109)
(/ x (- (tan B)))
(if (<= F 6.5e-5)
(/ (- (* F (sqrt 0.5)) x) B)
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= 6.3e-109) {
tmp = x / -tan(B);
} else if (F <= 6.5e-5) {
tmp = ((F * sqrt(0.5)) - 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 <= 6.3d-109) then
tmp = x / -tan(b)
else if (f <= 6.5d-5) then
tmp = ((f * sqrt(0.5d0)) - 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 <= 6.3e-109) {
tmp = x / -Math.tan(B);
} else if (F <= 6.5e-5) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 6.3e-109: tmp = x / -math.tan(B) elif F <= 6.5e-5: tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 6.3e-109) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 6.5e-5) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - 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 <= 6.3e-109) tmp = x / -tan(B); elseif (F <= 6.5e-5) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 6.3e-109], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 6.5e-5], N[(N[(N[(F * N[Sqrt[0.5], $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 6.3 \cdot 10^{-109}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < 6.3000000000000001e-109Initial program 86.7%
Simplified89.6%
Taylor expanded in x around 0 89.5%
associate-*l/89.6%
*-lft-identity89.6%
+-commutative89.6%
unpow289.6%
fma-undefine89.6%
Simplified89.6%
Taylor expanded in F around inf 37.9%
Taylor expanded in x around inf 62.9%
mul-1-neg62.9%
associate-/l*62.8%
distribute-rgt-neg-in62.8%
distribute-neg-frac262.8%
Simplified62.8%
add-sqr-sqrt32.6%
pow232.6%
sqrt-prod25.5%
clear-num25.5%
sqrt-div25.4%
add-sqr-sqrt16.2%
sqrt-unprod14.6%
sqr-neg14.6%
sqrt-unprod0.2%
add-sqr-sqrt0.2%
tan-quot0.2%
sqrt-div0.2%
sqrt-prod1.1%
div-inv1.1%
Applied egg-rr62.9%
neg-sub062.9%
distribute-frac-neg262.9%
Simplified62.9%
if 6.3000000000000001e-109 < F < 6.49999999999999943e-5Initial program 99.2%
Simplified99.4%
Taylor expanded in x around 0 99.4%
associate-*l/99.4%
*-lft-identity99.4%
+-commutative99.4%
unpow299.4%
fma-undefine99.4%
Simplified99.4%
Taylor expanded in F around 0 99.1%
Taylor expanded in B around 0 61.8%
if 6.49999999999999943e-5 < F Initial program 63.9%
Simplified75.8%
Taylor expanded in x around 0 75.8%
associate-*l/75.8%
*-lft-identity75.8%
+-commutative75.8%
unpow275.8%
fma-undefine75.8%
Simplified75.8%
Taylor expanded in F around inf 99.3%
Taylor expanded in B around 0 71.1%
(FPCore (F B x) :precision binary64 (if (<= B 4.5e-170) (/ x (- B)) (if (<= B 8.2e-10) (/ (- 1.0 x) B) (/ x (- (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 4.5e-170) {
tmp = x / -B;
} else if (B <= 8.2e-10) {
tmp = (1.0 - x) / B;
} else {
tmp = 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 (b <= 4.5d-170) then
tmp = x / -b
else if (b <= 8.2d-10) then
tmp = (1.0d0 - x) / b
else
tmp = x / -tan(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 4.5e-170) {
tmp = x / -B;
} else if (B <= 8.2e-10) {
tmp = (1.0 - x) / B;
} else {
tmp = x / -Math.tan(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 4.5e-170: tmp = x / -B elif B <= 8.2e-10: tmp = (1.0 - x) / B else: tmp = x / -math.tan(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 4.5e-170) tmp = Float64(x / Float64(-B)); elseif (B <= 8.2e-10) tmp = Float64(Float64(1.0 - x) / B); else tmp = Float64(x / Float64(-tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 4.5e-170) tmp = x / -B; elseif (B <= 8.2e-10) tmp = (1.0 - x) / B; else tmp = x / -tan(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 4.5e-170], N[(x / (-B)), $MachinePrecision], If[LessEqual[B, 8.2e-10], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.5 \cdot 10^{-170}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{elif}\;B \leq 8.2 \cdot 10^{-10}:\\
\;\;\;\;\frac{1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\end{array}
\end{array}
if B < 4.50000000000000002e-170Initial program 79.6%
Simplified84.5%
Taylor expanded in B around 0 47.6%
Taylor expanded in F around 0 30.8%
neg-mul-130.8%
distribute-neg-frac230.8%
Simplified30.8%
if 4.50000000000000002e-170 < B < 8.1999999999999996e-10Initial program 76.3%
Simplified93.2%
Taylor expanded in B around 0 93.1%
Taylor expanded in F around inf 61.2%
if 8.1999999999999996e-10 < B Initial program 88.4%
Simplified88.7%
Taylor expanded in x around 0 88.7%
associate-*l/88.7%
*-lft-identity88.7%
+-commutative88.7%
unpow288.7%
fma-undefine88.7%
Simplified88.7%
Taylor expanded in F around inf 60.3%
Taylor expanded in x around inf 66.9%
mul-1-neg66.9%
associate-/l*66.8%
distribute-rgt-neg-in66.8%
distribute-neg-frac266.8%
Simplified66.8%
add-sqr-sqrt28.2%
pow228.2%
sqrt-prod20.1%
clear-num20.1%
sqrt-div20.1%
add-sqr-sqrt11.5%
sqrt-unprod11.6%
sqr-neg11.6%
sqrt-unprod0.1%
add-sqr-sqrt0.3%
tan-quot0.3%
sqrt-div0.3%
sqrt-prod0.8%
div-inv0.8%
Applied egg-rr66.9%
neg-sub066.9%
distribute-frac-neg266.9%
Simplified66.9%
(FPCore (F B x) :precision binary64 (if (<= F 1.85e-79) (/ x (- (tan B))) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.85e-79) {
tmp = x / -tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1.85d-79) then
tmp = x / -tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1.85e-79) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.85e-79: tmp = x / -math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.85e-79) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1.85e-79) tmp = x / -tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.85e-79], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.85 \cdot 10^{-79}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < 1.85000000000000009e-79Initial program 87.5%
Simplified90.1%
Taylor expanded in x around 0 90.1%
associate-*l/90.1%
*-lft-identity90.1%
+-commutative90.1%
unpow290.1%
fma-undefine90.1%
Simplified90.1%
Taylor expanded in F around inf 36.7%
Taylor expanded in x around inf 62.2%
mul-1-neg62.2%
associate-/l*62.1%
distribute-rgt-neg-in62.1%
distribute-neg-frac262.1%
Simplified62.1%
add-sqr-sqrt32.3%
pow232.3%
sqrt-prod25.5%
clear-num25.5%
sqrt-div25.5%
add-sqr-sqrt16.8%
sqrt-unprod15.3%
sqr-neg15.3%
sqrt-unprod0.2%
add-sqr-sqrt0.3%
tan-quot0.3%
sqrt-div0.3%
sqrt-prod1.2%
div-inv1.2%
Applied egg-rr62.2%
neg-sub062.2%
distribute-frac-neg262.2%
Simplified62.2%
if 1.85000000000000009e-79 < F Initial program 70.8%
Simplified80.5%
Taylor expanded in x around 0 80.4%
associate-*l/80.5%
*-lft-identity80.5%
+-commutative80.5%
unpow280.5%
fma-undefine80.5%
Simplified80.5%
Taylor expanded in F around inf 86.1%
Taylor expanded in B around 0 63.1%
(FPCore (F B x) :precision binary64 (if (<= F -5.9e-75) (/ (- -1.0 x) B) (if (<= F 1.2e-77) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.9e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.2e-77) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-5.9d-75)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.2d-77) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.9e-75) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.2e-77) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.9e-75: tmp = (-1.0 - x) / B elif F <= 1.2e-77: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.9e-75) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.2e-77) 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 <= -5.9e-75) tmp = (-1.0 - x) / B; elseif (F <= 1.2e-77) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.9e-75], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.2e-77], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.9 \cdot 10^{-75}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-77}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.9e-75Initial program 71.6%
Simplified77.5%
Taylor expanded in B around 0 39.9%
Taylor expanded in F around -inf 42.2%
if -5.9e-75 < F < 1.19999999999999995e-77Initial program 99.5%
Simplified99.7%
Taylor expanded in B around 0 50.6%
Taylor expanded in F around 0 38.4%
neg-mul-138.4%
distribute-neg-frac238.4%
Simplified38.4%
if 1.19999999999999995e-77 < F Initial program 70.8%
Simplified80.5%
Taylor expanded in B around 0 38.8%
Taylor expanded in F around inf 40.7%
(FPCore (F B x) :precision binary64 (if (<= F -6.6e-74) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-74) {
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 <= (-6.6d-74)) 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 <= -6.6e-74) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.6e-74: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.6e-74) 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 <= -6.6e-74) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.6e-74], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{-74}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -6.59999999999999992e-74Initial program 71.6%
Simplified77.5%
Taylor expanded in B around 0 39.9%
Taylor expanded in F around -inf 42.2%
if -6.59999999999999992e-74 < F Initial program 84.8%
Simplified89.8%
Taylor expanded in B around 0 44.5%
Taylor expanded in F around 0 28.0%
neg-mul-128.0%
distribute-neg-frac228.0%
Simplified28.0%
(FPCore (F B x) :precision binary64 (if (<= F -2.9e+146) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.9e+146) {
tmp = -1.0 / 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 <= (-2.9d+146)) then
tmp = (-1.0d0) / 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 <= -2.9e+146) {
tmp = -1.0 / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.9e+146: tmp = -1.0 / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.9e+146) tmp = Float64(-1.0 / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.9e+146) tmp = -1.0 / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.9e+146], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.9 \cdot 10^{+146}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -2.8999999999999998e146Initial program 31.8%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 72.6%
Taylor expanded in x around 0 35.3%
if -2.8999999999999998e146 < F Initial program 87.1%
Simplified91.6%
Taylor expanded in B around 0 46.3%
Taylor expanded in F around 0 27.7%
neg-mul-127.7%
distribute-neg-frac227.7%
Simplified27.7%
(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 81.2%
Taylor expanded in F around -inf 49.5%
Taylor expanded in B around 0 49.3%
Taylor expanded in x around 0 8.6%
herbie shell --seed 2024139
(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))))))