
(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 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -100000000000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 10000000.0)
(- (* (* F t_0) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) t_1)
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -100000000000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 10000000.0) {
tmp = ((F * t_0) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_1;
} else {
tmp = t_0 - 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 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-100000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 10000000.0d0) then
tmp = ((f * t_0) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - t_1
else
tmp = t_0 - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -100000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 10000000.0) {
tmp = ((F * t_0) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_1;
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -100000000000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 10000000.0: tmp = ((F * t_0) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_1 else: tmp = t_0 - t_1 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -100000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 10000000.0) tmp = Float64(Float64(Float64(F * t_0) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - t_1); else tmp = Float64(t_0 - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -100000000000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 10000000.0) tmp = ((F * t_0) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - t_1; else tmp = t_0 - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -100000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 10000000.0], N[(N[(N[(F * t$95$0), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -100000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 10000000:\\
\;\;\;\;\left(F \cdot t\_0\right) \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -1e11Initial program 59.1%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.8%
Applied egg-rr99.8%
if -1e11 < F < 1e7Initial program 99.4%
div-inv99.5%
Applied egg-rr99.5%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
associate-/r/99.6%
Applied egg-rr99.6%
if 1e7 < F Initial program 64.0%
Taylor expanded in F around -inf 58.0%
neg-sub058.0%
associate-+l-58.0%
add-sqr-sqrt35.4%
sqrt-unprod15.5%
sqr-neg15.5%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.7%
frac-times4.7%
metadata-eval4.7%
metadata-eval4.7%
frac-times4.7%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -58000000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 120000000.0)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F (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 <= -58000000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / 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 <= (-58000000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 120000000.0d0) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / 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 <= -58000000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / 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 <= -58000000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 120000000.0: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / 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 <= -58000000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 120000000.0) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / 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 <= -58000000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 120000000.0) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / 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, -58000000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.0], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / 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 -58000000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5.8e13Initial program 58.5%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.8%
Applied egg-rr99.8%
if -5.8e13 < F < 1.2e8Initial program 99.4%
div-inv99.5%
Applied egg-rr99.5%
if 1.2e8 < F Initial program 64.0%
Taylor expanded in F around -inf 58.0%
neg-sub058.0%
associate-+l-58.0%
add-sqr-sqrt35.4%
sqrt-unprod15.5%
sqr-neg15.5%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.7%
frac-times4.7%
metadata-eval4.7%
metadata-eval4.7%
frac-times4.7%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -290000000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.65)
(- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_1)
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -290000000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.65) {
tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - 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 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-290000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.65d0) then
tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_1
else
tmp = t_0 - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -290000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.65) {
tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -290000000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.65: tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1 else: tmp = t_0 - t_1 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -290000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.65) tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_1); else tmp = Float64(t_0 - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -290000000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.65) tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1; else tmp = t_0 - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -290000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.65], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -290000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.65:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -2.9e8Initial program 59.7%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.8%
Applied egg-rr99.8%
if -2.9e8 < F < 1.6499999999999999Initial program 99.4%
Simplified99.5%
Taylor expanded in F around 0 98.5%
if 1.6499999999999999 < F Initial program 64.0%
Taylor expanded in F around -inf 58.0%
neg-sub058.0%
associate-+l-58.0%
add-sqr-sqrt35.4%
sqrt-unprod15.5%
sqr-neg15.5%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.7%
frac-times4.7%
metadata-eval4.7%
metadata-eval4.7%
frac-times4.7%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -290000000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.4)
(- (* (* F t_0) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_1)
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -290000000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.4) {
tmp = ((F * t_0) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1;
} else {
tmp = t_0 - 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 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-290000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.4d0) then
tmp = ((f * t_0) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_1
else
tmp = t_0 - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -290000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.4) {
tmp = ((F * t_0) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1;
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -290000000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.4: tmp = ((F * t_0) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1 else: tmp = t_0 - t_1 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -290000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F * t_0) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_1); else tmp = Float64(t_0 - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -290000000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.4) tmp = ((F * t_0) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_1; else tmp = t_0 - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -290000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F * t$95$0), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -290000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\left(F \cdot t\_0\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -2.9e8Initial program 59.7%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.8%
Applied egg-rr99.8%
if -2.9e8 < F < 1.3999999999999999Initial program 99.4%
div-inv99.5%
Applied egg-rr99.5%
clear-num99.6%
inv-pow99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
associate-/r/99.6%
Applied egg-rr99.6%
Taylor expanded in F around 0 98.5%
if 1.3999999999999999 < F Initial program 64.0%
Taylor expanded in F around -inf 58.0%
neg-sub058.0%
associate-+l-58.0%
add-sqr-sqrt35.4%
sqrt-unprod15.5%
sqr-neg15.5%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.7%
frac-times4.7%
metadata-eval4.7%
metadata-eval4.7%
frac-times4.7%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -290000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* (/ 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 <= -290000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
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 <= (-290000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) 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 <= -290000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
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 <= -290000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: 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 <= -290000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) 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 <= -290000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) 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, -290000000.0], 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[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 -290000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\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 < -2.9e8Initial program 59.7%
Taylor expanded in F around -inf 99.8%
+-commutative99.8%
unsub-neg99.8%
un-div-inv99.8%
Applied egg-rr99.8%
if -2.9e8 < F < 1.3999999999999999Initial program 99.4%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 98.4%
if 1.3999999999999999 < F Initial program 64.0%
Taylor expanded in F around -inf 58.0%
neg-sub058.0%
associate-+l-58.0%
add-sqr-sqrt35.4%
sqrt-unprod15.5%
sqr-neg15.5%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.7%
frac-times4.7%
metadata-eval4.7%
metadata-eval4.7%
frac-times4.7%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.000335)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 980.0)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ 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.000335) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 980.0) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (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.000335d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 980.0d0) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (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.000335) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 980.0) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (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.000335: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 980.0: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (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.000335) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 980.0) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * 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.000335) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 980.0) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (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.000335], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 980.0], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $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.000335:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 980:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.3500000000000001e-4Initial program 61.3%
Taylor expanded in F around -inf 98.6%
+-commutative98.6%
unsub-neg98.6%
un-div-inv98.6%
Applied egg-rr98.6%
if -3.3500000000000001e-4 < F < 980Initial program 99.4%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 82.0%
if 980 < F Initial program 64.0%
Taylor expanded in F around -inf 58.0%
neg-sub058.0%
associate-+l-58.0%
add-sqr-sqrt35.4%
sqrt-unprod15.5%
sqr-neg15.5%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.7%
frac-times4.7%
metadata-eval4.7%
metadata-eval4.7%
frac-times4.7%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification92.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.00033)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.11)
(- (* (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.00033) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.11) {
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.00033d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.11d0) 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.00033) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.11) {
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.00033: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.11: 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.00033) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.11) 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.00033) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.11) 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.00033], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.11], 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.00033:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.11:\\
\;\;\;\;\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.3e-4Initial program 61.3%
Taylor expanded in F around -inf 98.6%
+-commutative98.6%
unsub-neg98.6%
un-div-inv98.6%
Applied egg-rr98.6%
if -3.3e-4 < F < 0.110000000000000001Initial program 99.4%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 82.0%
Taylor expanded in F around 0 81.2%
if 0.110000000000000001 < F Initial program 64.0%
Taylor expanded in F around -inf 58.0%
neg-sub058.0%
associate-+l-58.0%
add-sqr-sqrt35.4%
sqrt-unprod15.5%
sqr-neg15.5%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.7%
frac-times4.7%
metadata-eval4.7%
metadata-eval4.7%
frac-times4.7%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification91.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.3e-26)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.3e-149)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 3.3e-73)
(/ (* 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 <= -1.3e-26) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.3e-149) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 3.3e-73) {
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 <= (-1.3d-26)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.3d-149)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 3.3d-73) 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 <= -1.3e-26) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.3e-149) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 3.3e-73) {
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 <= -1.3e-26: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.3e-149: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 3.3e-73: 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 <= -1.3e-26) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.3e-149) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 3.3e-73) 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 <= -1.3e-26) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.3e-149) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 3.3e-73) 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, -1.3e-26], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.3e-149], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.3e-73], 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 -1.3 \cdot 10^{-26}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-149}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.3 \cdot 10^{-73}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.30000000000000005e-26Initial program 64.2%
Taylor expanded in F around -inf 95.2%
+-commutative95.2%
unsub-neg95.2%
un-div-inv95.3%
Applied egg-rr95.3%
if -1.30000000000000005e-26 < F < -1.29999999999999999e-149Initial program 99.4%
div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in B around 0 83.4%
Taylor expanded in B around 0 75.4%
if -1.29999999999999999e-149 < F < 3.30000000000000004e-73Initial program 99.4%
Taylor expanded in F around inf 35.6%
Taylor expanded in B around 0 51.1%
Taylor expanded in x around inf 78.5%
mul-1-neg78.5%
Simplified78.5%
if 3.30000000000000004e-73 < F Initial program 66.6%
Taylor expanded in F around -inf 56.3%
neg-sub056.3%
associate-+l-56.3%
add-sqr-sqrt34.0%
sqrt-unprod14.6%
sqr-neg14.6%
sqrt-unprod0.4%
fma-neg0.4%
distribute-frac-neg20.4%
metadata-eval0.4%
frac-2neg0.4%
add-sqr-sqrt0.3%
sqrt-unprod4.4%
frac-times4.4%
metadata-eval4.4%
metadata-eval4.4%
frac-times4.4%
Applied egg-rr95.4%
+-commutative95.4%
associate--r+95.4%
neg-sub095.4%
distribute-neg-frac95.4%
metadata-eval95.4%
Simplified95.4%
Final simplification88.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e-25)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F -3.3e-149)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 9e-94)
(/ (* x (cos B)) (- (sin B)))
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e-25) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -3.3e-149) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 9e-94) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.35d-25)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= (-3.3d-149)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 9d-94) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e-25) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= -3.3e-149) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 9e-94) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.35e-25: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= -3.3e-149: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 9e-94: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.35e-25) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -3.3e-149) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 9e-94) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.35e-25) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= -3.3e-149) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 9e-94) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.35e-25], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.3e-149], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-94], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -3.3 \cdot 10^{-149}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-94}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.35000000000000008e-25Initial program 64.2%
Taylor expanded in F around -inf 95.2%
Taylor expanded in B around 0 78.4%
if -1.35000000000000008e-25 < F < -3.30000000000000017e-149Initial program 99.4%
div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in B around 0 83.4%
Taylor expanded in B around 0 75.4%
if -3.30000000000000017e-149 < F < 9.0000000000000004e-94Initial program 99.5%
Taylor expanded in F around inf 36.0%
Taylor expanded in B around 0 51.0%
Taylor expanded in x around inf 79.9%
mul-1-neg79.9%
Simplified79.9%
if 9.0000000000000004e-94 < F Initial program 68.1%
Taylor expanded in F around inf 72.3%
Taylor expanded in B around 0 82.1%
+-commutative82.1%
div-inv82.2%
unsub-neg82.2%
Applied egg-rr82.2%
Final simplification79.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.5e-37)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.8e-154)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 1.3e-93) (/ (* x (cos B)) (- (sin B))) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.5e-37) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.8e-154) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.3e-93) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 / 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-37)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.8d-154)) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else if (f <= 1.3d-93) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 / 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-37) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.8e-154) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.3e-93) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.5e-37: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.8e-154: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) elif F <= 1.3e-93: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.5e-37) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.8e-154) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 1.3e-93) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 / 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-37) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.8e-154) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); elseif (F <= 1.3e-93) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 / 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-37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.8e-154], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e-93], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / B), $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^{-37}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.8 \cdot 10^{-154}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-93}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -3.5000000000000001e-37Initial program 64.2%
Taylor expanded in F around -inf 95.2%
+-commutative95.2%
unsub-neg95.2%
un-div-inv95.3%
Applied egg-rr95.3%
if -3.5000000000000001e-37 < F < -1.8000000000000001e-154Initial program 99.4%
div-inv99.4%
Applied egg-rr99.4%
Taylor expanded in B around 0 83.4%
Taylor expanded in B around 0 75.4%
if -1.8000000000000001e-154 < F < 1.2999999999999999e-93Initial program 99.5%
Taylor expanded in F around inf 36.0%
Taylor expanded in B around 0 51.0%
Taylor expanded in x around inf 79.9%
mul-1-neg79.9%
Simplified79.9%
if 1.2999999999999999e-93 < F Initial program 68.1%
Taylor expanded in F around inf 72.3%
Taylor expanded in B around 0 82.1%
+-commutative82.1%
div-inv82.2%
unsub-neg82.2%
Applied egg-rr82.2%
Final simplification84.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -1.08e-29)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F -1.3e-249)
t_0
(if (<= F 1.15e-301)
(- (* (/ F B) (/ 1.0 F)) t_1)
(if (<= F 3.95e-283) t_0 (- (/ 1.0 B) t_1)))))))
double code(double F, double B, double x) {
double t_0 = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -1.08e-29) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -1.3e-249) {
tmp = t_0;
} else if (F <= 1.15e-301) {
tmp = ((F / B) * (1.0 / F)) - t_1;
} else if (F <= 3.95e-283) {
tmp = t_0;
} else {
tmp = (1.0 / B) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
t_1 = x / tan(b)
if (f <= (-1.08d-29)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= (-1.3d-249)) then
tmp = t_0
else if (f <= 1.15d-301) then
tmp = ((f / b) * (1.0d0 / f)) - t_1
else if (f <= 3.95d-283) then
tmp = t_0
else
tmp = (1.0d0 / b) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -1.08e-29) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= -1.3e-249) {
tmp = t_0;
} else if (F <= 1.15e-301) {
tmp = ((F / B) * (1.0 / F)) - t_1;
} else if (F <= 3.95e-283) {
tmp = t_0;
} else {
tmp = (1.0 / B) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -1.08e-29: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= -1.3e-249: tmp = t_0 elif F <= 1.15e-301: tmp = ((F / B) * (1.0 / F)) - t_1 elif F <= 3.95e-283: tmp = t_0 else: tmp = (1.0 / B) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.08e-29) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -1.3e-249) tmp = t_0; elseif (F <= 1.15e-301) tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_1); elseif (F <= 3.95e-283) tmp = t_0; else tmp = Float64(Float64(1.0 / B) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -1.08e-29) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= -1.3e-249) tmp = t_0; elseif (F <= 1.15e-301) tmp = ((F / B) * (1.0 / F)) - t_1; elseif (F <= 3.95e-283) tmp = t_0; else tmp = (1.0 / B) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.08e-29], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-249], t$95$0, If[LessEqual[F, 1.15e-301], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 3.95e-283], t$95$0, N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.08 \cdot 10^{-29}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-249}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-301}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t\_1\\
\mathbf{elif}\;F \leq 3.95 \cdot 10^{-283}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_1\\
\end{array}
\end{array}
if F < -1.07999999999999995e-29Initial program 64.2%
Taylor expanded in F around -inf 95.2%
Taylor expanded in B around 0 78.4%
if -1.07999999999999995e-29 < F < -1.29999999999999988e-249 or 1.1500000000000001e-301 < F < 3.9500000000000002e-283Initial program 99.4%
div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 87.1%
Taylor expanded in B around 0 70.8%
if -1.29999999999999988e-249 < F < 1.1500000000000001e-301Initial program 99.5%
div-inv99.7%
Applied egg-rr99.7%
Taylor expanded in B around 0 99.7%
Taylor expanded in F around inf 80.3%
if 3.9500000000000002e-283 < F Initial program 77.5%
Taylor expanded in F around inf 63.0%
Taylor expanded in B around 0 73.9%
+-commutative73.9%
div-inv74.0%
unsub-neg74.0%
Applied egg-rr74.0%
Final simplification75.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8.2e-110)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F -1.6e-246)
(/ x (- B))
(if (<= F 115000000000.0)
(- (* (/ F B) (/ 1.0 F)) t_0)
(if (<= F 9.2e+40) (- (/ 1.0 (sin B)) (/ x B)) (- (/ 1.0 B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8.2e-110) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -1.6e-246) {
tmp = x / -B;
} else if (F <= 115000000000.0) {
tmp = ((F / B) * (1.0 / F)) - t_0;
} else if (F <= 9.2e+40) {
tmp = (1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / 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 <= (-8.2d-110)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= (-1.6d-246)) then
tmp = x / -b
else if (f <= 115000000000.0d0) then
tmp = ((f / b) * (1.0d0 / f)) - t_0
else if (f <= 9.2d+40) then
tmp = (1.0d0 / sin(b)) - (x / b)
else
tmp = (1.0d0 / 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 <= -8.2e-110) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= -1.6e-246) {
tmp = x / -B;
} else if (F <= 115000000000.0) {
tmp = ((F / B) * (1.0 / F)) - t_0;
} else if (F <= 9.2e+40) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -8.2e-110: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= -1.6e-246: tmp = x / -B elif F <= 115000000000.0: tmp = ((F / B) * (1.0 / F)) - t_0 elif F <= 9.2e+40: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8.2e-110) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -1.6e-246) tmp = Float64(x / Float64(-B)); elseif (F <= 115000000000.0) tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - t_0); elseif (F <= 9.2e+40) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -8.2e-110) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= -1.6e-246) tmp = x / -B; elseif (F <= 115000000000.0) tmp = ((F / B) * (1.0 / F)) - t_0; elseif (F <= 9.2e+40) tmp = (1.0 / sin(B)) - (x / B); else tmp = (1.0 / 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, -8.2e-110], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.6e-246], N[(x / (-B)), $MachinePrecision], If[LessEqual[F, 115000000000.0], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9.2e+40], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8.2 \cdot 10^{-110}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -1.6 \cdot 10^{-246}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{elif}\;F \leq 115000000000:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - t\_0\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{+40}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -8.19999999999999965e-110Initial program 70.6%
Taylor expanded in F around -inf 84.3%
Taylor expanded in B around 0 70.3%
if -8.19999999999999965e-110 < F < -1.6e-246Initial program 99.3%
Taylor expanded in F around -inf 28.6%
Taylor expanded in B around 0 20.2%
mul-1-neg20.2%
distribute-neg-frac220.2%
Simplified20.2%
Taylor expanded in x around inf 51.6%
associate-*r/51.6%
neg-mul-151.6%
Simplified51.6%
if -1.6e-246 < F < 1.15e11Initial program 99.4%
div-inv99.6%
Applied egg-rr99.6%
Taylor expanded in B around 0 81.4%
Taylor expanded in F around inf 59.3%
if 1.15e11 < F < 9.19999999999999975e40Initial program 99.8%
Taylor expanded in F around -inf 23.0%
neg-sub023.0%
associate-+l-23.0%
add-sqr-sqrt22.3%
sqrt-unprod23.5%
sqr-neg23.5%
sqrt-unprod0.7%
fma-neg0.7%
distribute-frac-neg20.7%
metadata-eval0.7%
frac-2neg0.7%
add-sqr-sqrt0.7%
sqrt-unprod1.2%
frac-times1.2%
metadata-eval1.2%
metadata-eval1.2%
frac-times1.2%
Applied egg-rr99.8%
+-commutative99.8%
associate--r+99.8%
neg-sub099.8%
distribute-neg-frac99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in B around 0 89.5%
if 9.19999999999999975e40 < F Initial program 57.9%
Taylor expanded in F around inf 73.3%
Taylor expanded in B around 0 90.7%
+-commutative90.7%
div-inv90.9%
unsub-neg90.9%
Applied egg-rr90.9%
Final simplification71.9%
(FPCore (F B x)
:precision binary64
(if (<= F -290000000.0)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F -7.8e-95) (not (<= F -1.25e-247)))
(- (/ 1.0 B) (/ x (tan B)))
(/ x (- B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -290000000.0) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= -7.8e-95) || !(F <= -1.25e-247)) {
tmp = (1.0 / B) - (x / tan(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 <= (-290000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= (-7.8d-95)) .or. (.not. (f <= (-1.25d-247)))) then
tmp = (1.0d0 / b) - (x / tan(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 <= -290000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= -7.8e-95) || !(F <= -1.25e-247)) {
tmp = (1.0 / B) - (x / Math.tan(B));
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -290000000.0: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= -7.8e-95) or not (F <= -1.25e-247): tmp = (1.0 / B) - (x / math.tan(B)) else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -290000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= -7.8e-95) || !(F <= -1.25e-247)) tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -290000000.0) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= -7.8e-95) || ~((F <= -1.25e-247))) tmp = (1.0 / B) - (x / tan(B)); else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -290000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, -7.8e-95], N[Not[LessEqual[F, -1.25e-247]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -290000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.8 \cdot 10^{-95} \lor \neg \left(F \leq -1.25 \cdot 10^{-247}\right):\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -2.9e8Initial program 59.7%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 69.1%
if -2.9e8 < F < -7.8e-95 or -1.24999999999999994e-247 < F Initial program 83.1%
Taylor expanded in F around inf 56.1%
Taylor expanded in B around 0 67.6%
+-commutative67.6%
div-inv67.7%
unsub-neg67.7%
Applied egg-rr67.7%
if -7.8e-95 < F < -1.24999999999999994e-247Initial program 99.3%
Taylor expanded in F around -inf 26.5%
Taylor expanded in B around 0 18.9%
mul-1-neg18.9%
distribute-neg-frac218.9%
Simplified18.9%
Taylor expanded in x around inf 47.1%
associate-*r/47.1%
neg-mul-147.1%
Simplified47.1%
Final simplification66.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ 1.0 B) (/ x (tan B)))))
(if (<= x -5.4e-108)
t_0
(if (<= x 3.5e-249)
(+ (/ -1.0 (sin B)) (/ x B))
(if (<= x 2.9e-67) (- (/ 1.0 (sin B)) (/ x B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (1.0 / B) - (x / tan(B));
double tmp;
if (x <= -5.4e-108) {
tmp = t_0;
} else if (x <= 3.5e-249) {
tmp = (-1.0 / sin(B)) + (x / B);
} else if (x <= 2.9e-67) {
tmp = (1.0 / sin(B)) - (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 = (1.0d0 / b) - (x / tan(b))
if (x <= (-5.4d-108)) then
tmp = t_0
else if (x <= 3.5d-249) then
tmp = ((-1.0d0) / sin(b)) + (x / b)
else if (x <= 2.9d-67) then
tmp = (1.0d0 / sin(b)) - (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 = (1.0 / B) - (x / Math.tan(B));
double tmp;
if (x <= -5.4e-108) {
tmp = t_0;
} else if (x <= 3.5e-249) {
tmp = (-1.0 / Math.sin(B)) + (x / B);
} else if (x <= 2.9e-67) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (1.0 / B) - (x / math.tan(B)) tmp = 0 if x <= -5.4e-108: tmp = t_0 elif x <= 3.5e-249: tmp = (-1.0 / math.sin(B)) + (x / B) elif x <= 2.9e-67: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (x <= -5.4e-108) tmp = t_0; elseif (x <= 3.5e-249) tmp = Float64(Float64(-1.0 / sin(B)) + Float64(x / B)); elseif (x <= 2.9e-67) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (1.0 / B) - (x / tan(B)); tmp = 0.0; if (x <= -5.4e-108) tmp = t_0; elseif (x <= 3.5e-249) tmp = (-1.0 / sin(B)) + (x / B); elseif (x <= 2.9e-67) tmp = (1.0 / sin(B)) - (x / B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.4e-108], t$95$0, If[LessEqual[x, 3.5e-249], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e-67], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -5.4 \cdot 10^{-108}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-249}:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{x}{B}\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-67}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5.4000000000000001e-108 or 2.90000000000000005e-67 < x Initial program 84.6%
Taylor expanded in F around inf 72.8%
Taylor expanded in B around 0 86.7%
+-commutative86.7%
div-inv86.8%
unsub-neg86.8%
Applied egg-rr86.8%
if -5.4000000000000001e-108 < x < 3.50000000000000013e-249Initial program 71.8%
Taylor expanded in F around -inf 32.5%
add-sqr-sqrt18.1%
sqrt-unprod26.2%
frac-times26.2%
metadata-eval26.2%
metadata-eval26.2%
frac-times26.2%
sqrt-unprod11.2%
*-un-lft-identity11.2%
add-sqr-sqrt13.9%
metadata-eval13.9%
cancel-sign-sub-inv13.9%
div-inv13.9%
*-un-lft-identity13.9%
sub-neg13.9%
Applied egg-rr32.5%
*-lft-identity32.5%
+-commutative32.5%
Simplified32.5%
Taylor expanded in B around 0 32.5%
if 3.50000000000000013e-249 < x < 2.90000000000000005e-67Initial program 65.0%
Taylor expanded in F around -inf 22.2%
neg-sub022.2%
associate-+l-22.2%
add-sqr-sqrt12.0%
sqrt-unprod22.2%
sqr-neg22.2%
sqrt-unprod10.2%
fma-neg10.2%
distribute-frac-neg210.2%
metadata-eval10.2%
frac-2neg10.2%
add-sqr-sqrt7.0%
sqrt-unprod14.5%
frac-times14.4%
metadata-eval14.4%
metadata-eval14.4%
frac-times14.5%
Applied egg-rr39.0%
+-commutative39.0%
associate--r+39.0%
neg-sub039.0%
distribute-neg-frac39.0%
metadata-eval39.0%
Simplified39.0%
Taylor expanded in B around 0 39.0%
Final simplification65.7%
(FPCore (F B x) :precision binary64 (if (<= B 1.08e-249) (/ (- 1.0 x) B) (if (<= B 1.18e-85) (/ (- -1.0 x) B) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.08e-249) {
tmp = (1.0 - x) / B;
} else if (B <= 1.18e-85) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 1.08d-249) then
tmp = (1.0d0 - x) / b
else if (b <= 1.18d-85) then
tmp = ((-1.0d0) - x) / b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 1.08e-249) {
tmp = (1.0 - x) / B;
} else if (B <= 1.18e-85) {
tmp = (-1.0 - x) / B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 1.08e-249: tmp = (1.0 - x) / B elif B <= 1.18e-85: tmp = (-1.0 - x) / B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 1.08e-249) tmp = Float64(Float64(1.0 - x) / B); elseif (B <= 1.18e-85) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 1.08e-249) tmp = (1.0 - x) / B; elseif (B <= 1.18e-85) tmp = (-1.0 - x) / B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 1.08e-249], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 1.18e-85], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.08 \cdot 10^{-249}:\\
\;\;\;\;\frac{1 - x}{B}\\
\mathbf{elif}\;B \leq 1.18 \cdot 10^{-85}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 1.08000000000000001e-249Initial program 80.4%
Taylor expanded in F around inf 51.6%
Taylor expanded in B around 0 59.8%
Taylor expanded in B around 0 29.8%
if 1.08000000000000001e-249 < B < 1.18e-85Initial program 47.0%
Taylor expanded in F around -inf 67.8%
Taylor expanded in B around 0 67.8%
mul-1-neg67.8%
distribute-neg-frac267.8%
Simplified67.8%
Taylor expanded in B around 0 67.8%
associate-*r/67.8%
+-commutative67.8%
neg-mul-167.8%
neg-sub067.8%
+-commutative67.8%
associate--r+67.8%
metadata-eval67.8%
Simplified67.8%
if 1.18e-85 < B Initial program 85.9%
Taylor expanded in F around inf 57.0%
Taylor expanded in B around 0 60.2%
+-commutative60.2%
div-inv60.3%
unsub-neg60.3%
Applied egg-rr60.3%
Final simplification43.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.78e-109) (+ (* x (/ -1.0 (tan B))) (/ -1.0 B)) (if (<= F -4e-247) (/ x (- B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.78e-109) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -4e-247) {
tmp = x / -B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.78d-109)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= (-4d-247)) then
tmp = x / -b
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.78e-109) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= -4e-247) {
tmp = x / -B;
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.78e-109: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= -4e-247: tmp = x / -B else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.78e-109) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -4e-247) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.78e-109) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= -4e-247) tmp = x / -B; else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.78e-109], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4e-247], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.78 \cdot 10^{-109}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -4 \cdot 10^{-247}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.78e-109Initial program 70.6%
Taylor expanded in F around -inf 84.3%
Taylor expanded in B around 0 70.3%
if -1.78e-109 < F < -4.0000000000000001e-247Initial program 99.3%
Taylor expanded in F around -inf 28.6%
Taylor expanded in B around 0 20.2%
mul-1-neg20.2%
distribute-neg-frac220.2%
Simplified20.2%
Taylor expanded in x around inf 51.6%
associate-*r/51.6%
neg-mul-151.6%
Simplified51.6%
if -4.0000000000000001e-247 < F Initial program 80.3%
Taylor expanded in F around inf 58.5%
Taylor expanded in B around 0 71.7%
+-commutative71.7%
div-inv71.8%
unsub-neg71.8%
Applied egg-rr71.8%
Final simplification69.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.7e+252)
(+ (/ -1.0 (sin B)) (/ x B))
(if (<= F -1.9e-105)
(/ (- -1.0 x) B)
(if (<= F 6.4e-96) (/ x (- B)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e+252) {
tmp = (-1.0 / sin(B)) + (x / B);
} else if (F <= -1.9e-105) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.4e-96) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.7d+252)) then
tmp = ((-1.0d0) / sin(b)) + (x / b)
else if (f <= (-1.9d-105)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 6.4d-96) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e+252) {
tmp = (-1.0 / Math.sin(B)) + (x / B);
} else if (F <= -1.9e-105) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.4e-96) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.7e+252: tmp = (-1.0 / math.sin(B)) + (x / B) elif F <= -1.9e-105: tmp = (-1.0 - x) / B elif F <= 6.4e-96: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.7e+252) tmp = Float64(Float64(-1.0 / sin(B)) + Float64(x / B)); elseif (F <= -1.9e-105) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 6.4e-96) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.7e+252) tmp = (-1.0 / sin(B)) + (x / B); elseif (F <= -1.9e-105) tmp = (-1.0 - x) / B; elseif (F <= 6.4e-96) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.7e+252], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.9e-105], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.4e-96], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{+252}:\\
\;\;\;\;\frac{-1}{\sin B} + \frac{x}{B}\\
\mathbf{elif}\;F \leq -1.9 \cdot 10^{-105}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 6.4 \cdot 10^{-96}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.7000000000000001e252Initial program 22.8%
Taylor expanded in F around -inf 100.0%
add-sqr-sqrt28.3%
sqrt-unprod36.9%
frac-times36.9%
metadata-eval36.9%
metadata-eval36.9%
frac-times36.9%
sqrt-unprod15.0%
*-un-lft-identity15.0%
add-sqr-sqrt29.5%
metadata-eval29.5%
cancel-sign-sub-inv29.5%
div-inv29.5%
*-un-lft-identity29.5%
sub-neg29.5%
Applied egg-rr67.6%
*-lft-identity67.6%
+-commutative67.6%
Simplified67.6%
Taylor expanded in B around 0 68.3%
if -2.7000000000000001e252 < F < -1.8999999999999999e-105Initial program 78.8%
Taylor expanded in F around -inf 81.6%
Taylor expanded in B around 0 42.3%
mul-1-neg42.3%
distribute-neg-frac242.3%
Simplified42.3%
Taylor expanded in B around 0 42.3%
associate-*r/42.3%
+-commutative42.3%
neg-mul-142.3%
neg-sub042.3%
+-commutative42.3%
associate--r+42.3%
metadata-eval42.3%
Simplified42.3%
if -1.8999999999999999e-105 < F < 6.40000000000000023e-96Initial program 99.4%
Taylor expanded in F around -inf 34.0%
Taylor expanded in B around 0 20.5%
mul-1-neg20.5%
distribute-neg-frac220.5%
Simplified20.5%
Taylor expanded in x around inf 40.0%
associate-*r/40.0%
neg-mul-140.0%
Simplified40.0%
if 6.40000000000000023e-96 < F Initial program 68.1%
Taylor expanded in F around inf 72.3%
Taylor expanded in B around 0 82.1%
Taylor expanded in B around 0 49.1%
Final simplification45.3%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e-105) (/ (- -1.0 x) B) (if (or (<= F 2.45e-34) (not (<= F 6.5e+144))) (/ x (- B)) (/ 1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-105) {
tmp = (-1.0 - x) / B;
} else if ((F <= 2.45e-34) || !(F <= 6.5e+144)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.1d-105)) then
tmp = ((-1.0d0) - x) / b
else if ((f <= 2.45d-34) .or. (.not. (f <= 6.5d+144))) then
tmp = x / -b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-105) {
tmp = (-1.0 - x) / B;
} else if ((F <= 2.45e-34) || !(F <= 6.5e+144)) {
tmp = x / -B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-105: tmp = (-1.0 - x) / B elif (F <= 2.45e-34) or not (F <= 6.5e+144): tmp = x / -B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-105) tmp = Float64(Float64(-1.0 - x) / B); elseif ((F <= 2.45e-34) || !(F <= 6.5e+144)) tmp = Float64(x / Float64(-B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.1e-105) tmp = (-1.0 - x) / B; elseif ((F <= 2.45e-34) || ~((F <= 6.5e+144))) tmp = x / -B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-105], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 2.45e-34], N[Not[LessEqual[F, 6.5e+144]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-105}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.45 \cdot 10^{-34} \lor \neg \left(F \leq 6.5 \cdot 10^{+144}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < -2.1e-105Initial program 70.6%
Taylor expanded in F around -inf 84.3%
Taylor expanded in B around 0 41.6%
mul-1-neg41.6%
distribute-neg-frac241.6%
Simplified41.6%
Taylor expanded in B around 0 41.6%
associate-*r/41.6%
+-commutative41.6%
neg-mul-141.6%
neg-sub041.6%
+-commutative41.6%
associate--r+41.6%
metadata-eval41.6%
Simplified41.6%
if -2.1e-105 < F < 2.44999999999999981e-34 or 6.50000000000000007e144 < F Initial program 81.5%
Taylor expanded in F around -inf 44.5%
Taylor expanded in B around 0 24.9%
mul-1-neg24.9%
distribute-neg-frac224.9%
Simplified24.9%
Taylor expanded in x around inf 36.8%
associate-*r/36.8%
neg-mul-136.8%
Simplified36.8%
if 2.44999999999999981e-34 < F < 6.50000000000000007e144Initial program 86.8%
Taylor expanded in F around inf 84.5%
Taylor expanded in B around 0 78.7%
Taylor expanded in x around 0 32.1%
Final simplification37.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (- B))))
(if (<= x -4.3e-122)
t_0
(if (<= x 1.25e-232) (/ -1.0 B) (if (<= x 5.8e-124) (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (x <= -4.3e-122) {
tmp = t_0;
} else if (x <= 1.25e-232) {
tmp = -1.0 / B;
} else if (x <= 5.8e-124) {
tmp = 1.0 / 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 / -b
if (x <= (-4.3d-122)) then
tmp = t_0
else if (x <= 1.25d-232) then
tmp = (-1.0d0) / b
else if (x <= 5.8d-124) then
tmp = 1.0d0 / 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 / -B;
double tmp;
if (x <= -4.3e-122) {
tmp = t_0;
} else if (x <= 1.25e-232) {
tmp = -1.0 / B;
} else if (x <= 5.8e-124) {
tmp = 1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / -B tmp = 0 if x <= -4.3e-122: tmp = t_0 elif x <= 1.25e-232: tmp = -1.0 / B elif x <= 5.8e-124: tmp = 1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(x / Float64(-B)) tmp = 0.0 if (x <= -4.3e-122) tmp = t_0; elseif (x <= 1.25e-232) tmp = Float64(-1.0 / B); elseif (x <= 5.8e-124) tmp = Float64(1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / -B; tmp = 0.0; if (x <= -4.3e-122) tmp = t_0; elseif (x <= 1.25e-232) tmp = -1.0 / B; elseif (x <= 5.8e-124) tmp = 1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / (-B)), $MachinePrecision]}, If[LessEqual[x, -4.3e-122], t$95$0, If[LessEqual[x, 1.25e-232], N[(-1.0 / B), $MachinePrecision], If[LessEqual[x, 5.8e-124], N[(1.0 / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-B}\\
\mathbf{if}\;x \leq -4.3 \cdot 10^{-122}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-232}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-124}:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.30000000000000019e-122 or 5.8000000000000004e-124 < x Initial program 83.9%
Taylor expanded in F around -inf 78.8%
Taylor expanded in B around 0 36.2%
mul-1-neg36.2%
distribute-neg-frac236.2%
Simplified36.2%
Taylor expanded in x around inf 37.6%
associate-*r/37.6%
neg-mul-137.6%
Simplified37.6%
if -4.30000000000000019e-122 < x < 1.25e-232Initial program 71.1%
Taylor expanded in F around -inf 31.5%
Taylor expanded in B around 0 22.6%
mul-1-neg22.6%
distribute-neg-frac222.6%
Simplified22.6%
Taylor expanded in x around 0 22.6%
if 1.25e-232 < x < 5.8000000000000004e-124Initial program 62.1%
Taylor expanded in F around inf 21.9%
Taylor expanded in B around 0 31.4%
Taylor expanded in x around 0 28.5%
Final simplification32.9%
(FPCore (F B x) :precision binary64 (if (<= F -2.15e-105) (/ (- -1.0 x) B) (if (<= F 3e-98) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.15e-105) {
tmp = (-1.0 - x) / B;
} else if (F <= 3e-98) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.15d-105)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3d-98) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.15e-105) {
tmp = (-1.0 - x) / B;
} else if (F <= 3e-98) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.15e-105: tmp = (-1.0 - x) / B elif F <= 3e-98: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.15e-105) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3e-98) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.15e-105) tmp = (-1.0 - x) / B; elseif (F <= 3e-98) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.15e-105], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3e-98], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.15 \cdot 10^{-105}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-98}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.14999999999999982e-105Initial program 70.6%
Taylor expanded in F around -inf 84.3%
Taylor expanded in B around 0 41.6%
mul-1-neg41.6%
distribute-neg-frac241.6%
Simplified41.6%
Taylor expanded in B around 0 41.6%
associate-*r/41.6%
+-commutative41.6%
neg-mul-141.6%
neg-sub041.6%
+-commutative41.6%
associate--r+41.6%
metadata-eval41.6%
Simplified41.6%
if -2.14999999999999982e-105 < F < 3e-98Initial program 99.4%
Taylor expanded in F around -inf 34.0%
Taylor expanded in B around 0 20.5%
mul-1-neg20.5%
distribute-neg-frac220.5%
Simplified20.5%
Taylor expanded in x around inf 40.0%
associate-*r/40.0%
neg-mul-140.0%
Simplified40.0%
if 3e-98 < F Initial program 68.1%
Taylor expanded in F around inf 72.3%
Taylor expanded in B around 0 82.1%
Taylor expanded in B around 0 49.1%
Final simplification43.6%
(FPCore (F B x) :precision binary64 (if (<= F 1.5e-98) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.5e-98) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1.5d-98) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1.5e-98) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.5e-98: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.5e-98) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1.5e-98) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.5e-98], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.5 \cdot 10^{-98}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 1.5e-98Initial program 83.3%
Taylor expanded in F around -inf 62.1%
Taylor expanded in B around 0 32.3%
mul-1-neg32.3%
distribute-neg-frac232.3%
Simplified32.3%
Taylor expanded in x around 0 16.0%
if 1.5e-98 < F Initial program 68.1%
Taylor expanded in F around inf 72.3%
Taylor expanded in B around 0 82.1%
Taylor expanded in x around 0 27.4%
Final simplification19.8%
(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 59.7%
Taylor expanded in B around 0 29.3%
mul-1-neg29.3%
distribute-neg-frac229.3%
Simplified29.3%
Taylor expanded in x around 0 11.4%
Final simplification11.4%
herbie shell --seed 2024054
(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))))))