
(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 (<= x -1.0)
(- (/ -1.0 B) t_0)
(- (/ F (* (sin B) (hypot (sqrt (fma 2.0 x 2.0)) F))) t_0))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (x <= -1.0) {
tmp = (-1.0 / B) - t_0;
} else {
tmp = (F / (sin(B) * hypot(sqrt(fma(2.0, x, 2.0)), F))) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(-1.0 / B) - t_0); else tmp = Float64(Float64(F / Float64(sin(B) * hypot(sqrt(fma(2.0, x, 2.0)), F))) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision] ^ 2 + F ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \mathsf{hypot}\left(\sqrt{\mathsf{fma}\left(2, x, 2\right)}, F\right)} - t\_0\\
\end{array}
\end{array}
if x < -1Initial program 63.0%
Simplified100.0%
Taylor expanded in F around -inf 100.0%
Taylor expanded in B around 0 100.0%
if -1 < x Initial program 73.8%
Simplified80.4%
clear-num80.4%
un-div-inv80.4%
fma-define80.4%
fma-undefine80.4%
*-commutative80.4%
fma-define80.4%
fma-define80.4%
Applied egg-rr80.4%
Taylor expanded in B around inf 80.4%
associate-+r+80.4%
rem-square-sqrt80.4%
+-commutative80.4%
fma-undefine80.4%
+-commutative80.4%
fma-undefine80.4%
unpow280.4%
hypot-undefine99.7%
Simplified99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9.2e-18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 22000000.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 <= -9.2e-18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 22000000.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 <= (-9.2d-18)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 22000000.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 <= -9.2e-18) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 22000000.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 <= -9.2e-18: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 22000000.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 <= -9.2e-18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 22000000.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 <= -9.2e-18) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 22000000.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, -9.2e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 22000000.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 -9.2 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 22000000:\\
\;\;\;\;\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 < -9.2000000000000004e-18Initial program 47.0%
Simplified65.1%
Taylor expanded in F around -inf 99.9%
if -9.2000000000000004e-18 < F < 2.2e7Initial program 99.4%
div-inv99.6%
neg-mul-199.6%
clear-num99.4%
un-div-inv99.4%
Applied egg-rr99.4%
if 2.2e7 < F Initial program 54.5%
Simplified68.8%
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 -9.2e-18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 90000000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan B))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -9.2e-18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 90000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-9.2d-18)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 90000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(b)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -9.2e-18) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 90000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(B)));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -9.2e-18: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 90000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9.2e-18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 90000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -9.2e-18) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 90000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(B))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9.2e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 90000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9.2 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 90000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -9.2000000000000004e-18Initial program 47.0%
Simplified65.1%
Taylor expanded in F around -inf 99.9%
if -9.2000000000000004e-18 < F < 9e7Initial program 99.4%
metadata-eval99.4%
metadata-eval99.4%
Applied egg-rr99.4%
if 9e7 < F Initial program 54.5%
Simplified68.8%
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.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.92)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ F (* (sin B) (* F (- 1.0 (/ -1.0 (pow F 2.0)))))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.92) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (F / (sin(B) * (F * (1.0 - (-1.0 / pow(F, 2.0)))))) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.92d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (f / (sin(b) * (f * (1.0d0 - ((-1.0d0) / (f ** 2.0d0)))))) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.92) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (F / (Math.sin(B) * (F * (1.0 - (-1.0 / Math.pow(F, 2.0)))))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.92: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (F / (math.sin(B) * (F * (1.0 - (-1.0 / math.pow(F, 2.0)))))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.92) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F * Float64(1.0 - Float64(-1.0 / (F ^ 2.0)))))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.92) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (F / (sin(B) * (F * (1.0 - (-1.0 / (F ^ 2.0)))))) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.92], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F * N[(1.0 - N[(-1.0 / N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.92:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F \cdot \left(1 - \frac{-1}{{F}^{2}}\right)\right)} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 45.3%
Simplified64.0%
Taylor expanded in F around -inf 99.9%
if -1.3999999999999999 < F < 0.92000000000000004Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 98.8%
associate-/l*98.8%
Simplified98.8%
if 0.92000000000000004 < F Initial program 55.6%
Simplified69.5%
clear-num69.5%
un-div-inv69.6%
fma-define69.6%
fma-undefine69.6%
*-commutative69.6%
fma-define69.6%
fma-define69.6%
Applied egg-rr69.6%
Taylor expanded in x around 0 69.2%
+-commutative69.2%
unpow269.2%
fma-undefine69.2%
Simplified69.2%
Taylor expanded in F around inf 99.3%
metadata-eval99.3%
distribute-neg-frac99.3%
unsub-neg99.3%
Simplified99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 45.3%
Simplified64.0%
Taylor expanded in F around -inf 99.9%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 98.8%
associate-/l*98.8%
Simplified98.8%
if 1.3999999999999999 < F Initial program 55.6%
Simplified69.5%
Taylor expanded in F around inf 99.1%
(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 -3.1e-16)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.2e-137)
t_0
(if (<= F 3.2e-149)
(- (* F (/ (sqrt 0.5) B)) t_1)
(if (<= F 2400000.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 <= -3.1e-16) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.2e-137) {
tmp = t_0;
} else if (F <= 3.2e-149) {
tmp = (F * (sqrt(0.5) / B)) - t_1;
} else if (F <= 2400000.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 <= (-3.1d-16)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-3.2d-137)) then
tmp = t_0
else if (f <= 3.2d-149) then
tmp = (f * (sqrt(0.5d0) / b)) - t_1
else if (f <= 2400000.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 <= -3.1e-16) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -3.2e-137) {
tmp = t_0;
} else if (F <= 3.2e-149) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_1;
} else if (F <= 2400000.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 <= -3.1e-16: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -3.2e-137: tmp = t_0 elif F <= 3.2e-149: tmp = (F * (math.sqrt(0.5) / B)) - t_1 elif F <= 2400000.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 <= -3.1e-16) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.2e-137) tmp = t_0; elseif (F <= 3.2e-149) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_1); elseif (F <= 2400000.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 <= -3.1e-16) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -3.2e-137) tmp = t_0; elseif (F <= 3.2e-149) tmp = (F * (sqrt(0.5) / B)) - t_1; elseif (F <= 2400000.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, -3.1e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.2e-137], t$95$0, If[LessEqual[F, 3.2e-149], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 2400000.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 -3.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -3.2 \cdot 10^{-137}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-149}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_1\\
\mathbf{elif}\;F \leq 2400000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -3.1000000000000001e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
if -3.1000000000000001e-16 < F < -3.20000000000000021e-137 or 3.20000000000000002e-149 < F < 2.4e6Initial program 99.2%
Taylor expanded in B around 0 85.2%
associate-*r/85.2%
neg-mul-185.2%
Simplified85.2%
if -3.20000000000000021e-137 < F < 3.20000000000000002e-149Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in B around 0 89.9%
associate-/l*89.9%
Simplified89.9%
if 2.4e6 < F Initial program 54.5%
Simplified68.8%
Taylor expanded in F around inf 99.9%
Final simplification94.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.1e-16)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -3.3e-137)
(- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 3.7e-25)
(- (* 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 <= -3.1e-16) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -3.3e-137) {
tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 3.7e-25) {
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 <= (-3.1d-16)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-3.3d-137)) then
tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 3.7d-25) 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 <= -3.1e-16) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -3.3e-137) {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 3.7e-25) {
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 <= -3.1e-16: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -3.3e-137: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 3.7e-25: 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 <= -3.1e-16) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -3.3e-137) tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 3.7e-25) 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 <= -3.1e-16) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -3.3e-137) tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 3.7e-25) 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, -3.1e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.3e-137], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.7e-25], 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 -3.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -3.3 \cdot 10^{-137}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.7 \cdot 10^{-25}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.1000000000000001e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
if -3.1000000000000001e-16 < F < -3.3000000000000002e-137Initial program 99.3%
Simplified99.6%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in B around 0 91.4%
if -3.3000000000000002e-137 < F < 3.70000000000000009e-25Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in B around 0 85.1%
associate-/l*85.0%
Simplified85.0%
if 3.70000000000000009e-25 < F Initial program 58.7%
Simplified71.6%
Taylor expanded in F around inf 95.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3e-16)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -4.8e-149)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 6.5e-30)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3e-16) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -4.8e-149) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 6.5e-30) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-3d-16)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-4.8d-149)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 6.5d-30) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -3e-16) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -4.8e-149) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 6.5e-30) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3e-16: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -4.8e-149: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 6.5e-30: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3e-16) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -4.8e-149) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 6.5e-30) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3e-16) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -4.8e-149) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 6.5e-30) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -4.8e-149], 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, 6.5e-30], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -4.8 \cdot 10^{-149}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.99999999999999994e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
if -2.99999999999999994e-16 < F < -4.8000000000000002e-149Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 69.7%
Taylor expanded in F around 0 69.7%
if -4.8000000000000002e-149 < F < 6.5000000000000005e-30Initial program 99.5%
Simplified99.6%
clear-num99.6%
un-div-inv99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 74.5%
mul-1-neg74.5%
Simplified74.5%
if 6.5000000000000005e-30 < F Initial program 58.7%
Simplified71.6%
Taylor expanded in F around inf 95.1%
Final simplification86.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ 2.0 (* x 2.0))))
(if (<= F -3.1e-16)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -6.2e-148)
(/ (- (* F (sqrt (/ 1.0 t_0))) x) B)
(if (<= F 8.2e+15)
(/ (* x (cos B)) (- (sin B)))
(- (+ (* -0.5 (/ t_0 (* B (pow F 2.0)))) (/ 1.0 B)) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -6.2e-148) {
tmp = ((F * sqrt((1.0 / t_0))) - x) / B;
} else if (F <= 8.2e+15) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = ((-0.5 * (t_0 / (B * pow(F, 2.0)))) + (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 + (x * 2.0d0)
if (f <= (-3.1d-16)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-6.2d-148)) then
tmp = ((f * sqrt((1.0d0 / t_0))) - x) / b
else if (f <= 8.2d+15) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (((-0.5d0) * (t_0 / (b * (f ** 2.0d0)))) + (1.0d0 / b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -6.2e-148) {
tmp = ((F * Math.sqrt((1.0 / t_0))) - x) / B;
} else if (F <= 8.2e+15) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = ((-0.5 * (t_0 / (B * Math.pow(F, 2.0)))) + (1.0 / B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = 2.0 + (x * 2.0) tmp = 0 if F <= -3.1e-16: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -6.2e-148: tmp = ((F * math.sqrt((1.0 / t_0))) - x) / B elif F <= 8.2e+15: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = ((-0.5 * (t_0 / (B * math.pow(F, 2.0)))) + (1.0 / B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(2.0 + Float64(x * 2.0)) tmp = 0.0 if (F <= -3.1e-16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -6.2e-148) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / t_0))) - x) / B); elseif (F <= 8.2e+15) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(Float64(-0.5 * Float64(t_0 / Float64(B * (F ^ 2.0)))) + Float64(1.0 / B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 2.0 + (x * 2.0); tmp = 0.0; if (F <= -3.1e-16) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -6.2e-148) tmp = ((F * sqrt((1.0 / t_0))) - x) / B; elseif (F <= 8.2e+15) tmp = (x * cos(B)) / -sin(B); else tmp = ((-0.5 * (t_0 / (B * (F ^ 2.0)))) + (1.0 / B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.1e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.2e-148], N[(N[(N[(F * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.2e+15], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(N[(-0.5 * N[(t$95$0 / N[(B * N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + x \cdot 2\\
\mathbf{if}\;F \leq -3.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -6.2 \cdot 10^{-148}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t\_0}} - x}{B}\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \frac{t\_0}{B \cdot {F}^{2}} + \frac{1}{B}\right) - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.1000000000000001e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
if -3.1000000000000001e-16 < F < -6.2000000000000003e-148Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 69.7%
Taylor expanded in F around 0 69.7%
if -6.2000000000000003e-148 < F < 8.2e15Initial program 99.4%
Simplified99.6%
clear-num99.6%
un-div-inv99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.3%
+-commutative99.3%
unpow299.3%
fma-undefine99.3%
Simplified99.3%
Taylor expanded in F around 0 70.9%
mul-1-neg70.9%
Simplified70.9%
if 8.2e15 < F Initial program 53.3%
Simplified67.9%
Taylor expanded in B around 0 44.6%
Taylor expanded in F around inf 61.1%
Final simplification74.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ 2.0 (* x 2.0))))
(if (<= F -3.1e-16)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -5.6e-148)
(/ (- (* F (sqrt (/ 1.0 t_0))) x) B)
(if (<= F 7.5e+15)
(/ (* x (cos B)) (- (sin B)))
(- (+ (* -0.5 (/ t_0 (* B (pow F 2.0)))) (/ 1.0 B)) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -5.6e-148) {
tmp = ((F * sqrt((1.0 / t_0))) - x) / B;
} else if (F <= 7.5e+15) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = ((-0.5 * (t_0 / (B * pow(F, 2.0)))) + (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 + (x * 2.0d0)
if (f <= (-3.1d-16)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-5.6d-148)) then
tmp = ((f * sqrt((1.0d0 / t_0))) - x) / b
else if (f <= 7.5d+15) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (((-0.5d0) * (t_0 / (b * (f ** 2.0d0)))) + (1.0d0 / b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -5.6e-148) {
tmp = ((F * Math.sqrt((1.0 / t_0))) - x) / B;
} else if (F <= 7.5e+15) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = ((-0.5 * (t_0 / (B * Math.pow(F, 2.0)))) + (1.0 / B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = 2.0 + (x * 2.0) tmp = 0 if F <= -3.1e-16: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -5.6e-148: tmp = ((F * math.sqrt((1.0 / t_0))) - x) / B elif F <= 7.5e+15: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = ((-0.5 * (t_0 / (B * math.pow(F, 2.0)))) + (1.0 / B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(2.0 + Float64(x * 2.0)) tmp = 0.0 if (F <= -3.1e-16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -5.6e-148) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / t_0))) - x) / B); elseif (F <= 7.5e+15) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(Float64(-0.5 * Float64(t_0 / Float64(B * (F ^ 2.0)))) + Float64(1.0 / B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 2.0 + (x * 2.0); tmp = 0.0; if (F <= -3.1e-16) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -5.6e-148) tmp = ((F * sqrt((1.0 / t_0))) - x) / B; elseif (F <= 7.5e+15) tmp = (x * cos(B)) / -sin(B); else tmp = ((-0.5 * (t_0 / (B * (F ^ 2.0)))) + (1.0 / B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.1e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.6e-148], N[(N[(N[(F * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.5e+15], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(N[(-0.5 * N[(t$95$0 / N[(B * N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + x \cdot 2\\
\mathbf{if}\;F \leq -3.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -5.6 \cdot 10^{-148}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{t\_0}} - x}{B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{+15}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \frac{t\_0}{B \cdot {F}^{2}} + \frac{1}{B}\right) - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.1000000000000001e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
Taylor expanded in B around 0 80.9%
if -3.1000000000000001e-16 < F < -5.6e-148Initial program 99.3%
Simplified99.6%
Taylor expanded in B around 0 69.7%
Taylor expanded in F around 0 69.7%
if -5.6e-148 < F < 7.5e15Initial program 99.4%
Simplified99.6%
clear-num99.6%
un-div-inv99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.3%
+-commutative99.3%
unpow299.3%
fma-undefine99.3%
Simplified99.3%
Taylor expanded in F around 0 70.9%
mul-1-neg70.9%
Simplified70.9%
if 7.5e15 < F Initial program 53.3%
Simplified67.9%
Taylor expanded in B around 0 44.6%
Taylor expanded in F around inf 61.1%
Final simplification70.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.245)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.7e-25)
(- (* 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 <= -0.245) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.7e-25) {
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 <= (-0.245d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.7d-25) 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 <= -0.245) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.7e-25) {
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 <= -0.245: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.7e-25: 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 <= -0.245) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.7e-25) 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 <= -0.245) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.7e-25) 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, -0.245], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.7e-25], 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 -0.245:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.7 \cdot 10^{-25}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.245Initial program 45.3%
Simplified64.0%
Taylor expanded in F around -inf 99.9%
if -0.245 < F < 3.70000000000000009e-25Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around 0 99.6%
Taylor expanded in B around 0 82.1%
associate-/l*82.1%
Simplified82.1%
if 3.70000000000000009e-25 < F Initial program 58.7%
Simplified71.6%
Taylor expanded in F around inf 95.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ 2.0 (* x 2.0))))
(if (<= F -3.1e-16)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.4e-182)
(- (* (sqrt (/ 1.0 t_0)) (/ F B)) (/ x B))
(if (<= F 7.9e+15)
(- (/ -1.0 B) (/ x (tan B)))
(- (+ (* -0.5 (/ t_0 (* B (pow F 2.0)))) (/ 1.0 B)) (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.4e-182) {
tmp = (sqrt((1.0 / t_0)) * (F / B)) - (x / B);
} else if (F <= 7.9e+15) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = ((-0.5 * (t_0 / (B * pow(F, 2.0)))) + (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = 2.0d0 + (x * 2.0d0)
if (f <= (-3.1d-16)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.4d-182) then
tmp = (sqrt((1.0d0 / t_0)) * (f / b)) - (x / b)
else if (f <= 7.9d+15) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = (((-0.5d0) * (t_0 / (b * (f ** 2.0d0)))) + (1.0d0 / b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 2.0 + (x * 2.0);
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.4e-182) {
tmp = (Math.sqrt((1.0 / t_0)) * (F / B)) - (x / B);
} else if (F <= 7.9e+15) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = ((-0.5 * (t_0 / (B * Math.pow(F, 2.0)))) + (1.0 / B)) - (x / B);
}
return tmp;
}
def code(F, B, x): t_0 = 2.0 + (x * 2.0) tmp = 0 if F <= -3.1e-16: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.4e-182: tmp = (math.sqrt((1.0 / t_0)) * (F / B)) - (x / B) elif F <= 7.9e+15: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = ((-0.5 * (t_0 / (B * math.pow(F, 2.0)))) + (1.0 / B)) - (x / B) return tmp
function code(F, B, x) t_0 = Float64(2.0 + Float64(x * 2.0)) tmp = 0.0 if (F <= -3.1e-16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.4e-182) tmp = Float64(Float64(sqrt(Float64(1.0 / t_0)) * Float64(F / B)) - Float64(x / B)); elseif (F <= 7.9e+15) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(-0.5 * Float64(t_0 / Float64(B * (F ^ 2.0)))) + Float64(1.0 / B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 2.0 + (x * 2.0); tmp = 0.0; if (F <= -3.1e-16) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.4e-182) tmp = (sqrt((1.0 / t_0)) * (F / B)) - (x / B); elseif (F <= 7.9e+15) tmp = (-1.0 / B) - (x / tan(B)); else tmp = ((-0.5 * (t_0 / (B * (F ^ 2.0)))) + (1.0 / B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.1e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-182], N[(N[(N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.9e+15], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[(t$95$0 / N[(B * N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 2 + x \cdot 2\\
\mathbf{if}\;F \leq -3.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-182}:\\
\;\;\;\;\sqrt{\frac{1}{t\_0}} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.9 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \frac{t\_0}{B \cdot {F}^{2}} + \frac{1}{B}\right) - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.1000000000000001e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
Taylor expanded in B around 0 80.9%
if -3.1000000000000001e-16 < F < 1.39999999999999997e-182Initial program 99.5%
Simplified99.6%
Taylor expanded in B around 0 61.8%
Taylor expanded in F around 0 61.8%
if 1.39999999999999997e-182 < F < 7.9e15Initial program 99.2%
Simplified99.5%
Taylor expanded in F around -inf 30.1%
Taylor expanded in B around 0 45.6%
if 7.9e15 < F Initial program 53.3%
Simplified67.9%
Taylor expanded in B around 0 44.6%
Taylor expanded in F around inf 61.1%
Final simplification63.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3.1e-16)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.25e-182)
(- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)) (/ x B))
(if (<= F 8.2e+15) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.25e-182) {
tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
} else if (F <= 8.2e+15) {
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 <= (-3.1d-16)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.25d-182) then
tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)) - (x / b)
else if (f <= 8.2d+15) 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 <= -3.1e-16) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.25e-182) {
tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B);
} else if (F <= 8.2e+15) {
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 <= -3.1e-16: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.25e-182: tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B) elif F <= 8.2e+15: 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 <= -3.1e-16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.25e-182) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)) - Float64(x / B)); elseif (F <= 8.2e+15) 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 <= -3.1e-16) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.25e-182) tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - (x / B); elseif (F <= 8.2e+15) 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, -3.1e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.25e-182], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.2e+15], 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 -3.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{-182}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.1000000000000001e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
Taylor expanded in B around 0 80.9%
if -3.1000000000000001e-16 < F < 1.25000000000000006e-182Initial program 99.5%
Simplified99.6%
Taylor expanded in B around 0 61.8%
Taylor expanded in F around 0 61.8%
if 1.25000000000000006e-182 < F < 8.2e15Initial program 99.2%
Simplified99.5%
Taylor expanded in F around -inf 30.1%
Taylor expanded in B around 0 45.6%
if 8.2e15 < F Initial program 53.3%
Simplified67.9%
Taylor expanded in B around 0 44.6%
Taylor expanded in F around inf 61.1%
Final simplification63.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3.1e-16)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.05e-182)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= F 7.8e+15) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.1e-16) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.05e-182) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (F <= 7.8e+15) {
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 <= (-3.1d-16)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.05d-182) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (f <= 7.8d+15) 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 <= -3.1e-16) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.05e-182) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (F <= 7.8e+15) {
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 <= -3.1e-16: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.05e-182: tmp = ((F * math.sqrt(0.5)) - x) / B elif F <= 7.8e+15: 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 <= -3.1e-16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.05e-182) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (F <= 7.8e+15) 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 <= -3.1e-16) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.05e-182) tmp = ((F * sqrt(0.5)) - x) / B; elseif (F <= 7.8e+15) 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, -3.1e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-182], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.8e+15], 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 -3.1 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-182}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 7.8 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.1000000000000001e-16Initial program 46.2%
Simplified64.5%
Taylor expanded in F around -inf 99.9%
Taylor expanded in B around 0 80.9%
if -3.1000000000000001e-16 < F < 1.05e-182Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 99.6%
Taylor expanded in B around 0 61.8%
if 1.05e-182 < F < 7.8e15Initial program 99.2%
Simplified99.5%
Taylor expanded in F around -inf 30.1%
Taylor expanded in B around 0 45.6%
if 7.8e15 < F Initial program 53.3%
Simplified67.9%
Taylor expanded in B around 0 44.6%
Taylor expanded in F around inf 61.1%
(FPCore (F B x) :precision binary64 (if (<= F 1.15e+16) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.15e+16) {
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 <= 1.15d+16) 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 <= 1.15e+16) {
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 <= 1.15e+16: 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 <= 1.15e+16) 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 <= 1.15e+16) 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, 1.15e+16], 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 1.15 \cdot 10^{+16}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 1.15e16Initial program 81.4%
Simplified87.7%
Taylor expanded in F around -inf 54.8%
Taylor expanded in B around 0 55.4%
if 1.15e16 < F Initial program 53.3%
Simplified67.9%
Taylor expanded in B around 0 44.6%
Taylor expanded in F around inf 61.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-44) (/ (- -1.0 x) B) (if (<= F 9.5e-32) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-44) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-32) {
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 <= (-1.45d-44)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9.5d-32) 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 <= -1.45e-44) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-32) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-44: tmp = (-1.0 - x) / B elif F <= 9.5e-32: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-44) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9.5e-32) 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 <= -1.45e-44) tmp = (-1.0 - x) / B; elseif (F <= 9.5e-32) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-44], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e-32], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-44}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-32}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.4500000000000001e-44Initial program 53.7%
Simplified69.5%
Taylor expanded in B around 0 40.1%
Taylor expanded in F around -inf 55.2%
if -1.4500000000000001e-44 < F < 9.4999999999999999e-32Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 54.7%
Taylor expanded in F around 0 39.3%
associate-*r/39.3%
neg-mul-139.3%
Simplified39.3%
if 9.4999999999999999e-32 < F Initial program 58.7%
Simplified71.6%
Taylor expanded in B around 0 42.1%
Taylor expanded in F around inf 56.7%
Final simplification49.5%
(FPCore (F B x) :precision binary64 (if (<= F -4.4e-44) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.4e-44) {
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 <= (-4.4d-44)) 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 <= -4.4e-44) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.4e-44: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.4e-44) 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 <= -4.4e-44) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.4e-44], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -4.40000000000000024e-44Initial program 53.7%
Simplified69.5%
Taylor expanded in B around 0 40.1%
Taylor expanded in F around -inf 55.2%
if -4.40000000000000024e-44 < F Initial program 80.5%
Simplified86.6%
Taylor expanded in B around 0 48.8%
Taylor expanded in F around 0 34.5%
associate-*r/34.5%
neg-mul-134.5%
Simplified34.5%
Final simplification40.3%
(FPCore (F B x) :precision binary64 (/ x (- B)))
double code(double F, double B, double x) {
return x / -B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = x / -b
end function
public static double code(double F, double B, double x) {
return x / -B;
}
def code(F, B, x): return x / -B
function code(F, B, x) return Float64(x / Float64(-B)) end
function tmp = code(F, B, x) tmp = x / -B; end
code[F_, B_, x_] := N[(x / (-B)), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{-B}
\end{array}
Initial program 73.0%
Simplified81.9%
Taylor expanded in B around 0 46.4%
Taylor expanded in F around 0 31.9%
associate-*r/31.9%
neg-mul-131.9%
Simplified31.9%
Final simplification31.9%
(FPCore (F B x) :precision binary64 (/ x B))
double code(double F, double B, double x) {
return x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = x / b
end function
public static double code(double F, double B, double x) {
return x / B;
}
def code(F, B, x): return x / B
function code(F, B, x) return Float64(x / B) end
function tmp = code(F, B, x) tmp = x / B; end
code[F_, B_, x_] := N[(x / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{B}
\end{array}
Initial program 73.0%
Simplified81.9%
Taylor expanded in B around 0 46.4%
Taylor expanded in F around 0 31.9%
associate-*r/31.9%
neg-mul-131.9%
Simplified31.9%
div-inv31.8%
add-sqr-sqrt9.5%
sqrt-unprod8.8%
sqr-neg8.8%
sqrt-unprod1.4%
add-sqr-sqrt2.9%
Applied egg-rr2.9%
associate-*r/2.9%
*-rgt-identity2.9%
Simplified2.9%
herbie shell --seed 2024135
(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))))))