
(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 -8.2e+64)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 600000000.0)
(- (/ (/ F (sin B)) (sqrt (fma F F 2.0))) 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 <= -8.2e+64) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 600000000.0) {
tmp = ((F / sin(B)) / sqrt(fma(F, F, 2.0))) - 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 <= -8.2e+64) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 600000000.0) tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(F, F, 2.0))) - 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, -8.2e+64], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 600000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(F * F + 2.0), $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.2 \cdot 10^{+64}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 600000000:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8.19999999999999956e64Initial program 46.8%
Simplified74.3%
Taylor expanded in F around -inf 99.8%
if -8.19999999999999956e64 < F < 6e8Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
metadata-eval99.5%
+-commutative99.5%
fma-define99.5%
fma-define99.5%
metadata-eval99.5%
Applied egg-rr99.5%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
if 6e8 < F Initial program 64.0%
Simplified71.0%
Taylor expanded in F around inf 99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 5000000.0)
(+
(/ -1.0 (/ (tan B) x))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 5000000.0) {
tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} 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 <= (-2000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 5000000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
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 <= -2000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 5000000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} 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 <= -2000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 5000000.0: tmp = (-1.0 / (math.tan(B) / x)) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) 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 <= -2000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 5000000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + 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)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 5000000.0) tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); 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, -2000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5000000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $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] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 5000000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2e12Initial program 54.0%
Simplified77.8%
Taylor expanded in F around -inf 99.7%
if -2e12 < F < 5e6Initial program 99.4%
div-inv99.6%
neg-mul-199.6%
clear-num99.5%
un-div-inv99.5%
Applied egg-rr99.5%
if 5e6 < F Initial program 64.0%
Simplified71.0%
Taylor expanded in F around inf 99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (* F (/ 1.0 (* (sin B) (sqrt (+ 2.0 (* x 2.0)))))) 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.45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F * (1.0 / (sin(B) * sqrt((2.0 + (x * 2.0)))))) - 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.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.45d0) then
tmp = (f * (1.0d0 / (sin(b) * sqrt((2.0d0 + (x * 2.0d0)))))) - 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.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.45) {
tmp = (F * (1.0 / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0)))))) - 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.45: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.45: tmp = (F * (1.0 / (math.sin(B) * math.sqrt((2.0 + (x * 2.0)))))) - 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.45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.45) tmp = Float64(Float64(F * Float64(1.0 / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0)))))) - 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.45) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) tmp = (F * (1.0 / (sin(B) * sqrt((2.0 + (x * 2.0)))))) - 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.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(F * N[(1.0 / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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.45:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;F \cdot \frac{1}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 57.2%
Simplified79.3%
Taylor expanded in F around -inf 99.6%
if -1.44999999999999996 < F < 1.44999999999999996Initial program 99.4%
Simplified99.6%
clear-num99.5%
inv-pow99.5%
fma-define99.5%
fma-undefine99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
Applied egg-rr99.5%
unpow-199.5%
fma-undefine99.5%
*-commutative99.5%
fma-undefine99.5%
unpow299.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 98.5%
*-commutative98.5%
Simplified98.5%
if 1.44999999999999996 < F Initial program 64.9%
Simplified71.7%
Taylor expanded in F around inf 98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.42)
(- (/ (/ F (sin B)) (sqrt 2.0)) 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.45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.42) {
tmp = ((F / sin(B)) / sqrt(2.0)) - 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.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.42d0) then
tmp = ((f / sin(b)) / sqrt(2.0d0)) - 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.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.42) {
tmp = ((F / Math.sin(B)) / Math.sqrt(2.0)) - 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.45: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.42: tmp = ((F / math.sin(B)) / math.sqrt(2.0)) - 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.45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.42) tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(2.0)) - 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.45) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.42) tmp = ((F / sin(B)) / sqrt(2.0)) - 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.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[2.0], $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.45:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 57.2%
Simplified79.3%
Taylor expanded in F around -inf 99.6%
if -1.44999999999999996 < F < 1.4199999999999999Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.5%
if 1.4199999999999999 < F Initial program 64.9%
Simplified71.7%
Taylor expanded in F around inf 98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(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.45) {
tmp = (-1.0 / sin(B)) - t_0;
} 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.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
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.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} 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.45: tmp = (-1.0 / math.sin(B)) - t_0 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.45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); 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.45) tmp = (-1.0 / sin(B)) - t_0; 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.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $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.45:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\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.44999999999999996Initial program 57.2%
Simplified79.3%
Taylor expanded in F around -inf 99.6%
if -1.44999999999999996 < F < 1.4199999999999999Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/r*99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 98.5%
associate-/l*98.5%
Simplified98.5%
if 1.4199999999999999 < F Initial program 64.9%
Simplified71.7%
Taylor expanded in F around inf 98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(t_1 (- (* (/ F (sin B)) t_0) (/ x B)))
(t_2 (/ x (tan B))))
(if (<= F -9000000000.0)
(- (/ -1.0 (sin B)) t_2)
(if (<= F -7.2e-112)
t_1
(if (<= F 4.9e-138)
(+ (* x (/ -1.0 (tan B))) (* t_0 (/ F B)))
(if (<= F 3200000.0) t_1 (- (/ 1.0 (sin B)) t_2)))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = ((F / sin(B)) * t_0) - (x / B);
double t_2 = x / tan(B);
double tmp;
if (F <= -9000000000.0) {
tmp = (-1.0 / sin(B)) - t_2;
} else if (F <= -7.2e-112) {
tmp = t_1;
} else if (F <= 4.9e-138) {
tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B));
} else if (F <= 3200000.0) {
tmp = t_1;
} else {
tmp = (1.0 / sin(B)) - t_2;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = ((f / sin(b)) * t_0) - (x / b)
t_2 = x / tan(b)
if (f <= (-9000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_2
else if (f <= (-7.2d-112)) then
tmp = t_1
else if (f <= 4.9d-138) then
tmp = (x * ((-1.0d0) / tan(b))) + (t_0 * (f / b))
else if (f <= 3200000.0d0) then
tmp = t_1
else
tmp = (1.0d0 / sin(b)) - t_2
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = ((F / Math.sin(B)) * t_0) - (x / B);
double t_2 = x / Math.tan(B);
double tmp;
if (F <= -9000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_2;
} else if (F <= -7.2e-112) {
tmp = t_1;
} else if (F <= 4.9e-138) {
tmp = (x * (-1.0 / Math.tan(B))) + (t_0 * (F / B));
} else if (F <= 3200000.0) {
tmp = t_1;
} else {
tmp = (1.0 / Math.sin(B)) - t_2;
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) t_1 = ((F / math.sin(B)) * t_0) - (x / B) t_2 = x / math.tan(B) tmp = 0 if F <= -9000000000.0: tmp = (-1.0 / math.sin(B)) - t_2 elif F <= -7.2e-112: tmp = t_1 elif F <= 4.9e-138: tmp = (x * (-1.0 / math.tan(B))) + (t_0 * (F / B)) elif F <= 3200000.0: tmp = t_1 else: tmp = (1.0 / math.sin(B)) - t_2 return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)) t_2 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_2); elseif (F <= -7.2e-112) tmp = t_1; elseif (F <= 4.9e-138) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_0 * Float64(F / B))); elseif (F <= 3200000.0) tmp = t_1; else tmp = Float64(Float64(1.0 / sin(B)) - t_2); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; t_1 = ((F / sin(B)) * t_0) - (x / B); t_2 = x / tan(B); tmp = 0.0; if (F <= -9000000000.0) tmp = (-1.0 / sin(B)) - t_2; elseif (F <= -7.2e-112) tmp = t_1; elseif (F <= 4.9e-138) tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B)); elseif (F <= 3200000.0) tmp = t_1; else tmp = (1.0 / sin(B)) - t_2; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, -7.2e-112], t$95$1, If[LessEqual[F, 4.9e-138], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3200000.0], t$95$1, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_2\\
\mathbf{elif}\;F \leq -7.2 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{-138}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0 \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 3200000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_2\\
\end{array}
\end{array}
if F < -9e9Initial program 55.9%
Simplified78.7%
Taylor expanded in F around -inf 99.7%
if -9e9 < F < -7.2000000000000002e-112 or 4.90000000000000016e-138 < F < 3.2e6Initial program 99.4%
Taylor expanded in B around 0 86.7%
associate-*r/86.7%
neg-mul-186.7%
Simplified86.7%
if -7.2000000000000002e-112 < F < 4.90000000000000016e-138Initial program 99.4%
Taylor expanded in B around 0 89.6%
if 3.2e6 < F Initial program 64.0%
Simplified71.0%
Taylor expanded in F around inf 99.9%
Final simplification94.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)))
(t_1 (/ x (tan B))))
(if (<= F -9000000000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1e-147)
t_0
(if (<= F 1.6e-216)
(- (* x (/ (cos B) (sin B))))
(if (<= F 3200000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
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 t_1 = x / tan(B);
double tmp;
if (F <= -9000000000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1e-147) {
tmp = t_0;
} else if (F <= 1.6e-216) {
tmp = -(x * (cos(B) / sin(B)));
} else if (F <= 3200000.0) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-9000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1d-147)) then
tmp = t_0
else if (f <= 1.6d-216) then
tmp = -(x * (cos(b) / sin(b)))
else if (f <= 3200000.0d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -9000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1e-147) {
tmp = t_0;
} else if (F <= 1.6e-216) {
tmp = -(x * (Math.cos(B) / Math.sin(B)));
} else if (F <= 3200000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -9000000000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1e-147: tmp = t_0 elif F <= 1.6e-216: tmp = -(x * (math.cos(B) / math.sin(B))) elif F <= 3200000.0: 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 / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1e-147) tmp = t_0; elseif (F <= 1.6e-216) tmp = Float64(-Float64(x * Float64(cos(B) / sin(B)))); elseif (F <= 3200000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -9000000000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1e-147) tmp = t_0; elseif (F <= 1.6e-216) tmp = -(x * (cos(B) / sin(B))); elseif (F <= 3200000.0) 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[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]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1e-147], t$95$0, If[LessEqual[F, 1.6e-216], (-N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 3200000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-147}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-216}:\\
\;\;\;\;-x \cdot \frac{\cos B}{\sin B}\\
\mathbf{elif}\;F \leq 3200000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -9e9Initial program 55.9%
Simplified78.7%
Taylor expanded in F around -inf 99.7%
if -9e9 < F < -9.9999999999999997e-148 or 1.60000000000000013e-216 < F < 3.2e6Initial program 99.4%
Taylor expanded in B around 0 83.2%
associate-*r/83.2%
neg-mul-183.2%
Simplified83.2%
if -9.9999999999999997e-148 < F < 1.60000000000000013e-216Initial program 99.5%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.7%
metadata-eval99.7%
metadata-eval99.7%
unpow-prod-down99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
Applied egg-rr99.7%
pow-sqr99.7%
metadata-eval99.7%
unpow-199.7%
fma-undefine99.7%
*-commutative99.7%
fma-undefine99.7%
unpow299.7%
+-commutative99.7%
fma-define99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 84.6%
mul-1-neg84.6%
associate-/l*84.6%
distribute-lft-neg-in84.6%
Simplified84.6%
if 3.2e6 < F Initial program 64.0%
Simplified71.0%
Taylor expanded in F around inf 99.9%
Final simplification92.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.85e-10)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -7.5e-116)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 1.65e-137)
(- (* x (/ (cos B) (sin B))))
(if (<= F 85.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* 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 <= -1.85e-10) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -7.5e-116) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 1.65e-137) {
tmp = -(x * (cos(B) / sin(B)));
} else if (F <= 85.0) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (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 <= (-1.85d-10)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-7.5d-116)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 1.65d-137) then
tmp = -(x * (cos(b) / sin(b)))
else if (f <= 85.0d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (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 <= -1.85e-10) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -7.5e-116) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 1.65e-137) {
tmp = -(x * (Math.cos(B) / Math.sin(B)));
} else if (F <= 85.0) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (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 <= -1.85e-10: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -7.5e-116: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 1.65e-137: tmp = -(x * (math.cos(B) / math.sin(B))) elif F <= 85.0: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (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 <= -1.85e-10) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -7.5e-116) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 1.65e-137) tmp = Float64(-Float64(x * Float64(cos(B) / sin(B)))); elseif (F <= 85.0) 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(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.85e-10) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -7.5e-116) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 1.65e-137) tmp = -(x * (cos(B) / sin(B))); elseif (F <= 85.0) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (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, -1.85e-10], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -7.5e-116], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.65e-137], (-N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 85.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], 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.85 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-116}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-137}:\\
\;\;\;\;-x \cdot \frac{\cos B}{\sin B}\\
\mathbf{elif}\;F \leq 85:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.85000000000000007e-10Initial program 58.8%
Simplified80.1%
Taylor expanded in F around -inf 96.9%
if -1.85000000000000007e-10 < F < -7.5000000000000004e-116Initial program 99.5%
Simplified99.6%
Taylor expanded in B around 0 60.4%
Taylor expanded in F around 0 60.4%
*-commutative60.4%
Simplified60.4%
if -7.5000000000000004e-116 < F < 1.6500000000000001e-137Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.7%
metadata-eval99.7%
metadata-eval99.7%
unpow-prod-down99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
Applied egg-rr99.7%
pow-sqr99.7%
metadata-eval99.7%
unpow-199.7%
fma-undefine99.7%
*-commutative99.7%
fma-undefine99.7%
unpow299.7%
+-commutative99.7%
fma-define99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 77.2%
mul-1-neg77.2%
associate-/l*77.2%
distribute-lft-neg-in77.2%
Simplified77.2%
if 1.6500000000000001e-137 < F < 85Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 57.0%
pow257.0%
Applied egg-rr57.0%
if 85 < F Initial program 64.5%
Simplified71.4%
Taylor expanded in F around inf 99.7%
Final simplification86.3%
(FPCore (F B x)
:precision binary64
(if (<= F -8e-9)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.55e-115)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 4.9e-139)
(- (* x (/ (cos B) (sin B))))
(if (<= F 960.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e-9) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.55e-115) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 4.9e-139) {
tmp = -(x * (cos(B) / sin(B)));
} else if (F <= 960.0) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (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 <= (-8d-9)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.55d-115)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 4.9d-139) then
tmp = -(x * (cos(b) / sin(b)))
else if (f <= 960.0d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8e-9) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.55e-115) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 4.9e-139) {
tmp = -(x * (Math.cos(B) / Math.sin(B)));
} else if (F <= 960.0) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8e-9: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.55e-115: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 4.9e-139: tmp = -(x * (math.cos(B) / math.sin(B))) elif F <= 960.0: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8e-9) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.55e-115) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 4.9e-139) tmp = Float64(-Float64(x * Float64(cos(B) / sin(B)))); elseif (F <= 960.0) 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(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8e-9) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.55e-115) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 4.9e-139) tmp = -(x * (cos(B) / sin(B))); elseif (F <= 960.0) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (F * (1.0 / (F * sin(B)))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.55e-115], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.9e-139], (-N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 960.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], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.55 \cdot 10^{-115}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{-139}:\\
\;\;\;\;-x \cdot \frac{\cos B}{\sin B}\\
\mathbf{elif}\;F \leq 960:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -8.0000000000000005e-9Initial program 58.8%
Simplified80.1%
Taylor expanded in F around -inf 96.9%
if -8.0000000000000005e-9 < F < -1.55000000000000003e-115Initial program 99.5%
Simplified99.6%
Taylor expanded in B around 0 60.4%
Taylor expanded in F around 0 60.4%
*-commutative60.4%
Simplified60.4%
if -1.55000000000000003e-115 < F < 4.90000000000000031e-139Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.7%
metadata-eval99.7%
metadata-eval99.7%
unpow-prod-down99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
Applied egg-rr99.7%
pow-sqr99.7%
metadata-eval99.7%
unpow-199.7%
fma-undefine99.7%
*-commutative99.7%
fma-undefine99.7%
unpow299.7%
+-commutative99.7%
fma-define99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 77.2%
mul-1-neg77.2%
associate-/l*77.2%
distribute-lft-neg-in77.2%
Simplified77.2%
if 4.90000000000000031e-139 < F < 960Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 57.0%
pow257.0%
Applied egg-rr57.0%
if 960 < F Initial program 64.5%
Simplified71.4%
Taylor expanded in F around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 78.9%
Final simplification79.9%
(FPCore (F B x)
:precision binary64
(if (<= F -6.5e-9)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F -7.5e-112)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 3.4e-138)
(- (* x (/ (cos B) (sin B))))
(if (<= F 1100.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e-9) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= -7.5e-112) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 3.4e-138) {
tmp = -(x * (cos(B) / sin(B)));
} else if (F <= 1100.0) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (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.5d-9)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= (-7.5d-112)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 3.4d-138) then
tmp = -(x * (cos(b) / sin(b)))
else if (f <= 1100.0d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e-9) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= -7.5e-112) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 3.4e-138) {
tmp = -(x * (Math.cos(B) / Math.sin(B)));
} else if (F <= 1100.0) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.5e-9: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= -7.5e-112: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 3.4e-138: tmp = -(x * (math.cos(B) / math.sin(B))) elif F <= 1100.0: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.5e-9) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= -7.5e-112) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 3.4e-138) tmp = Float64(-Float64(x * Float64(cos(B) / sin(B)))); elseif (F <= 1100.0) 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(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.5e-9) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= -7.5e-112) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 3.4e-138) tmp = -(x * (cos(B) / sin(B))); elseif (F <= 1100.0) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (F * (1.0 / (F * sin(B)))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.5e-9], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.5e-112], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-138], (-N[(x * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1100.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], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-112}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-138}:\\
\;\;\;\;-x \cdot \frac{\cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1100:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.5000000000000003e-9Initial program 58.8%
Simplified80.1%
Taylor expanded in F around -inf 96.9%
Taylor expanded in B around 0 78.8%
if -6.5000000000000003e-9 < F < -7.5000000000000002e-112Initial program 99.5%
Simplified99.6%
Taylor expanded in B around 0 60.4%
Taylor expanded in F around 0 60.4%
*-commutative60.4%
Simplified60.4%
if -7.5000000000000002e-112 < F < 3.4000000000000001e-138Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.7%
metadata-eval99.7%
metadata-eval99.7%
unpow-prod-down99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
Applied egg-rr99.7%
pow-sqr99.7%
metadata-eval99.7%
unpow-199.7%
fma-undefine99.7%
*-commutative99.7%
fma-undefine99.7%
unpow299.7%
+-commutative99.7%
fma-define99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 77.2%
mul-1-neg77.2%
associate-/l*77.2%
distribute-lft-neg-in77.2%
Simplified77.2%
if 3.4000000000000001e-138 < F < 1100Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 57.0%
pow257.0%
Applied egg-rr57.0%
if 1100 < F Initial program 64.5%
Simplified71.4%
Taylor expanded in F around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 78.9%
Final simplification74.7%
(FPCore (F B x)
:precision binary64
(if (<= F -8e-9)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F -4.8e-112)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 5.8e-139)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 1500.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e-9) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= -4.8e-112) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 5.8e-139) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 1500.0) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (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 <= (-8d-9)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= (-4.8d-112)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 5.8d-139) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 1500.0d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8e-9) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= -4.8e-112) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 5.8e-139) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 1500.0) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8e-9: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= -4.8e-112: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 5.8e-139: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 1500.0: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8e-9) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= -4.8e-112) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 5.8e-139) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 1500.0) 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(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8e-9) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= -4.8e-112) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 5.8e-139) tmp = (x * cos(B)) / -sin(B); elseif (F <= 1500.0) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (F * (1.0 / (F * sin(B)))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8e-9], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.8e-112], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.8e-139], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1500.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], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -4.8 \cdot 10^{-112}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-139}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1500:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -8.0000000000000005e-9Initial program 58.8%
Simplified80.1%
Taylor expanded in F around -inf 96.9%
Taylor expanded in B around 0 78.8%
if -8.0000000000000005e-9 < F < -4.8000000000000001e-112Initial program 99.5%
Simplified99.6%
Taylor expanded in B around 0 60.4%
Taylor expanded in F around 0 60.4%
*-commutative60.4%
Simplified60.4%
if -4.8000000000000001e-112 < F < 5.7999999999999998e-139Initial program 99.4%
Simplified99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
+-commutative99.6%
add-sqr-sqrt99.7%
metadata-eval99.7%
metadata-eval99.7%
unpow-prod-down99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
metadata-eval99.7%
+-commutative99.7%
fma-define99.7%
fma-define99.7%
metadata-eval99.7%
Applied egg-rr99.7%
pow-sqr99.7%
metadata-eval99.7%
unpow-199.7%
fma-undefine99.7%
*-commutative99.7%
fma-undefine99.7%
unpow299.7%
+-commutative99.7%
fma-define99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Applied egg-rr99.7%
sub-neg99.7%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 77.2%
mul-1-neg77.2%
Simplified77.2%
if 5.7999999999999998e-139 < F < 1500Initial program 99.4%
Simplified99.5%
Taylor expanded in B around 0 57.0%
pow257.0%
Applied egg-rr57.0%
if 1500 < F Initial program 64.5%
Simplified71.4%
Taylor expanded in F around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 78.9%
Final simplification74.7%
(FPCore (F B x)
:precision binary64
(if (<= F -6.3e-9)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 430.0)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.3e-9) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 430.0) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (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.3d-9)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 430.0d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.3e-9) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 430.0) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.3e-9: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 430.0: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.3e-9) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 430.0) 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(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.3e-9) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 430.0) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (F * (1.0 / (F * sin(B)))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.3e-9], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 430.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], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.3 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 430:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.3000000000000002e-9Initial program 58.8%
Simplified80.1%
Taylor expanded in F around -inf 96.9%
Taylor expanded in B around 0 78.8%
if -6.3000000000000002e-9 < F < 430Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 54.5%
pow254.5%
Applied egg-rr54.5%
if 430 < F Initial program 64.5%
Simplified71.4%
Taylor expanded in F around inf 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 78.9%
Final simplification69.0%
(FPCore (F B x)
:precision binary64
(if (<= F -7.5e-9)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 0.056)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(- (* F (/ 1.0 (* F (sin B)))) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-9) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 0.056) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (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-9)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 0.056d0) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e-9) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 0.056) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.5e-9: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 0.056: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) else: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.5e-9) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 0.056) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.5e-9) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 0.056) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); else tmp = (F * (1.0 / (F * sin(B)))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.5e-9], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.056], 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[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.056:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -7.49999999999999933e-9Initial program 58.8%
Simplified80.1%
Taylor expanded in F around -inf 96.9%
Taylor expanded in B around 0 78.8%
if -7.49999999999999933e-9 < F < 0.0560000000000000012Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 54.0%
Taylor expanded in F around 0 54.0%
mul-1-neg54.0%
+-commutative54.0%
unsub-neg54.0%
*-commutative54.0%
*-commutative54.0%
Simplified54.0%
if 0.0560000000000000012 < F Initial program 64.9%
Simplified71.7%
Taylor expanded in F around inf 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in B around 0 78.4%
Final simplification68.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2.85e-9)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 0.19)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(- (* F (/ 1.0 (* F (sin B)))) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.85e-9) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 0.19) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (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.85d-9)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 0.19d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.85e-9) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 0.19) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.85e-9: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 0.19: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B else: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.85e-9) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 0.19) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.85e-9) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 0.19) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (F * (1.0 / (F * sin(B)))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.85e-9], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.19], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.85 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.19:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -2.8499999999999999e-9Initial program 58.8%
Simplified80.1%
Taylor expanded in F around -inf 96.9%
Taylor expanded in B around 0 78.8%
if -2.8499999999999999e-9 < F < 0.19Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 54.0%
Taylor expanded in F around 0 54.0%
*-commutative54.0%
Simplified54.0%
if 0.19 < F Initial program 64.9%
Simplified71.7%
Taylor expanded in F around inf 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in B around 0 78.4%
Final simplification68.7%
(FPCore (F B x) :precision binary64 (if (<= F 6e-43) (- (/ -1.0 B) (/ x (tan B))) (- (* F (/ 1.0 (* F (sin B)))) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= 6e-43) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (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 <= 6d-43) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = (f * (1.0d0 / (f * sin(b)))) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 6e-43) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (F * (1.0 / (F * Math.sin(B)))) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 6e-43: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (F * (1.0 / (F * math.sin(B)))) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 6e-43) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 6e-43) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (F * (1.0 / (F * sin(B)))) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 6e-43], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6 \cdot 10^{-43}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < 6.00000000000000007e-43Initial program 82.0%
Simplified91.2%
Taylor expanded in F around -inf 57.6%
Taylor expanded in B around 0 54.8%
if 6.00000000000000007e-43 < F Initial program 67.0%
Simplified73.4%
Taylor expanded in F around inf 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in B around 0 76.5%
Final simplification61.9%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ x (tan B)))) (if (<= F 4.1e-44) (- (/ -1.0 B) t_0) (- (* F (/ 1.0 (* F B))) t_0))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= 4.1e-44) {
tmp = (-1.0 / B) - t_0;
} else {
tmp = (F * (1.0 / (F * 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 <= 4.1d-44) then
tmp = ((-1.0d0) / b) - t_0
else
tmp = (f * (1.0d0 / (f * 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 <= 4.1e-44) {
tmp = (-1.0 / B) - t_0;
} else {
tmp = (F * (1.0 / (F * B))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= 4.1e-44: tmp = (-1.0 / B) - t_0 else: tmp = (F * (1.0 / (F * B))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= 4.1e-44) tmp = Float64(Float64(-1.0 / B) - t_0); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= 4.1e-44) tmp = (-1.0 / B) - t_0; else tmp = (F * (1.0 / (F * 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, 4.1e-44], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq 4.1 \cdot 10^{-44}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_0\\
\end{array}
\end{array}
if F < 4.09999999999999992e-44Initial program 82.0%
Simplified91.2%
Taylor expanded in F around -inf 57.6%
Taylor expanded in B around 0 54.8%
if 4.09999999999999992e-44 < F Initial program 67.0%
Simplified73.4%
Taylor expanded in F around inf 95.5%
*-commutative95.5%
Simplified95.5%
Taylor expanded in B around 0 69.0%
Final simplification59.4%
(FPCore (F B x) :precision binary64 (if (<= F 2.5e-59) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.5e-59) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 2.5d-59) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.5e-59) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.5e-59: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.5e-59) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2.5e-59) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.5e-59], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.5 \cdot 10^{-59}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.5000000000000001e-59Initial program 81.5%
Simplified91.0%
Taylor expanded in F around -inf 58.4%
Taylor expanded in B around 0 55.4%
if 2.5000000000000001e-59 < F Initial program 68.5%
Simplified74.6%
Taylor expanded in B around 0 39.1%
Taylor expanded in F around inf 49.6%
(FPCore (F B x) :precision binary64 (if (<= F -2.2e-111) (/ (- -1.0 x) B) (if (<= F 7.8e-62) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.2e-111) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.8e-62) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.2d-111)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 7.8d-62) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.2e-111) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.8e-62) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.2e-111: tmp = (-1.0 - x) / B elif F <= 7.8e-62: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.2e-111) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7.8e-62) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.2e-111) tmp = (-1.0 - x) / B; elseif (F <= 7.8e-62) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.2e-111], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.8e-62], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7.8 \cdot 10^{-62}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.2e-111Initial program 66.8%
Simplified83.9%
Taylor expanded in B around 0 47.8%
Taylor expanded in F around -inf 47.2%
if -2.2e-111 < F < 7.8000000000000007e-62Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 50.8%
Taylor expanded in F around -inf 18.1%
Taylor expanded in x around inf 34.6%
neg-mul-134.6%
Simplified34.6%
if 7.8000000000000007e-62 < F Initial program 68.5%
Simplified74.6%
Taylor expanded in B around 0 39.1%
Taylor expanded in F around inf 49.6%
Final simplification44.3%
(FPCore (F B x) :precision binary64 (if (or (<= x -5.1e-124) (not (<= x 4.5e-138))) (/ x (- B)) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -5.1e-124) || !(x <= 4.5e-138)) {
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.1d-124)) .or. (.not. (x <= 4.5d-138))) 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.1e-124) || !(x <= 4.5e-138)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -5.1e-124) or not (x <= 4.5e-138): tmp = x / -B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -5.1e-124) || !(x <= 4.5e-138)) 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.1e-124) || ~((x <= 4.5e-138))) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -5.1e-124], N[Not[LessEqual[x, 4.5e-138]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.1 \cdot 10^{-124} \lor \neg \left(x \leq 4.5 \cdot 10^{-138}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if x < -5.1000000000000001e-124 or 4.50000000000000008e-138 < x Initial program 78.4%
Simplified89.7%
Taylor expanded in B around 0 47.5%
Taylor expanded in F around -inf 41.7%
Taylor expanded in x around inf 41.9%
neg-mul-141.9%
Simplified41.9%
if -5.1000000000000001e-124 < x < 4.50000000000000008e-138Initial program 74.8%
Simplified78.1%
Taylor expanded in B around 0 42.7%
Taylor expanded in F around inf 19.4%
*-commutative19.4%
Simplified19.4%
Taylor expanded in x around 0 19.4%
Taylor expanded in F around inf 19.7%
Final simplification33.7%
(FPCore (F B x) :precision binary64 (if (<= F -2.2e-111) (/ (- -1.0 x) B) (if (<= F 6e+230) (/ x (- B)) (/ 1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.2e-111) {
tmp = (-1.0 - x) / B;
} else if (F <= 6e+230) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.2d-111)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 6d+230) then
tmp = x / -b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.2e-111) {
tmp = (-1.0 - x) / B;
} else if (F <= 6e+230) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.2e-111: tmp = (-1.0 - x) / B elif F <= 6e+230: tmp = x / -B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.2e-111) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 6e+230) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.2e-111) tmp = (-1.0 - x) / B; elseif (F <= 6e+230) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.2e-111], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6e+230], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+230}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < -2.2e-111Initial program 66.8%
Simplified83.9%
Taylor expanded in B around 0 47.8%
Taylor expanded in F around -inf 47.2%
if -2.2e-111 < F < 6.00000000000000017e230Initial program 89.3%
Simplified92.9%
Taylor expanded in B around 0 48.9%
Taylor expanded in F around -inf 22.4%
Taylor expanded in x around inf 31.3%
neg-mul-131.3%
Simplified31.3%
if 6.00000000000000017e230 < F Initial program 35.8%
Simplified37.7%
Taylor expanded in B around 0 12.9%
Taylor expanded in F around inf 56.0%
*-commutative56.0%
Simplified56.0%
Taylor expanded in x around 0 45.9%
Taylor expanded in F around inf 45.9%
Final simplification38.2%
(FPCore (F B x) :precision binary64 (if (<= F 6.5e-167) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 6.5e-167) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 6.5d-167) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 6.5e-167) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 6.5e-167: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 6.5e-167) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 6.5e-167) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 6.5e-167], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 6.5 \cdot 10^{-167}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 6.49999999999999973e-167Initial program 78.9%
Simplified89.7%
Taylor expanded in B around 0 49.4%
Taylor expanded in F around -inf 36.7%
Taylor expanded in x around 0 15.5%
if 6.49999999999999973e-167 < F Initial program 74.6%
Simplified79.6%
Taylor expanded in B around 0 40.8%
Taylor expanded in F around inf 41.1%
*-commutative41.1%
Simplified41.1%
Taylor expanded in x around 0 25.1%
Taylor expanded in F around inf 23.3%
(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 77.1%
Simplified85.4%
Taylor expanded in B around 0 45.7%
Taylor expanded in F around -inf 30.5%
Taylor expanded in x around 0 10.1%
herbie shell --seed 2024180
(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))))))