
(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 -5e+29)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 50000000.0)
(- (/ (/ F (sin B)) (sqrt (+ 2.0 (pow 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 <= -5e+29) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 50000000.0) {
tmp = ((F / sin(B)) / sqrt((2.0 + pow(F, 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 <= (-5d+29)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 50000000.0d0) then
tmp = ((f / sin(b)) / sqrt((2.0d0 + (f ** 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 <= -5e+29) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 50000000.0) {
tmp = ((F / Math.sin(B)) / Math.sqrt((2.0 + Math.pow(F, 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 <= -5e+29: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 50000000.0: tmp = ((F / math.sin(B)) / math.sqrt((2.0 + math.pow(F, 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 <= -5e+29) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 50000000.0) tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(Float64(2.0 + (F ^ 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 <= -5e+29) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 50000000.0) tmp = ((F / sin(B)) / sqrt((2.0 + (F ^ 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, -5e+29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 50000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 + N[Power[F, 2.0], $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 -5 \cdot 10^{+29}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 50000000:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2 + {F}^{2}}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5.0000000000000001e29Initial program 55.5%
Simplified69.9%
clear-num69.9%
fma-define69.9%
fma-undefine69.9%
*-commutative69.9%
fma-define69.9%
fma-define69.9%
Applied egg-rr69.9%
Taylor expanded in F around -inf 99.7%
if -5.0000000000000001e29 < F < 5e7Initial program 99.4%
Simplified99.6%
clear-num99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
div-inv99.6%
pow-flip99.6%
metadata-eval99.6%
pow1/299.6%
fma-undefine99.6%
unpow299.6%
Applied egg-rr99.6%
associate-*r/99.6%
*-rgt-identity99.6%
associate-/r*99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
if 5e7 < F Initial program 57.2%
Simplified71.1%
clear-num71.1%
fma-define71.1%
fma-undefine71.1%
*-commutative71.1%
fma-define71.1%
fma-define71.1%
Applied egg-rr71.1%
Taylor expanded in F around inf 99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.2e+40)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7200000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ 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 <= -2.2e+40) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7200000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - 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 <= (-2.2d+40)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7200000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - 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 <= -2.2e+40) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7200000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.2e+40: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7200000.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.2e+40) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7200000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.2e+40) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7200000.0) tmp = (x * (-1.0 / tan(B))) + ((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, -2.2e+40], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7200000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{+40}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7200000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.1999999999999999e40Initial program 54.1%
Simplified69.0%
clear-num69.0%
fma-define69.0%
fma-undefine69.0%
*-commutative69.0%
fma-define69.0%
fma-define69.0%
Applied egg-rr69.0%
Taylor expanded in F around -inf 99.6%
if -2.1999999999999999e40 < F < 7.2e6Initial program 99.4%
if 7.2e6 < F Initial program 57.2%
Simplified71.1%
clear-num71.1%
fma-define71.1%
fma-undefine71.1%
*-commutative71.1%
fma-define71.1%
fma-define71.1%
Applied egg-rr71.1%
Taylor expanded in F around inf 99.9%
Final simplification99.6%
(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 (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.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
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.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) 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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
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.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: 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.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) 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.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) 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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], 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.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 57.3%
Simplified71.2%
clear-num71.1%
fma-define71.1%
fma-undefine71.1%
*-commutative71.1%
fma-define71.1%
fma-define71.1%
Applied egg-rr71.1%
Taylor expanded in F around -inf 98.9%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.4%
Simplified99.6%
clear-num99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
div-inv99.6%
pow-flip99.6%
metadata-eval99.6%
pow1/299.6%
fma-undefine99.6%
unpow299.6%
Applied egg-rr99.6%
associate-*r/99.6%
*-rgt-identity99.6%
associate-/r*99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in F around 0 98.6%
if 1.3999999999999999 < F Initial program 57.9%
Simplified71.6%
clear-num71.6%
fma-define71.6%
fma-undefine71.6%
*-commutative71.6%
fma-define71.6%
fma-define71.6%
Applied egg-rr71.6%
Taylor expanded in F around inf 98.8%
(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(Float64(F * 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[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[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 -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 57.3%
Simplified71.2%
clear-num71.1%
fma-define71.1%
fma-undefine71.1%
*-commutative71.1%
fma-define71.1%
fma-define71.1%
Applied egg-rr71.1%
Taylor expanded in F around -inf 98.9%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 98.5%
associate-*l/98.5%
*-lft-identity98.5%
+-commutative98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in x around 0 98.6%
if 1.3999999999999999 < F Initial program 57.9%
Simplified71.6%
clear-num71.6%
fma-define71.6%
fma-undefine71.6%
*-commutative71.6%
fma-define71.6%
fma-define71.6%
Applied egg-rr71.6%
Taylor expanded in F around inf 98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.4e-12)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.95e-66)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(if (<= F 106000.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.4e-12) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.95e-66) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else if (F <= 106000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-3.4d-12)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.95d-66) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else if (f <= 106000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -3.4e-12) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.95e-66) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else if (F <= 106000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.4e-12: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.95e-66: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 elif F <= 106000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.4e-12) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.95e-66) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); elseif (F <= 106000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3.4e-12) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.95e-66) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; elseif (F <= 106000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.4e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.95e-66], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 106000.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], 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.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-66}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_0\\
\mathbf{elif}\;F \leq 106000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.4000000000000001e-12Initial program 58.5%
Simplified71.9%
clear-num71.9%
fma-define71.9%
fma-undefine71.9%
*-commutative71.9%
fma-define71.9%
fma-define71.9%
Applied egg-rr71.9%
Taylor expanded in F around -inf 96.6%
if -3.4000000000000001e-12 < F < 1.94999999999999991e-66Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in B around 0 88.5%
if 1.94999999999999991e-66 < F < 106000Initial program 99.5%
Taylor expanded in B around 0 92.5%
if 106000 < F Initial program 57.2%
Simplified71.1%
clear-num71.1%
fma-define71.1%
fma-undefine71.1%
*-commutative71.1%
fma-define71.1%
fma-define71.1%
Applied egg-rr71.1%
Taylor expanded in F around inf 99.9%
Final simplification93.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (t_1 (/ x (tan B))))
(if (<= F -3.4e-12)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 6e-68)
(- (* F (* (/ 1.0 B) t_0)) t_1)
(if (<= F 0.025)
(- (* (/ F (sin B)) t_0) (/ x B))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / tan(B);
double tmp;
if (F <= -3.4e-12) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 6e-68) {
tmp = (F * ((1.0 / B) * t_0)) - t_1;
} else if (F <= 0.025) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} 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 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = x / tan(b)
if (f <= (-3.4d-12)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 6d-68) then
tmp = (f * ((1.0d0 / b) * t_0)) - t_1
else if (f <= 0.025d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
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 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -3.4e-12) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 6e-68) {
tmp = (F * ((1.0 / B) * t_0)) - t_1;
} else if (F <= 0.025) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = x / math.tan(B) tmp = 0 if F <= -3.4e-12: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 6e-68: tmp = (F * ((1.0 / B) * t_0)) - t_1 elif F <= 0.025: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.4e-12) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 6e-68) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * t_0)) - t_1); elseif (F <= 0.025) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = x / tan(B); tmp = 0.0; if (F <= -3.4e-12) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 6e-68) tmp = (F * ((1.0 / B) * t_0)) - t_1; elseif (F <= 0.025) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.4e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 6e-68], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 0.025], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-68}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot t\_0\right) - t\_1\\
\mathbf{elif}\;F \leq 0.025:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -3.4000000000000001e-12Initial program 58.5%
Simplified71.9%
clear-num71.9%
fma-define71.9%
fma-undefine71.9%
*-commutative71.9%
fma-define71.9%
fma-define71.9%
Applied egg-rr71.9%
Taylor expanded in F around -inf 96.6%
if -3.4000000000000001e-12 < F < 6e-68Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in B around 0 88.5%
if 6e-68 < F < 0.025000000000000001Initial program 99.5%
Taylor expanded in B around 0 91.9%
Taylor expanded in F around 0 87.0%
if 0.025000000000000001 < F Initial program 57.9%
Simplified71.6%
clear-num71.6%
fma-define71.6%
fma-undefine71.6%
*-commutative71.6%
fma-define71.6%
fma-define71.6%
Applied egg-rr71.6%
Taylor expanded in F around inf 98.8%
Final simplification93.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (t_1 (/ x (tan B))))
(if (<= F -3.4e-12)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 5.1e-69)
(- (* t_0 (/ F B)) t_1)
(if (<= F 0.07)
(- (* (/ F (sin B)) t_0) (/ x B))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / tan(B);
double tmp;
if (F <= -3.4e-12) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 5.1e-69) {
tmp = (t_0 * (F / B)) - t_1;
} else if (F <= 0.07) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} 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 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = x / tan(b)
if (f <= (-3.4d-12)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 5.1d-69) then
tmp = (t_0 * (f / b)) - t_1
else if (f <= 0.07d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
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 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -3.4e-12) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 5.1e-69) {
tmp = (t_0 * (F / B)) - t_1;
} else if (F <= 0.07) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = x / math.tan(B) tmp = 0 if F <= -3.4e-12: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 5.1e-69: tmp = (t_0 * (F / B)) - t_1 elif F <= 0.07: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.4e-12) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 5.1e-69) tmp = Float64(Float64(t_0 * Float64(F / B)) - t_1); elseif (F <= 0.07) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = x / tan(B); tmp = 0.0; if (F <= -3.4e-12) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 5.1e-69) tmp = (t_0 * (F / B)) - t_1; elseif (F <= 0.07) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.4e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 5.1e-69], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 0.07], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 5.1 \cdot 10^{-69}:\\
\;\;\;\;t\_0 \cdot \frac{F}{B} - t\_1\\
\mathbf{elif}\;F \leq 0.07:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -3.4000000000000001e-12Initial program 58.5%
Simplified71.9%
clear-num71.9%
fma-define71.9%
fma-undefine71.9%
*-commutative71.9%
fma-define71.9%
fma-define71.9%
Applied egg-rr71.9%
Taylor expanded in F around -inf 96.6%
if -3.4000000000000001e-12 < F < 5.09999999999999987e-69Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in B around 0 88.4%
if 5.09999999999999987e-69 < F < 0.070000000000000007Initial program 99.5%
Taylor expanded in B around 0 91.9%
Taylor expanded in F around 0 87.0%
if 0.070000000000000007 < F Initial program 57.9%
Simplified71.6%
clear-num71.6%
fma-define71.6%
fma-undefine71.6%
*-commutative71.6%
fma-define71.6%
fma-define71.6%
Applied egg-rr71.6%
Taylor expanded in F around inf 98.8%
Final simplification93.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.4e-12)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 9.5e-53)
(- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F 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.4e-12) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 9.5e-53) {
tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.4d-12)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 9.5d-53) then
tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / 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.4e-12) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 9.5e-53) {
tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.4e-12: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 9.5e-53: tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.4e-12) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 9.5e-53) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / 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.4e-12) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 9.5e-53) tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.4e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9.5e-53], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / 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.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-53}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.4000000000000001e-12Initial program 58.5%
Simplified71.9%
clear-num71.9%
fma-define71.9%
fma-undefine71.9%
*-commutative71.9%
fma-define71.9%
fma-define71.9%
Applied egg-rr71.9%
Taylor expanded in F around -inf 96.6%
if -3.4000000000000001e-12 < F < 9.5000000000000008e-53Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
fma-define99.7%
Simplified99.7%
Taylor expanded in B around 0 88.1%
if 9.5000000000000008e-53 < F Initial program 62.3%
Simplified74.5%
clear-num74.5%
fma-define74.5%
fma-undefine74.5%
*-commutative74.5%
fma-define74.5%
fma-define74.5%
Applied egg-rr74.5%
Taylor expanded in F around inf 90.7%
Final simplification91.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6e-16)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -6.5e-77)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 7.5e-53)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -6e-16) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -6.5e-77) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 7.5e-53) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-6d-16)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-6.5d-77)) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 7.5d-53) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -6e-16) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -6.5e-77) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 7.5e-53) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -6e-16: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -6.5e-77: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 7.5e-53: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6e-16) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -6.5e-77) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 7.5e-53) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -6e-16) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -6.5e-77) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 7.5e-53) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -6.5e-77], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-53], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -6.5 \cdot 10^{-77}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-53}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5.99999999999999987e-16Initial program 59.0%
Simplified72.3%
clear-num72.3%
fma-define72.3%
fma-undefine72.3%
*-commutative72.3%
fma-define72.3%
fma-define72.3%
Applied egg-rr72.3%
Taylor expanded in F around -inf 96.6%
if -5.99999999999999987e-16 < F < -6.4999999999999999e-77Initial program 99.1%
Taylor expanded in B around 0 88.3%
Taylor expanded in B around 0 72.5%
if -6.4999999999999999e-77 < F < 7.5000000000000001e-53Initial program 99.5%
Taylor expanded in F around -inf 34.3%
Taylor expanded in x around inf 78.7%
if 7.5000000000000001e-53 < F Initial program 62.3%
Simplified74.5%
clear-num74.5%
fma-define74.5%
fma-undefine74.5%
*-commutative74.5%
fma-define74.5%
fma-define74.5%
Applied egg-rr74.5%
Taylor expanded in F around inf 90.7%
Final simplification86.6%
(FPCore (F B x)
:precision binary64
(if (<= F -5.5e-16)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -9e-77)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 1.15e-30)
(/ (* x (cos B)) (- (sin B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.5e-16) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -9e-77) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.15e-30) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (x * (-1.0 / tan(B))) + (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 <= (-5.5d-16)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-9d-77)) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 1.15d-30) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.5e-16) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -9e-77) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.15e-30) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.5e-16: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -9e-77: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 1.15e-30: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.5e-16) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -9e-77) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 1.15e-30) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.5e-16) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -9e-77) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 1.15e-30) tmp = (x * cos(B)) / -sin(B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.5e-16], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9e-77], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-30], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -9 \cdot 10^{-77}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-30}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -5.49999999999999964e-16Initial program 59.0%
Simplified72.3%
clear-num72.3%
fma-define72.3%
fma-undefine72.3%
*-commutative72.3%
fma-define72.3%
fma-define72.3%
Applied egg-rr72.3%
Taylor expanded in F around -inf 96.6%
if -5.49999999999999964e-16 < F < -9.0000000000000001e-77Initial program 99.1%
Taylor expanded in B around 0 88.3%
Taylor expanded in B around 0 72.5%
if -9.0000000000000001e-77 < F < 1.14999999999999992e-30Initial program 99.5%
Taylor expanded in F around -inf 33.7%
Taylor expanded in x around inf 76.1%
if 1.14999999999999992e-30 < F Initial program 59.3%
Taylor expanded in F around inf 77.1%
Taylor expanded in B around 0 72.4%
Final simplification80.9%
(FPCore (F B x)
:precision binary64
(if (<= F -5.4e-16)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 B))
(if (<= F -7.5e-77)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 7e-33)
(/ (* x (cos B)) (- (sin B)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.4e-16) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / B);
} else if (F <= -7.5e-77) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 7e-33) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (x * (-1.0 / tan(B))) + (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 <= (-5.4d-16)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / b)
else if (f <= (-7.5d-77)) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 7d-33) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.4e-16) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / B);
} else if (F <= -7.5e-77) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 7e-33) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.4e-16: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / B) elif F <= -7.5e-77: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 7e-33: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.4e-16) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / B)); elseif (F <= -7.5e-77) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 7e-33) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.4e-16) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / B); elseif (F <= -7.5e-77) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 7e-33) tmp = (x * cos(B)) / -sin(B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.4e-16], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.5e-77], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-33], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-77}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-33}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -5.39999999999999999e-16Initial program 59.0%
Taylor expanded in F around -inf 96.5%
div-inv96.6%
clear-num96.6%
Applied egg-rr96.6%
Taylor expanded in B around 0 71.0%
if -5.39999999999999999e-16 < F < -7.5000000000000006e-77Initial program 99.1%
Taylor expanded in B around 0 88.3%
Taylor expanded in B around 0 72.5%
if -7.5000000000000006e-77 < F < 6.9999999999999997e-33Initial program 99.5%
Taylor expanded in F around -inf 33.7%
Taylor expanded in x around inf 76.1%
if 6.9999999999999997e-33 < F Initial program 59.3%
Taylor expanded in F around inf 77.1%
Taylor expanded in B around 0 72.4%
Final simplification73.5%
(FPCore (F B x)
:precision binary64
(if (<= F -6e-16)
(+ (/ -1.0 (/ (tan B) x)) (/ -1.0 B))
(if (<= F -1.08e-76)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 8.5e-23)
(* (cos B) (/ x (- (sin B))))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / B);
} else if (F <= -1.08e-76) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 8.5e-23) {
tmp = cos(B) * (x / -sin(B));
} else {
tmp = (x * (-1.0 / tan(B))) + (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 <= (-6d-16)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / b)
else if (f <= (-1.08d-76)) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 8.5d-23) then
tmp = cos(b) * (x / -sin(b))
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / B);
} else if (F <= -1.08e-76) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 8.5e-23) {
tmp = Math.cos(B) * (x / -Math.sin(B));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-16: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / B) elif F <= -1.08e-76: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 8.5e-23: tmp = math.cos(B) * (x / -math.sin(B)) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-16) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / B)); elseif (F <= -1.08e-76) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 8.5e-23) tmp = Float64(cos(B) * Float64(x / Float64(-sin(B)))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6e-16) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / B); elseif (F <= -1.08e-76) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 8.5e-23) tmp = cos(B) * (x / -sin(B)); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-16], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.08e-76], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.5e-23], N[(N[Cos[B], $MachinePrecision] * N[(x / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -1.08 \cdot 10^{-76}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{-23}:\\
\;\;\;\;\cos B \cdot \frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -5.99999999999999987e-16Initial program 59.0%
Taylor expanded in F around -inf 96.5%
div-inv96.6%
clear-num96.6%
Applied egg-rr96.6%
Taylor expanded in B around 0 71.0%
if -5.99999999999999987e-16 < F < -1.08e-76Initial program 99.1%
Taylor expanded in B around 0 88.3%
Taylor expanded in B around 0 72.5%
if -1.08e-76 < F < 8.4999999999999996e-23Initial program 99.5%
Taylor expanded in F around -inf 33.7%
div-inv33.8%
clear-num33.7%
Applied egg-rr33.7%
div-inv33.7%
Applied egg-rr33.7%
Taylor expanded in x around inf 76.1%
mul-1-neg76.1%
distribute-frac-neg276.1%
*-rgt-identity76.1%
*-commutative76.1%
*-commutative76.1%
times-frac76.1%
/-rgt-identity76.1%
Simplified76.1%
if 8.4999999999999996e-23 < F Initial program 59.3%
Taylor expanded in F around inf 77.1%
Taylor expanded in B around 0 72.4%
Final simplification73.5%
(FPCore (F B x)
:precision binary64
(if (<= x -1.45e-187)
(+ (/ -1.0 B) (/ 1.0 (* (tan B) (/ -1.0 x))))
(if (<= x 4e-10)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.45e-187) {
tmp = (-1.0 / B) + (1.0 / (tan(B) * (-1.0 / x)));
} else if (x <= 4e-10) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (x * (-1.0 / tan(B))) + (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 <= (-1.45d-187)) then
tmp = ((-1.0d0) / b) + (1.0d0 / (tan(b) * ((-1.0d0) / x)))
else if (x <= 4d-10) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (x <= -1.45e-187) {
tmp = (-1.0 / B) + (1.0 / (Math.tan(B) * (-1.0 / x)));
} else if (x <= 4e-10) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if x <= -1.45e-187: tmp = (-1.0 / B) + (1.0 / (math.tan(B) * (-1.0 / x))) elif x <= 4e-10: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (x <= -1.45e-187) tmp = Float64(Float64(-1.0 / B) + Float64(1.0 / Float64(tan(B) * Float64(-1.0 / x)))); elseif (x <= 4e-10) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (x <= -1.45e-187) tmp = (-1.0 / B) + (1.0 / (tan(B) * (-1.0 / x))); elseif (x <= 4e-10) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[x, -1.45e-187], N[(N[(-1.0 / B), $MachinePrecision] + N[(1.0 / N[(N[Tan[B], $MachinePrecision] * N[(-1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e-10], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{-187}:\\
\;\;\;\;\frac{-1}{B} + \frac{1}{\tan B \cdot \frac{-1}{x}}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-10}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if x < -1.44999999999999994e-187Initial program 66.4%
Taylor expanded in F around -inf 52.1%
div-inv52.1%
clear-num52.0%
Applied egg-rr52.0%
div-inv52.1%
Applied egg-rr52.1%
Taylor expanded in B around 0 60.7%
if -1.44999999999999994e-187 < x < 4.00000000000000015e-10Initial program 76.8%
Taylor expanded in B around 0 69.9%
Taylor expanded in B around 0 43.5%
if 4.00000000000000015e-10 < x Initial program 92.9%
Taylor expanded in F around inf 86.1%
Taylor expanded in B around 0 96.8%
Final simplification64.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.16e-12)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F -2.6e-268) (not (<= F 1.8e-219)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
(/ x (- B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.16e-12) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= -2.6e-268) || !(F <= 1.8e-219)) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else {
tmp = x / -B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.16d-12)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= (-2.6d-268)) .or. (.not. (f <= 1.8d-219))) then
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.16e-12) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= -2.6e-268) || !(F <= 1.8e-219)) {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.16e-12: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= -2.6e-268) or not (F <= 1.8e-219): tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.16e-12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= -2.6e-268) || !(F <= 1.8e-219)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.16e-12) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= -2.6e-268) || ~((F <= 1.8e-219))) tmp = (x * (-1.0 / tan(B))) + (1.0 / B); else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.16e-12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -2.6e-268], N[Not[LessEqual[F, 1.8e-219]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.16 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.6 \cdot 10^{-268} \lor \neg \left(F \leq 1.8 \cdot 10^{-219}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -1.1599999999999999e-12Initial program 58.5%
Taylor expanded in B around 0 32.6%
Taylor expanded in F around -inf 70.8%
mul-1-neg70.8%
distribute-neg-in70.8%
unsub-neg70.8%
distribute-neg-frac70.8%
metadata-eval70.8%
Simplified70.8%
if -1.1599999999999999e-12 < F < -2.60000000000000002e-268 or 1.79999999999999987e-219 < F Initial program 83.2%
Taylor expanded in F around inf 52.5%
Taylor expanded in B around 0 59.3%
if -2.60000000000000002e-268 < F < 1.79999999999999987e-219Initial program 99.5%
Taylor expanded in F around -inf 24.4%
Taylor expanded in B around 0 15.3%
associate-*r/15.3%
neg-mul-115.3%
Simplified15.3%
Taylor expanded in x around inf 52.8%
mul-1-neg52.8%
distribute-neg-frac252.8%
Simplified52.8%
Final simplification61.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.35e-273) (+ (/ -1.0 (/ (tan B) x)) (/ -1.0 B)) (if (<= F 1.45e-219) (/ x (- B)) (+ (* x (/ -1.0 (tan B))) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e-273) {
tmp = (-1.0 / (tan(B) / x)) + (-1.0 / B);
} else if (F <= 1.45e-219) {
tmp = x / -B;
} else {
tmp = (x * (-1.0 / tan(B))) + (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 <= (-1.35d-273)) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((-1.0d0) / b)
else if (f <= 1.45d-219) then
tmp = x / -b
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e-273) {
tmp = (-1.0 / (Math.tan(B) / x)) + (-1.0 / B);
} else if (F <= 1.45e-219) {
tmp = x / -B;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.35e-273: tmp = (-1.0 / (math.tan(B) / x)) + (-1.0 / B) elif F <= 1.45e-219: tmp = x / -B else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.35e-273) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(-1.0 / B)); elseif (F <= 1.45e-219) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.35e-273) tmp = (-1.0 / (tan(B) / x)) + (-1.0 / B); elseif (F <= 1.45e-219) tmp = x / -B; else tmp = (x * (-1.0 / tan(B))) + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.35e-273], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e-219], N[(x / (-B)), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{-273}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-219}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -1.34999999999999992e-273Initial program 74.4%
Taylor expanded in F around -inf 73.4%
div-inv73.6%
clear-num73.5%
Applied egg-rr73.5%
Taylor expanded in B around 0 64.2%
if -1.34999999999999992e-273 < F < 1.44999999999999992e-219Initial program 99.5%
Taylor expanded in F around -inf 24.4%
Taylor expanded in B around 0 15.3%
associate-*r/15.3%
neg-mul-115.3%
Simplified15.3%
Taylor expanded in x around inf 52.8%
mul-1-neg52.8%
distribute-neg-frac252.8%
Simplified52.8%
if 1.44999999999999992e-219 < F Initial program 75.9%
Taylor expanded in F around inf 60.2%
Taylor expanded in B around 0 62.4%
Final simplification62.0%
(FPCore (F B x) :precision binary64 (if (<= F -4.5e-67) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 2.5e-55) (/ x (- B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-67) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.5e-55) {
tmp = x / -B;
} else {
tmp = (1.0 / 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 <= (-4.5d-67)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.5d-55) then
tmp = x / -b
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-67) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.5e-55) {
tmp = x / -B;
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.5e-67: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.5e-55: tmp = x / -B else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.5e-67) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.5e-55) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.5e-67) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.5e-55) tmp = x / -B; else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.5e-67], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-55], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-55}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.50000000000000015e-67Initial program 64.6%
Taylor expanded in B around 0 39.7%
Taylor expanded in F around -inf 64.3%
mul-1-neg64.3%
distribute-neg-in64.3%
unsub-neg64.3%
distribute-neg-frac64.3%
metadata-eval64.3%
Simplified64.3%
if -4.50000000000000015e-67 < F < 2.5000000000000001e-55Initial program 99.5%
Taylor expanded in F around -inf 33.8%
Taylor expanded in B around 0 18.0%
associate-*r/18.0%
neg-mul-118.0%
Simplified18.0%
Taylor expanded in x around inf 40.4%
mul-1-neg40.4%
distribute-neg-frac240.4%
Simplified40.4%
if 2.5000000000000001e-55 < F Initial program 62.3%
Taylor expanded in B around 0 38.2%
Taylor expanded in F around inf 66.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.7e-68) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 1.2e-35) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.7e-68) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.2e-35) {
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.7d-68)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.2d-35) 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.7e-68) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.2e-35) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.7e-68: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.2e-35: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.7e-68) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.2e-35) 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.7e-68) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.2e-35) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.7e-68], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e-35], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.7 \cdot 10^{-68}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-35}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.70000000000000009e-68Initial program 64.6%
Taylor expanded in B around 0 39.7%
Taylor expanded in F around -inf 64.3%
mul-1-neg64.3%
distribute-neg-in64.3%
unsub-neg64.3%
distribute-neg-frac64.3%
metadata-eval64.3%
Simplified64.3%
if -1.70000000000000009e-68 < F < 1.2000000000000001e-35Initial program 99.5%
Taylor expanded in F around -inf 33.2%
Taylor expanded in B around 0 18.3%
associate-*r/18.3%
neg-mul-118.3%
Simplified18.3%
Taylor expanded in x around inf 39.6%
mul-1-neg39.6%
distribute-neg-frac239.6%
Simplified39.6%
if 1.2000000000000001e-35 < F Initial program 59.3%
Taylor expanded in F around inf 77.1%
Taylor expanded in B around 0 50.9%
Taylor expanded in B around 0 48.5%
(FPCore (F B x) :precision binary64 (if (<= F -1.72e-66) (/ (- -1.0 x) B) (if (<= F 4e-21) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.72e-66) {
tmp = (-1.0 - x) / B;
} else if (F <= 4e-21) {
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.72d-66)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4d-21) 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.72e-66) {
tmp = (-1.0 - x) / B;
} else if (F <= 4e-21) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.72e-66: tmp = (-1.0 - x) / B elif F <= 4e-21: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.72e-66) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4e-21) 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.72e-66) tmp = (-1.0 - x) / B; elseif (F <= 4e-21) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.72e-66], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e-21], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.72 \cdot 10^{-66}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-21}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.72000000000000011e-66Initial program 64.6%
Taylor expanded in F around -inf 87.2%
Taylor expanded in B around 0 42.6%
associate-*r/42.6%
neg-mul-142.6%
Simplified42.6%
if -1.72000000000000011e-66 < F < 3.99999999999999963e-21Initial program 99.5%
Taylor expanded in F around -inf 33.2%
Taylor expanded in B around 0 18.3%
associate-*r/18.3%
neg-mul-118.3%
Simplified18.3%
Taylor expanded in x around inf 39.6%
mul-1-neg39.6%
distribute-neg-frac239.6%
Simplified39.6%
if 3.99999999999999963e-21 < F Initial program 59.3%
Taylor expanded in F around inf 77.1%
Taylor expanded in B around 0 50.9%
Taylor expanded in B around 0 48.5%
Final simplification42.7%
(FPCore (F B x) :precision binary64 (if (<= F -6e-16) (/ -1.0 B) (if (<= F 4.5e-22) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = -1.0 / B;
} else if (F <= 4.5e-22) {
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 <= (-6d-16)) then
tmp = (-1.0d0) / b
else if (f <= 4.5d-22) 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 <= -6e-16) {
tmp = -1.0 / B;
} else if (F <= 4.5e-22) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-16: tmp = -1.0 / B elif F <= 4.5e-22: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-16) tmp = Float64(-1.0 / B); elseif (F <= 4.5e-22) 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 <= -6e-16) tmp = -1.0 / B; elseif (F <= 4.5e-22) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-16], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 4.5e-22], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-22}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.99999999999999987e-16Initial program 59.0%
Taylor expanded in F around -inf 96.5%
Taylor expanded in B around 0 44.8%
associate-*r/44.8%
neg-mul-144.8%
Simplified44.8%
Taylor expanded in x around 0 29.9%
if -5.99999999999999987e-16 < F < 4.49999999999999987e-22Initial program 99.4%
Taylor expanded in F around -inf 32.9%
Taylor expanded in B around 0 19.4%
associate-*r/19.4%
neg-mul-119.4%
Simplified19.4%
Taylor expanded in x around inf 38.4%
mul-1-neg38.4%
distribute-neg-frac238.4%
Simplified38.4%
if 4.49999999999999987e-22 < F Initial program 59.3%
Taylor expanded in F around inf 77.1%
Taylor expanded in B around 0 50.9%
Taylor expanded in B around 0 48.5%
(FPCore (F B x) :precision binary64 (if (<= F -6e-16) (/ -1.0 B) (if (<= F 9e+211) (/ x (- B)) (/ (+ x 1.0) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = -1.0 / B;
} else if (F <= 9e+211) {
tmp = x / -B;
} else {
tmp = (x + 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 <= (-6d-16)) then
tmp = (-1.0d0) / b
else if (f <= 9d+211) then
tmp = x / -b
else
tmp = (x + 1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = -1.0 / B;
} else if (F <= 9e+211) {
tmp = x / -B;
} else {
tmp = (x + 1.0) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-16: tmp = -1.0 / B elif F <= 9e+211: tmp = x / -B else: tmp = (x + 1.0) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-16) tmp = Float64(-1.0 / B); elseif (F <= 9e+211) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(x + 1.0) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6e-16) tmp = -1.0 / B; elseif (F <= 9e+211) tmp = x / -B; else tmp = (x + 1.0) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-16], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 9e+211], N[(x / (-B)), $MachinePrecision], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{+211}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{B}\\
\end{array}
\end{array}
if F < -5.99999999999999987e-16Initial program 59.0%
Taylor expanded in F around -inf 96.5%
Taylor expanded in B around 0 44.8%
associate-*r/44.8%
neg-mul-144.8%
Simplified44.8%
Taylor expanded in x around 0 29.9%
if -5.99999999999999987e-16 < F < 9e211Initial program 91.3%
Taylor expanded in F around -inf 38.7%
Taylor expanded in B around 0 22.2%
associate-*r/22.2%
neg-mul-122.2%
Simplified22.2%
Taylor expanded in x around inf 36.0%
mul-1-neg36.0%
distribute-neg-frac236.0%
Simplified36.0%
if 9e211 < F Initial program 22.3%
Taylor expanded in F around -inf 29.2%
expm1-log1p-u6.8%
add-sqr-sqrt6.7%
sqrt-unprod6.9%
sqr-neg6.9%
sqrt-unprod0.2%
add-sqr-sqrt0.4%
div-inv0.4%
add-sqr-sqrt0.3%
sqrt-unprod28.9%
frac-times28.8%
metadata-eval28.8%
metadata-eval28.8%
frac-times28.9%
metadata-eval28.9%
metadata-eval28.9%
pow-prod-up28.9%
pow128.9%
inv-pow28.9%
associate-*l/28.8%
Applied egg-rr34.7%
Taylor expanded in B around 0 44.8%
+-commutative44.8%
Simplified44.8%
(FPCore (F B x) :precision binary64 (if (<= F -6e-16) (/ -1.0 B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = -1.0 / B;
} else {
tmp = x / -B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-6d-16)) then
tmp = (-1.0d0) / b
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6e-16) {
tmp = -1.0 / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-16: tmp = -1.0 / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-16) tmp = Float64(-1.0 / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6e-16) tmp = -1.0 / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-16], N[(-1.0 / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -5.99999999999999987e-16Initial program 59.0%
Taylor expanded in F around -inf 96.5%
Taylor expanded in B around 0 44.8%
associate-*r/44.8%
neg-mul-144.8%
Simplified44.8%
Taylor expanded in x around 0 29.9%
if -5.99999999999999987e-16 < F Initial program 86.0%
Taylor expanded in F around -inf 38.0%
Taylor expanded in B around 0 21.2%
associate-*r/21.2%
neg-mul-121.2%
Simplified21.2%
Taylor expanded in x around inf 34.0%
mul-1-neg34.0%
distribute-neg-frac234.0%
Simplified34.0%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 78.2%
Taylor expanded in F around -inf 54.9%
Taylor expanded in B around 0 28.0%
associate-*r/28.0%
neg-mul-128.0%
Simplified28.0%
Taylor expanded in x around 0 11.4%
herbie shell --seed 2024096
(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))))))