
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -50000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 110000000.0)
(- (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) 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 <= -50000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 110000000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - 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 <= (-50000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 110000000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - 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 <= -50000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 110000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - 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 <= -50000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 110000000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - 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 <= -50000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 110000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - 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 <= -50000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 110000000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - 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, -50000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $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 -50000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5e13Initial program 77.1%
Simplified83.9%
clear-num83.9%
inv-pow83.9%
fma-define83.9%
fma-undefine83.9%
*-commutative83.9%
fma-define83.9%
fma-define83.9%
Applied egg-rr83.9%
unpow-183.9%
Simplified83.9%
Taylor expanded in F around -inf 99.7%
if -5e13 < F < 1.1e8Initial program 99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
div-inv99.6%
add-sqr-sqrt62.9%
sqrt-unprod65.9%
sqr-neg65.9%
div-inv65.9%
div-inv65.9%
sqrt-unprod14.2%
add-sqr-sqrt33.2%
div-inv33.2%
neg-sub033.2%
sub-neg33.2%
div-inv33.2%
add-sqr-sqrt14.2%
sqrt-unprod65.9%
div-inv65.9%
div-inv65.9%
sqr-neg65.9%
Applied egg-rr99.6%
+-lft-identity99.6%
Simplified99.6%
if 1.1e8 < F Initial program 52.5%
Simplified68.1%
clear-num68.1%
inv-pow68.1%
fma-define68.1%
fma-undefine68.1%
*-commutative68.1%
fma-define68.1%
fma-define68.1%
Applied egg-rr68.1%
unpow-168.1%
Simplified68.1%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.65)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.6)
(- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.65) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.6) {
tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.65d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.6d0) then
tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.65) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.6) {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.65: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.6: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.65) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.6) tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.65) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.6) tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.65], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.6], 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] - 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.65:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.6:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.6499999999999999Initial program 78.6%
Simplified84.9%
clear-num84.9%
inv-pow84.9%
fma-define84.9%
fma-undefine84.9%
*-commutative84.9%
fma-define84.9%
fma-define84.9%
Applied egg-rr84.9%
unpow-184.9%
Simplified84.9%
Taylor expanded in F around -inf 98.3%
if -1.6499999999999999 < F < 1.6000000000000001Initial program 99.4%
Simplified99.5%
clear-num99.5%
inv-pow99.5%
fma-define99.5%
fma-undefine99.5%
*-commutative99.5%
fma-define99.5%
fma-define99.5%
Applied egg-rr99.5%
unpow-199.5%
Simplified99.5%
Taylor expanded in F around 0 98.5%
if 1.6000000000000001 < F Initial program 54.3%
Simplified69.3%
clear-num69.3%
inv-pow69.3%
fma-define69.3%
fma-undefine69.3%
*-commutative69.3%
fma-define69.3%
fma-define69.3%
Applied egg-rr69.3%
unpow-169.3%
Simplified69.3%
Taylor expanded in F around inf 98.6%
Final simplification98.5%
(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 0.5))) 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(0.5))) - 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(0.5d0))) - 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(0.5))) - 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(0.5))) - 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(sin(B) / sqrt(0.5))) - 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(0.5))) - 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[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $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:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 78.6%
Simplified84.9%
clear-num84.9%
inv-pow84.9%
fma-define84.9%
fma-undefine84.9%
*-commutative84.9%
fma-define84.9%
fma-define84.9%
Applied egg-rr84.9%
unpow-184.9%
Simplified84.9%
Taylor expanded in F around -inf 98.3%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 98.4%
Taylor expanded in x around 0 98.4%
clear-num98.4%
un-div-inv98.5%
Applied egg-rr98.5%
if 1.3999999999999999 < F Initial program 54.3%
Simplified69.3%
clear-num69.3%
inv-pow69.3%
fma-define69.3%
fma-undefine69.3%
*-commutative69.3%
fma-define69.3%
fma-define69.3%
Applied egg-rr69.3%
unpow-169.3%
Simplified69.3%
Taylor expanded in F around inf 98.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 (/ (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 78.6%
Simplified84.9%
clear-num84.9%
inv-pow84.9%
fma-define84.9%
fma-undefine84.9%
*-commutative84.9%
fma-define84.9%
fma-define84.9%
Applied egg-rr84.9%
unpow-184.9%
Simplified84.9%
Taylor expanded in F around -inf 98.3%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 98.4%
Taylor expanded in x around 0 98.4%
if 1.3999999999999999 < F Initial program 54.3%
Simplified69.3%
clear-num69.3%
inv-pow69.3%
fma-define69.3%
fma-undefine69.3%
*-commutative69.3%
fma-define69.3%
fma-define69.3%
Applied egg-rr69.3%
unpow-169.3%
Simplified69.3%
Taylor expanded in F around inf 98.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.068)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 8.8e-10)
(- (* (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 <= -0.068) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 8.8e-10) {
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 <= (-0.068d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 8.8d-10) 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 <= -0.068) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 8.8e-10) {
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 <= -0.068: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 8.8e-10: 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 <= -0.068) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 8.8e-10) 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 <= -0.068) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 8.8e-10) 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, -0.068], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 8.8e-10], 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 -0.068:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-10}:\\
\;\;\;\;\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 < -0.068000000000000005Initial program 78.6%
Simplified84.9%
clear-num84.9%
inv-pow84.9%
fma-define84.9%
fma-undefine84.9%
*-commutative84.9%
fma-define84.9%
fma-define84.9%
Applied egg-rr84.9%
unpow-184.9%
Simplified84.9%
Taylor expanded in F around -inf 98.3%
if -0.068000000000000005 < F < 8.7999999999999996e-10Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 99.0%
Taylor expanded in B around 0 83.5%
if 8.7999999999999996e-10 < F Initial program 56.6%
Simplified70.8%
clear-num70.8%
inv-pow70.8%
fma-define70.8%
fma-undefine70.8%
*-commutative70.8%
fma-define70.8%
fma-define70.8%
Applied egg-rr70.8%
unpow-170.8%
Simplified70.8%
Taylor expanded in F around inf 94.3%
Final simplification91.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.95e-50)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -3.3e-169)
(/ F (/ (sin B) (sqrt 0.5)))
(if (<= F 2.5e-97)
(* 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 <= -2.95e-50) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -3.3e-169) {
tmp = F / (sin(B) / sqrt(0.5));
} else if (F <= 2.5e-97) {
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 <= (-2.95d-50)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-3.3d-169)) then
tmp = f / (sin(b) / sqrt(0.5d0))
else if (f <= 2.5d-97) 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 <= -2.95e-50) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -3.3e-169) {
tmp = F / (Math.sin(B) / Math.sqrt(0.5));
} else if (F <= 2.5e-97) {
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 <= -2.95e-50: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -3.3e-169: tmp = F / (math.sin(B) / math.sqrt(0.5)) elif F <= 2.5e-97: 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 <= -2.95e-50) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -3.3e-169) tmp = Float64(F / Float64(sin(B) / sqrt(0.5))); elseif (F <= 2.5e-97) tmp = Float64(x * Float64(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 <= -2.95e-50) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -3.3e-169) tmp = F / (sin(B) / sqrt(0.5)); elseif (F <= 2.5e-97) 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, -2.95e-50], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -3.3e-169], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-97], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $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.95 \cdot 10^{-50}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -3.3 \cdot 10^{-169}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-97}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.95e-50Initial program 79.4%
Simplified85.5%
clear-num85.5%
inv-pow85.5%
fma-define85.5%
fma-undefine85.5%
*-commutative85.5%
fma-define85.5%
fma-define85.5%
Applied egg-rr85.5%
unpow-185.5%
Simplified85.5%
Taylor expanded in F around -inf 96.1%
if -2.95e-50 < F < -3.30000000000000026e-169Initial program 99.1%
Simplified99.3%
Taylor expanded in F around 0 99.2%
Taylor expanded in x around 0 60.5%
*-un-lft-identity60.5%
associate-*r/60.6%
clear-num60.6%
un-div-inv60.7%
Applied egg-rr60.7%
if -3.30000000000000026e-169 < F < 2.4999999999999998e-97Initial program 99.5%
Taylor expanded in F around -inf 38.7%
Taylor expanded in x around inf 85.7%
mul-1-neg85.7%
associate-/l*85.8%
distribute-lft-neg-in85.8%
Simplified85.8%
if 2.4999999999999998e-97 < F Initial program 62.2%
Simplified74.5%
clear-num74.5%
inv-pow74.5%
fma-define74.5%
fma-undefine74.5%
*-commutative74.5%
fma-define74.5%
fma-define74.5%
Applied egg-rr74.5%
unpow-174.5%
Simplified74.5%
Taylor expanded in F around inf 89.0%
Final simplification87.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.5e-53)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.5e-168)
(/ F (/ (sin B) (sqrt 0.5)))
(if (<= F 240000.0)
(* x (/ (cos B) (- (sin B))))
(if (<= F 2.8e+67)
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
(-
(* F (/ (/ 1.0 F) (* B (+ 1.0 (* -0.16666666666666666 (* B B))))))
t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.5e-53) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.5e-168) {
tmp = F / (sin(B) / sqrt(0.5));
} else if (F <= 240000.0) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 2.8e+67) {
tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
} else {
tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * 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.5d-53)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.5d-168)) then
tmp = f / (sin(b) / sqrt(0.5d0))
else if (f <= 240000.0d0) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 2.8d+67) then
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
else
tmp = (f * ((1.0d0 / f) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b * 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.5e-53) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.5e-168) {
tmp = F / (Math.sin(B) / Math.sqrt(0.5));
} else if (F <= 240000.0) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 2.8e+67) {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
} else {
tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.5e-53: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.5e-168: tmp = F / (math.sin(B) / math.sqrt(0.5)) elif F <= 240000.0: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 2.8e+67: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) else: tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.5e-53) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.5e-168) tmp = Float64(F / Float64(sin(B) / sqrt(0.5))); elseif (F <= 240000.0) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 2.8e+67) tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(Float64(1.0 / F) / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * 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.5e-53) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.5e-168) tmp = F / (sin(B) / sqrt(0.5)); elseif (F <= 240000.0) tmp = x * (cos(B) / -sin(B)); elseif (F <= 2.8e+67) tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); else tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * 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.5e-53], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.5e-168], N[(F / N[(N[Sin[B], $MachinePrecision] / N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 240000.0], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e+67], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $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 -3.5 \cdot 10^{-53}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.5 \cdot 10^{-168}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{\sqrt{0.5}}}\\
\mathbf{elif}\;F \leq 240000:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{+67}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)} - t\_0\\
\end{array}
\end{array}
if F < -3.49999999999999993e-53Initial program 79.4%
Simplified85.5%
clear-num85.5%
inv-pow85.5%
fma-define85.5%
fma-undefine85.5%
*-commutative85.5%
fma-define85.5%
fma-define85.5%
Applied egg-rr85.5%
unpow-185.5%
Simplified85.5%
Taylor expanded in F around -inf 96.1%
if -3.49999999999999993e-53 < F < -1.49999999999999996e-168Initial program 99.1%
Simplified99.3%
Taylor expanded in F around 0 99.2%
Taylor expanded in x around 0 60.5%
*-un-lft-identity60.5%
associate-*r/60.6%
clear-num60.6%
un-div-inv60.7%
Applied egg-rr60.7%
if -1.49999999999999996e-168 < F < 2.4e5Initial program 99.5%
Taylor expanded in F around -inf 38.9%
Taylor expanded in x around inf 75.3%
mul-1-neg75.3%
associate-/l*75.4%
distribute-lft-neg-in75.4%
Simplified75.4%
if 2.4e5 < F < 2.7999999999999998e67Initial program 99.5%
Taylor expanded in F around inf 98.2%
Taylor expanded in B around 0 98.2%
associate-*r/98.2%
neg-mul-198.2%
Simplified98.2%
if 2.7999999999999998e67 < F Initial program 40.3%
Simplified59.9%
clear-num59.9%
inv-pow59.9%
fma-define59.9%
fma-undefine59.9%
*-commutative59.9%
fma-define59.9%
fma-define59.9%
Applied egg-rr59.9%
unpow-159.9%
Simplified59.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 77.8%
unpow277.8%
Applied egg-rr77.8%
Final simplification82.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.25e+259)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
(if (<= F -50000000000000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 150000.0)
(* x (/ (cos B) (- (sin B))))
(if (<= F 1.9e+64)
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
(-
(* F (/ (/ 1.0 F) (* B (+ 1.0 (* -0.16666666666666666 (* B B))))))
(/ x (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e+259) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else if (F <= -50000000000000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 150000.0) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 1.9e+64) {
tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
} else {
tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.25d+259)) then
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
else if (f <= (-50000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 150000.0d0) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 1.9d+64) then
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
else
tmp = (f * ((1.0d0 / f) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b * b)))))) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e+259) {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
} else if (F <= -50000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 150000.0) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 1.9e+64) {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
} else {
tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e+259: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) elif F <= -50000000000000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 150000.0: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 1.9e+64: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) else: tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e+259) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); elseif (F <= -50000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 150000.0) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 1.9e+64) tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(Float64(1.0 / F) / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * B)))))) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.25e+259) tmp = (x * (-1.0 / tan(B))) + (1.0 / B); elseif (F <= -50000000000000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 150000.0) tmp = x * (cos(B) / -sin(B)); elseif (F <= 1.9e+64) tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); else tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e+259], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -50000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 150000.0], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e+64], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{+259}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{elif}\;F \leq -50000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 150000:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+64}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.25000000000000008e259Initial program 69.6%
Taylor expanded in F around inf 77.8%
Taylor expanded in B around 0 86.3%
if -1.25000000000000008e259 < F < -5e13Initial program 78.6%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 74.6%
associate-*r/12.1%
neg-mul-112.1%
Simplified74.6%
if -5e13 < F < 1.5e5Initial program 99.4%
Taylor expanded in F around -inf 33.9%
Taylor expanded in x around inf 66.6%
mul-1-neg66.6%
associate-/l*66.6%
distribute-lft-neg-in66.6%
Simplified66.6%
if 1.5e5 < F < 1.9000000000000001e64Initial program 99.5%
Taylor expanded in F around inf 98.2%
Taylor expanded in B around 0 98.2%
associate-*r/98.2%
neg-mul-198.2%
Simplified98.2%
if 1.9000000000000001e64 < F Initial program 40.3%
Simplified59.9%
clear-num59.9%
inv-pow59.9%
fma-define59.9%
fma-undefine59.9%
*-commutative59.9%
fma-define59.9%
fma-define59.9%
Applied egg-rr59.9%
unpow-159.9%
Simplified59.9%
Taylor expanded in F around inf 99.6%
associate-/r*99.7%
Simplified99.7%
Taylor expanded in B around 0 77.8%
unpow277.8%
Applied egg-rr77.8%
Final simplification73.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.36)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 8.8e-10)
(- (* 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.36) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 8.8e-10) {
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.36d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 8.8d-10) 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.36) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 8.8e-10) {
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.36: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 8.8e-10: 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.36) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 8.8e-10) 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.36) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 8.8e-10) 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.36], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 8.8e-10], 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.36:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-10}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.35999999999999999Initial program 78.6%
Simplified84.9%
clear-num84.9%
inv-pow84.9%
fma-define84.9%
fma-undefine84.9%
*-commutative84.9%
fma-define84.9%
fma-define84.9%
Applied egg-rr84.9%
unpow-184.9%
Simplified84.9%
Taylor expanded in F around -inf 98.3%
if -0.35999999999999999 < F < 8.7999999999999996e-10Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 99.0%
Taylor expanded in x around 0 99.0%
Taylor expanded in B around 0 83.5%
if 8.7999999999999996e-10 < F Initial program 56.6%
Simplified70.8%
clear-num70.8%
inv-pow70.8%
fma-define70.8%
fma-undefine70.8%
*-commutative70.8%
fma-define70.8%
fma-define70.8%
Applied egg-rr70.8%
unpow-170.8%
Simplified70.8%
Taylor expanded in F around inf 94.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.25e+259)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
(if (<= F -0.32)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 5e-59)
(/ (- (* F (sqrt 0.5)) x) B)
(-
(* F (/ (/ 1.0 F) (* B (+ 1.0 (* -0.16666666666666666 (* B B))))))
(/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e+259) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else if (F <= -0.32) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5e-59) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else {
tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.25d+259)) then
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
else if (f <= (-0.32d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5d-59) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else
tmp = (f * ((1.0d0 / f) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b * b)))))) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e+259) {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
} else if (F <= -0.32) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5e-59) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e+259: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) elif F <= -0.32: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5e-59: tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e+259) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); elseif (F <= -0.32) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5e-59) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); else tmp = Float64(Float64(F * Float64(Float64(1.0 / F) / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * B)))))) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.25e+259) tmp = (x * (-1.0 / tan(B))) + (1.0 / B); elseif (F <= -0.32) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5e-59) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = (F * ((1.0 / F) / (B * (1.0 + (-0.16666666666666666 * (B * B)))))) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e+259], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -0.32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-59], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{+259}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{elif}\;F \leq -0.32:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-59}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.25000000000000008e259Initial program 69.6%
Taylor expanded in F around inf 77.8%
Taylor expanded in B around 0 86.3%
if -1.25000000000000008e259 < F < -0.320000000000000007Initial program 80.2%
Taylor expanded in F around -inf 98.0%
Taylor expanded in B around 0 72.0%
associate-*r/12.9%
neg-mul-112.9%
Simplified72.0%
if -0.320000000000000007 < F < 5.0000000000000001e-59Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.0%
Taylor expanded in x around 0 98.9%
Taylor expanded in B around 0 53.2%
if 5.0000000000000001e-59 < F Initial program 60.5%
Simplified73.4%
clear-num73.4%
inv-pow73.4%
fma-define73.4%
fma-undefine73.4%
*-commutative73.4%
fma-define73.4%
fma-define73.4%
Applied egg-rr73.4%
unpow-173.4%
Simplified73.4%
Taylor expanded in F around inf 91.6%
associate-/r*91.6%
Simplified91.6%
Taylor expanded in B around 0 71.2%
unpow271.2%
Applied egg-rr71.2%
Final simplification65.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
(if (<= F -1.25e+259)
t_0
(if (<= F -0.065)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 4.7e-152) (/ (- (* F (sqrt 0.5)) x) B) t_0)))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + (1.0 / B);
double tmp;
if (F <= -1.25e+259) {
tmp = t_0;
} else if (F <= -0.065) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 4.7e-152) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else {
tmp = 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 * ((-1.0d0) / tan(b))) + (1.0d0 / b)
if (f <= (-1.25d+259)) then
tmp = t_0
else if (f <= (-0.065d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 4.7d-152) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
double tmp;
if (F <= -1.25e+259) {
tmp = t_0;
} else if (F <= -0.065) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 4.7e-152) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (x * (-1.0 / math.tan(B))) + (1.0 / B) tmp = 0 if F <= -1.25e+259: tmp = t_0 elif F <= -0.065: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 4.7e-152: tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)) tmp = 0.0 if (F <= -1.25e+259) tmp = t_0; elseif (F <= -0.065) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 4.7e-152) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (x * (-1.0 / tan(B))) + (1.0 / B); tmp = 0.0; if (F <= -1.25e+259) tmp = t_0; elseif (F <= -0.065) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 4.7e-152) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.25e+259], t$95$0, If[LessEqual[F, -0.065], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.7e-152], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{if}\;F \leq -1.25 \cdot 10^{+259}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -0.065:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.7 \cdot 10^{-152}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if F < -1.25000000000000008e259 or 4.70000000000000012e-152 < F Initial program 65.4%
Taylor expanded in F around inf 67.6%
Taylor expanded in B around 0 70.3%
if -1.25000000000000008e259 < F < -0.065000000000000002Initial program 80.2%
Taylor expanded in F around -inf 98.0%
Taylor expanded in B around 0 72.0%
associate-*r/12.9%
neg-mul-112.9%
Simplified72.0%
if -0.065000000000000002 < F < 4.70000000000000012e-152Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.0%
Taylor expanded in x around 0 98.9%
Taylor expanded in B around 0 54.0%
Final simplification65.5%
(FPCore (F B x) :precision binary64 (if (<= F -0.12) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 8.8e-10) (/ (- (* F (sqrt 0.5)) x) B) (/ 1.0 (/ B (- 1.0 x))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.12) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 8.8e-10) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else {
tmp = 1.0 / (B / (1.0 - x));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.12d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 8.8d-10) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else
tmp = 1.0d0 / (b / (1.0d0 - x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.12) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 8.8e-10) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = 1.0 / (B / (1.0 - x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.12: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 8.8e-10: tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = 1.0 / (B / (1.0 - x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.12) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 8.8e-10) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); else tmp = Float64(1.0 / Float64(B / Float64(1.0 - x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.12) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 8.8e-10) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = 1.0 / (B / (1.0 - x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.12], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.8e-10], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[(B / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.12:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{B}{1 - x}}\\
\end{array}
\end{array}
if F < -0.12Initial program 78.6%
Taylor expanded in F around -inf 98.3%
Taylor expanded in B around 0 65.0%
associate-*r/12.5%
neg-mul-112.5%
Simplified65.0%
if -0.12 < F < 8.7999999999999996e-10Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 99.0%
Taylor expanded in x around 0 99.0%
Taylor expanded in B around 0 52.1%
if 8.7999999999999996e-10 < F Initial program 56.6%
Taylor expanded in F around inf 70.0%
Taylor expanded in B around 0 54.9%
clear-num54.9%
inv-pow54.9%
Applied egg-rr54.9%
unpow-154.9%
Simplified54.9%
Final simplification56.8%
(FPCore (F B x) :precision binary64 (if (<= F -50000.0) (/ (- -1.0 x) B) (if (<= F 8.8e-10) (/ (- (* F (sqrt 0.5)) x) B) (/ 1.0 (/ B (- 1.0 x))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -50000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.8e-10) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else {
tmp = 1.0 / (B / (1.0 - x));
}
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 <= (-50000.0d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8.8d-10) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else
tmp = 1.0d0 / (b / (1.0d0 - x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -50000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.8e-10) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = 1.0 / (B / (1.0 - x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -50000.0: tmp = (-1.0 - x) / B elif F <= 8.8e-10: tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = 1.0 / (B / (1.0 - x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -50000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.8e-10) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); else tmp = Float64(1.0 / Float64(B / Float64(1.0 - x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -50000.0) tmp = (-1.0 - x) / B; elseif (F <= 8.8e-10) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = 1.0 / (B / (1.0 - x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -50000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-10], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[(B / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -50000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{B}{1 - x}}\\
\end{array}
\end{array}
if F < -5e4Initial program 77.4%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 42.3%
mul-1-neg42.3%
distribute-neg-frac242.3%
Simplified42.3%
if -5e4 < F < 8.7999999999999996e-10Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 97.4%
Taylor expanded in x around 0 97.4%
Taylor expanded in B around 0 51.1%
if 8.7999999999999996e-10 < F Initial program 56.6%
Taylor expanded in F around inf 70.0%
Taylor expanded in B around 0 54.9%
clear-num54.9%
inv-pow54.9%
Applied egg-rr54.9%
unpow-154.9%
Simplified54.9%
Final simplification49.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.7e-56) (/ (- -1.0 x) B) (if (<= F 8.6e-102) (/ x (- B)) (/ 1.0 (/ B (- 1.0 x))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.6e-102) {
tmp = x / -B;
} else {
tmp = 1.0 / (B / (1.0 - x));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.7d-56)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8.6d-102) then
tmp = x / -b
else
tmp = 1.0d0 / (b / (1.0d0 - x))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.6e-102) {
tmp = x / -B;
} else {
tmp = 1.0 / (B / (1.0 - x));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.7e-56: tmp = (-1.0 - x) / B elif F <= 8.6e-102: tmp = x / -B else: tmp = 1.0 / (B / (1.0 - x)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.7e-56) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.6e-102) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / Float64(B / Float64(1.0 - x))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.7e-56) tmp = (-1.0 - x) / B; elseif (F <= 8.6e-102) tmp = x / -B; else tmp = 1.0 / (B / (1.0 - x)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.7e-56], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.6e-102], N[(x / (-B)), $MachinePrecision], N[(1.0 / N[(B / N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{-56}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.6 \cdot 10^{-102}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{B}{1 - x}}\\
\end{array}
\end{array}
if F < -2.69999999999999995e-56Initial program 79.6%
Taylor expanded in F around -inf 94.9%
Taylor expanded in B around 0 39.9%
mul-1-neg39.9%
distribute-neg-frac239.9%
Simplified39.9%
if -2.69999999999999995e-56 < F < 8.5999999999999995e-102Initial program 99.4%
Taylor expanded in F around inf 30.0%
Taylor expanded in B around 0 20.8%
Taylor expanded in x around inf 44.4%
neg-mul-144.4%
Simplified44.4%
if 8.5999999999999995e-102 < F Initial program 62.6%
Taylor expanded in F around inf 67.2%
Taylor expanded in B around 0 49.0%
clear-num49.0%
inv-pow49.0%
Applied egg-rr49.0%
unpow-149.0%
Simplified49.0%
Final simplification44.7%
(FPCore (F B x) :precision binary64 (if (<= F -3.3e-56) (/ (- -1.0 x) B) (if (<= F 8.6e-102) (/ x (- B)) (* (/ 1.0 B) (- 1.0 x)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.6e-102) {
tmp = x / -B;
} else {
tmp = (1.0 / B) * (1.0 - x);
}
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.3d-56)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8.6d-102) then
tmp = x / -b
else
tmp = (1.0d0 / b) * (1.0d0 - x)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.6e-102) {
tmp = x / -B;
} else {
tmp = (1.0 / B) * (1.0 - x);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.3e-56: tmp = (-1.0 - x) / B elif F <= 8.6e-102: tmp = x / -B else: tmp = (1.0 / B) * (1.0 - x) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.3e-56) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.6e-102) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 / B) * Float64(1.0 - x)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.3e-56) tmp = (-1.0 - x) / B; elseif (F <= 8.6e-102) tmp = x / -B; else tmp = (1.0 / B) * (1.0 - x); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.3e-56], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.6e-102], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.3 \cdot 10^{-56}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.6 \cdot 10^{-102}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} \cdot \left(1 - x\right)\\
\end{array}
\end{array}
if F < -3.29999999999999984e-56Initial program 79.6%
Taylor expanded in F around -inf 94.9%
Taylor expanded in B around 0 39.9%
mul-1-neg39.9%
distribute-neg-frac239.9%
Simplified39.9%
if -3.29999999999999984e-56 < F < 8.5999999999999995e-102Initial program 99.4%
Taylor expanded in F around inf 30.0%
Taylor expanded in B around 0 20.8%
Taylor expanded in x around inf 44.4%
neg-mul-144.4%
Simplified44.4%
if 8.5999999999999995e-102 < F Initial program 62.6%
Taylor expanded in F around inf 67.2%
Taylor expanded in B around 0 49.0%
div-inv49.0%
Applied egg-rr49.0%
Final simplification44.7%
(FPCore (F B x) :precision binary64 (if (<= F -3.7e-55) (/ (- -1.0 x) B) (if (<= F 8e-102) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.7e-55) {
tmp = (-1.0 - x) / B;
} else if (F <= 8e-102) {
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 <= (-3.7d-55)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8d-102) 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 <= -3.7e-55) {
tmp = (-1.0 - x) / B;
} else if (F <= 8e-102) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.7e-55: tmp = (-1.0 - x) / B elif F <= 8e-102: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.7e-55) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8e-102) 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 <= -3.7e-55) tmp = (-1.0 - x) / B; elseif (F <= 8e-102) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.7e-55], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e-102], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.7 \cdot 10^{-55}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-102}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.69999999999999985e-55Initial program 79.6%
Taylor expanded in F around -inf 94.9%
Taylor expanded in B around 0 39.9%
mul-1-neg39.9%
distribute-neg-frac239.9%
Simplified39.9%
if -3.69999999999999985e-55 < F < 7.99999999999999946e-102Initial program 99.4%
Taylor expanded in F around inf 30.0%
Taylor expanded in B around 0 20.8%
Taylor expanded in x around inf 44.4%
neg-mul-144.4%
Simplified44.4%
if 7.99999999999999946e-102 < F Initial program 62.6%
Taylor expanded in F around inf 67.2%
Taylor expanded in B around 0 49.0%
Final simplification44.6%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.4e-155) (not (<= x 7.5e-95))) (/ x (- B)) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.4e-155) || !(x <= 7.5e-95)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1.4d-155)) .or. (.not. (x <= 7.5d-95))) then
tmp = x / -b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1.4e-155) || !(x <= 7.5e-95)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1.4e-155) or not (x <= 7.5e-95): tmp = x / -B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1.4e-155) || !(x <= 7.5e-95)) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1.4e-155) || ~((x <= 7.5e-95))) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.4e-155], N[Not[LessEqual[x, 7.5e-95]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{-155} \lor \neg \left(x \leq 7.5 \cdot 10^{-95}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if x < -1.4e-155 or 7.5000000000000003e-95 < x Initial program 82.2%
Taylor expanded in F around inf 61.5%
Taylor expanded in B around 0 34.0%
Taylor expanded in x around inf 38.8%
neg-mul-138.8%
Simplified38.8%
if -1.4e-155 < x < 7.5000000000000003e-95Initial program 75.4%
Taylor expanded in F around inf 22.3%
Taylor expanded in B around 0 21.3%
Taylor expanded in x around 0 21.3%
Final simplification32.7%
(FPCore (F B x) :precision binary64 (if (<= F 8.5e-102) (/ x (- B)) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 8.5e-102) {
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 <= 8.5d-102) 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 <= 8.5e-102) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 8.5e-102: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 8.5e-102) 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 <= 8.5e-102) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 8.5e-102], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 8.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 8.49999999999999973e-102Initial program 89.7%
Taylor expanded in F around inf 36.8%
Taylor expanded in B around 0 18.6%
Taylor expanded in x around inf 30.9%
neg-mul-130.9%
Simplified30.9%
if 8.49999999999999973e-102 < F Initial program 62.6%
Taylor expanded in F around inf 67.2%
Taylor expanded in B around 0 49.0%
Final simplification37.5%
(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 79.9%
Taylor expanded in F around inf 47.8%
Taylor expanded in B around 0 29.6%
Taylor expanded in x around 0 11.8%
herbie shell --seed 2024137
(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))))))