
(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 18 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 -8e+43)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 120000000.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 <= -8e+43) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 120000000.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 <= (-8d+43)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 120000000.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 <= -8e+43) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 120000000.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 <= -8e+43: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 120000000.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 <= -8e+43) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 120000000.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 <= -8e+43) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 120000000.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, -8e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.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 -8 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;\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 < -8.00000000000000011e43Initial program 57.9%
Simplified73.5%
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 99.9%
if -8.00000000000000011e43 < F < 1.2e8Initial program 99.5%
div-inv99.7%
clear-num99.6%
Applied egg-rr99.6%
metadata-eval99.6%
metadata-eval99.6%
Applied egg-rr99.6%
clear-num99.7%
add-sqr-sqrt50.9%
sqrt-unprod56.9%
sqr-neg56.9%
div-inv56.8%
tan-quot56.8%
clear-num56.8%
div-inv56.8%
tan-quot56.8%
clear-num56.8%
sqrt-unprod16.9%
add-sqr-sqrt33.7%
clear-num33.7%
tan-quot33.7%
div-inv33.7%
neg-sub033.7%
sub-neg33.7%
Applied egg-rr99.7%
+-lft-identity99.7%
Simplified99.7%
if 1.2e8 < F Initial program 68.2%
Simplified82.6%
clear-num82.6%
inv-pow82.6%
fma-define82.6%
fma-undefine82.6%
*-commutative82.6%
fma-define82.6%
fma-define82.6%
Applied egg-rr82.6%
unpow-182.6%
Simplified82.6%
Taylor expanded in F around inf 99.8%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.45)
(- (/ (* 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.45) {
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.45d0) 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.45) {
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.45: 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.45) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.45) 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.45], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 61.6%
Simplified75.8%
clear-num75.7%
inv-pow75.7%
fma-define75.7%
fma-undefine75.7%
*-commutative75.7%
fma-define75.7%
fma-define75.7%
Applied egg-rr75.7%
unpow-175.7%
Simplified75.7%
Taylor expanded in F around -inf 99.6%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.1%
Taylor expanded in x around 0 99.2%
if 1.44999999999999996 < F Initial program 69.0%
Simplified83.1%
clear-num83.1%
inv-pow83.1%
fma-define83.1%
fma-undefine83.1%
*-commutative83.1%
fma-define83.1%
fma-define83.1%
Applied egg-rr83.1%
unpow-183.1%
Simplified83.1%
Taylor expanded in F around inf 99.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.5e-11)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.6e-103)
(- (* (* F (/ 1.0 B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(if (<= F 6.2e-6)
(- (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.5e-11) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.6e-103) {
tmp = ((F * (1.0 / B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else if (F <= 6.2e-6) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-3.5d-11)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.6d-103) then
tmp = ((f * (1.0d0 / b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else if (f <= 6.2d-6) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -3.5e-11) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.6e-103) {
tmp = ((F * (1.0 / B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else if (F <= 6.2e-6) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.5e-11: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.6e-103: tmp = ((F * (1.0 / B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 elif F <= 6.2e-6: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.5e-11) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.6e-103) tmp = Float64(Float64(Float64(F * Float64(1.0 / B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0); elseif (F <= 6.2e-6) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3.5e-11) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.6e-103) tmp = ((F * (1.0 / B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; elseif (F <= 6.2e-6) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.5e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.6e-103], N[(N[(N[(F * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.2e-6], 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] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-103}:\\
\;\;\;\;\left(F \cdot \frac{1}{B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.50000000000000019e-11Initial program 62.2%
Simplified76.2%
clear-num76.1%
inv-pow76.1%
fma-define76.1%
fma-undefine76.1%
*-commutative76.1%
fma-define76.1%
fma-define76.1%
Applied egg-rr76.1%
unpow-176.1%
Simplified76.1%
Taylor expanded in F around -inf 98.3%
if -3.50000000000000019e-11 < F < 1.59999999999999988e-103Initial program 99.5%
Simplified99.8%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 90.4%
div-inv90.4%
Applied egg-rr90.4%
if 1.59999999999999988e-103 < F < 6.1999999999999999e-6Initial program 99.7%
div-inv99.7%
clear-num99.7%
Applied egg-rr99.7%
metadata-eval99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in B around 0 98.6%
if 6.1999999999999999e-6 < F Initial program 70.1%
Simplified83.7%
clear-num83.7%
inv-pow83.7%
fma-define83.7%
fma-undefine83.7%
*-commutative83.7%
fma-define83.7%
fma-define83.7%
Applied egg-rr83.7%
unpow-183.7%
Simplified83.7%
Taylor expanded in F around inf 98.1%
Final simplification95.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (/ (sqrt 0.5) (sin B)))) (t_1 (/ x (tan B))))
(if (<= F -0.00048)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1.25e-47)
t_0
(if (<= F 5.8e-101)
(/ x (- (tan B)))
(if (<= F 6.2e-6) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = F * (sqrt(0.5) / sin(B));
double t_1 = x / tan(B);
double tmp;
if (F <= -0.00048) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1.25e-47) {
tmp = t_0;
} else if (F <= 5.8e-101) {
tmp = x / -tan(B);
} else if (F <= 6.2e-6) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = f * (sqrt(0.5d0) / sin(b))
t_1 = x / tan(b)
if (f <= (-0.00048d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1.25d-47)) then
tmp = t_0
else if (f <= 5.8d-101) then
tmp = x / -tan(b)
else if (f <= 6.2d-6) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F * (Math.sqrt(0.5) / Math.sin(B));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.00048) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1.25e-47) {
tmp = t_0;
} else if (F <= 5.8e-101) {
tmp = x / -Math.tan(B);
} else if (F <= 6.2e-6) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = F * (math.sqrt(0.5) / math.sin(B)) t_1 = x / math.tan(B) tmp = 0 if F <= -0.00048: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1.25e-47: tmp = t_0 elif F <= 5.8e-101: tmp = x / -math.tan(B) elif F <= 6.2e-6: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(F * Float64(sqrt(0.5) / sin(B))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.00048) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1.25e-47) tmp = t_0; elseif (F <= 5.8e-101) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 6.2e-6) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F * (sqrt(0.5) / sin(B)); t_1 = x / tan(B); tmp = 0.0; if (F <= -0.00048) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1.25e-47) tmp = t_0; elseif (F <= 5.8e-101) tmp = x / -tan(B); elseif (F <= 6.2e-6) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00048], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.25e-47], t$95$0, If[LessEqual[F, 5.8e-101], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 6.2e-6], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \frac{\sqrt{0.5}}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.00048:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -1.25 \cdot 10^{-47}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -4.80000000000000012e-4Initial program 61.6%
Simplified75.8%
clear-num75.7%
inv-pow75.7%
fma-define75.7%
fma-undefine75.7%
*-commutative75.7%
fma-define75.7%
fma-define75.7%
Applied egg-rr75.7%
unpow-175.7%
Simplified75.7%
Taylor expanded in F around -inf 99.6%
if -4.80000000000000012e-4 < F < -1.25000000000000003e-47 or 5.800000000000001e-101 < F < 6.1999999999999999e-6Initial program 99.4%
Simplified99.3%
Taylor expanded in F around 0 99.0%
Taylor expanded in x around 0 99.3%
Taylor expanded in F around inf 89.9%
associate-*r/89.9%
Simplified89.9%
if -1.25000000000000003e-47 < F < 5.800000000000001e-101Initial program 99.6%
Taylor expanded in F around -inf 35.9%
Taylor expanded in x around inf 82.9%
mul-1-neg82.9%
associate-/l*82.9%
Simplified82.9%
*-un-lft-identity82.9%
clear-num82.8%
tan-quot82.9%
Applied egg-rr82.9%
*-lft-identity82.9%
Simplified82.9%
div-inv83.1%
add-sqr-sqrt43.6%
sqrt-unprod29.1%
sqr-neg29.1%
div-inv29.0%
div-inv29.0%
sqrt-unprod0.8%
add-sqr-sqrt1.9%
div-inv1.9%
neg-sub01.9%
sub-neg1.9%
div-inv1.9%
add-sqr-sqrt0.8%
sqrt-unprod29.0%
div-inv29.0%
div-inv29.1%
sqr-neg29.1%
Applied egg-rr83.1%
+-lft-identity83.1%
Simplified83.1%
if 6.1999999999999999e-6 < F Initial program 70.1%
Simplified83.7%
clear-num83.7%
inv-pow83.7%
fma-define83.7%
fma-undefine83.7%
*-commutative83.7%
fma-define83.7%
fma-define83.7%
Applied egg-rr83.7%
unpow-183.7%
Simplified83.7%
Taylor expanded in F around inf 98.1%
Final simplification92.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.5e-11)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3e-100)
(- (* (* F (/ 1.0 B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(if (<= F 2.9e-7)
(* F (/ (sqrt 0.5) (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 <= -3.5e-11) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3e-100) {
tmp = ((F * (1.0 / B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else if (F <= 2.9e-7) {
tmp = F * (sqrt(0.5) / 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 <= (-3.5d-11)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3d-100) then
tmp = ((f * (1.0d0 / b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else if (f <= 2.9d-7) then
tmp = f * (sqrt(0.5d0) / 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 <= -3.5e-11) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3e-100) {
tmp = ((F * (1.0 / B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else if (F <= 2.9e-7) {
tmp = F * (Math.sqrt(0.5) / 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 <= -3.5e-11: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3e-100: tmp = ((F * (1.0 / B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 elif F <= 2.9e-7: tmp = F * (math.sqrt(0.5) / 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 <= -3.5e-11) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3e-100) tmp = Float64(Float64(Float64(F * Float64(1.0 / B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0); elseif (F <= 2.9e-7) tmp = Float64(F * Float64(sqrt(0.5) / 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 <= -3.5e-11) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3e-100) tmp = ((F * (1.0 / B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; elseif (F <= 2.9e-7) tmp = F * (sqrt(0.5) / 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, -3.5e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3e-100], N[(N[(N[(F * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.9e-7], N[(F * N[(N[Sqrt[0.5], $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 -3.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-100}:\\
\;\;\;\;\left(F \cdot \frac{1}{B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t\_0\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-7}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.50000000000000019e-11Initial program 62.2%
Simplified76.2%
clear-num76.1%
inv-pow76.1%
fma-define76.1%
fma-undefine76.1%
*-commutative76.1%
fma-define76.1%
fma-define76.1%
Applied egg-rr76.1%
unpow-176.1%
Simplified76.1%
Taylor expanded in F around -inf 98.3%
if -3.50000000000000019e-11 < F < 3.0000000000000001e-100Initial program 99.5%
Simplified99.8%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 90.6%
div-inv90.7%
Applied egg-rr90.7%
if 3.0000000000000001e-100 < F < 2.8999999999999998e-7Initial program 99.6%
Simplified99.3%
Taylor expanded in F around 0 99.2%
Taylor expanded in x around 0 99.3%
Taylor expanded in F around inf 91.9%
associate-*r/91.9%
Simplified91.9%
if 2.8999999999999998e-7 < F Initial program 70.1%
Simplified83.7%
clear-num83.7%
inv-pow83.7%
fma-define83.7%
fma-undefine83.7%
*-commutative83.7%
fma-define83.7%
fma-define83.7%
Applied egg-rr83.7%
unpow-183.7%
Simplified83.7%
Taylor expanded in F around inf 98.1%
Final simplification95.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (/ (sqrt 0.5) (sin B)))))
(if (<= F -0.016)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.5e-46)
t_0
(if (<= F 1.95e-101)
(/ x (- (tan B)))
(if (<= F 0.022)
t_0
(if (<= F 2.5e+251)
(- (/ 1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))))
double code(double F, double B, double x) {
double t_0 = F * (sqrt(0.5) / sin(B));
double tmp;
if (F <= -0.016) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.5e-46) {
tmp = t_0;
} else if (F <= 1.95e-101) {
tmp = x / -tan(B);
} else if (F <= 0.022) {
tmp = t_0;
} else if (F <= 2.5e+251) {
tmp = (1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / 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) :: t_0
real(8) :: tmp
t_0 = f * (sqrt(0.5d0) / sin(b))
if (f <= (-0.016d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.5d-46)) then
tmp = t_0
else if (f <= 1.95d-101) then
tmp = x / -tan(b)
else if (f <= 0.022d0) then
tmp = t_0
else if (f <= 2.5d+251) then
tmp = (1.0d0 / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F * (Math.sqrt(0.5) / Math.sin(B));
double tmp;
if (F <= -0.016) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.5e-46) {
tmp = t_0;
} else if (F <= 1.95e-101) {
tmp = x / -Math.tan(B);
} else if (F <= 0.022) {
tmp = t_0;
} else if (F <= 2.5e+251) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): t_0 = F * (math.sqrt(0.5) / math.sin(B)) tmp = 0 if F <= -0.016: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.5e-46: tmp = t_0 elif F <= 1.95e-101: tmp = x / -math.tan(B) elif F <= 0.022: tmp = t_0 elif F <= 2.5e+251: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) t_0 = Float64(F * Float64(sqrt(0.5) / sin(B))) tmp = 0.0 if (F <= -0.016) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.5e-46) tmp = t_0; elseif (F <= 1.95e-101) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 0.022) tmp = t_0; elseif (F <= 2.5e+251) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F * (sqrt(0.5) / sin(B)); tmp = 0.0; if (F <= -0.016) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.5e-46) tmp = t_0; elseif (F <= 1.95e-101) tmp = x / -tan(B); elseif (F <= 0.022) tmp = t_0; elseif (F <= 2.5e+251) tmp = (1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.016], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.5e-46], t$95$0, If[LessEqual[F, 1.95e-101], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.022], t$95$0, If[LessEqual[F, 2.5e+251], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{if}\;F \leq -0.016:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.5 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 0.022:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+251}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -0.016Initial program 61.6%
Simplified75.8%
clear-num75.7%
inv-pow75.7%
fma-define75.7%
fma-undefine75.7%
*-commutative75.7%
fma-define75.7%
fma-define75.7%
Applied egg-rr75.7%
unpow-175.7%
Simplified75.7%
Taylor expanded in F around -inf 99.6%
if -0.016 < F < -1.49999999999999994e-46 or 1.95000000000000008e-101 < F < 0.021999999999999999Initial program 99.4%
Simplified99.3%
Taylor expanded in F around 0 96.9%
Taylor expanded in x around 0 97.1%
Taylor expanded in F around inf 81.7%
associate-*r/81.7%
Simplified81.7%
if -1.49999999999999994e-46 < F < 1.95000000000000008e-101Initial program 99.6%
Taylor expanded in F around -inf 35.9%
Taylor expanded in x around inf 82.9%
mul-1-neg82.9%
associate-/l*82.9%
Simplified82.9%
*-un-lft-identity82.9%
clear-num82.8%
tan-quot82.9%
Applied egg-rr82.9%
*-lft-identity82.9%
Simplified82.9%
div-inv83.1%
add-sqr-sqrt43.6%
sqrt-unprod29.1%
sqr-neg29.1%
div-inv29.0%
div-inv29.0%
sqrt-unprod0.8%
add-sqr-sqrt1.9%
div-inv1.9%
neg-sub01.9%
sub-neg1.9%
div-inv1.9%
add-sqr-sqrt0.8%
sqrt-unprod29.0%
div-inv29.0%
div-inv29.1%
sqr-neg29.1%
Applied egg-rr83.1%
+-lft-identity83.1%
Simplified83.1%
if 0.021999999999999999 < F < 2.5000000000000002e251Initial program 70.3%
Taylor expanded in F around inf 87.7%
Taylor expanded in B around 0 68.6%
associate-*r/68.6%
neg-mul-168.6%
Simplified68.6%
Taylor expanded in x around 0 79.8%
neg-mul-179.8%
+-commutative79.8%
unsub-neg79.8%
Simplified79.8%
if 2.5000000000000002e251 < F Initial program 64.4%
Taylor expanded in F around inf 82.3%
Taylor expanded in B around 0 99.6%
Final simplification87.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.5e-11)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3e-100)
(- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F B)) t_0)
(if (<= F 6.2e-6)
(* F (/ (sqrt 0.5) (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 <= -3.5e-11) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3e-100) {
tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0;
} else if (F <= 6.2e-6) {
tmp = F * (sqrt(0.5) / 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 <= (-3.5d-11)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3d-100) then
tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / b)) - t_0
else if (f <= 6.2d-6) then
tmp = f * (sqrt(0.5d0) / 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 <= -3.5e-11) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3e-100) {
tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0;
} else if (F <= 6.2e-6) {
tmp = F * (Math.sqrt(0.5) / 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 <= -3.5e-11: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3e-100: tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0 elif F <= 6.2e-6: tmp = F * (math.sqrt(0.5) / 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 <= -3.5e-11) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3e-100) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / B)) - t_0); elseif (F <= 6.2e-6) tmp = Float64(F * Float64(sqrt(0.5) / 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 <= -3.5e-11) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3e-100) tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / B)) - t_0; elseif (F <= 6.2e-6) tmp = F * (sqrt(0.5) / 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, -3.5e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3e-100], 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], If[LessEqual[F, 6.2e-6], N[(F * N[(N[Sqrt[0.5], $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 -3.5 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-100}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - t\_0\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.50000000000000019e-11Initial program 62.2%
Simplified76.2%
clear-num76.1%
inv-pow76.1%
fma-define76.1%
fma-undefine76.1%
*-commutative76.1%
fma-define76.1%
fma-define76.1%
Applied egg-rr76.1%
unpow-176.1%
Simplified76.1%
Taylor expanded in F around -inf 98.3%
if -3.50000000000000019e-11 < F < 3.0000000000000001e-100Initial program 99.5%
Simplified99.8%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 90.6%
if 3.0000000000000001e-100 < F < 6.1999999999999999e-6Initial program 99.6%
Simplified99.3%
Taylor expanded in F around 0 99.2%
Taylor expanded in x around 0 99.3%
Taylor expanded in F around inf 91.9%
associate-*r/91.9%
Simplified91.9%
if 6.1999999999999999e-6 < F Initial program 70.1%
Simplified83.7%
clear-num83.7%
inv-pow83.7%
fma-define83.7%
fma-undefine83.7%
*-commutative83.7%
fma-define83.7%
fma-define83.7%
Applied egg-rr83.7%
unpow-183.7%
Simplified83.7%
Taylor expanded in F around inf 98.1%
Final simplification95.1%
(FPCore (F B x)
:precision binary64
(if (<= F -3.35e+37)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2.15e-100)
(/ x (- (tan B)))
(if (<= F 0.092)
(* F (/ (sqrt 0.5) (sin B)))
(if (<= F 3.2e+253)
(- (/ 1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.15e-100) {
tmp = x / -tan(B);
} else if (F <= 0.092) {
tmp = F * (sqrt(0.5) / sin(B));
} else if (F <= 3.2e+253) {
tmp = (1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / 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 <= (-3.35d+37)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.15d-100) then
tmp = x / -tan(b)
else if (f <= 0.092d0) then
tmp = f * (sqrt(0.5d0) / sin(b))
else if (f <= 3.2d+253) then
tmp = (1.0d0 / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.15e-100) {
tmp = x / -Math.tan(B);
} else if (F <= 0.092) {
tmp = F * (Math.sqrt(0.5) / Math.sin(B));
} else if (F <= 3.2e+253) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.35e+37: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.15e-100: tmp = x / -math.tan(B) elif F <= 0.092: tmp = F * (math.sqrt(0.5) / math.sin(B)) elif F <= 3.2e+253: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.35e+37) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.15e-100) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 0.092) tmp = Float64(F * Float64(sqrt(0.5) / sin(B))); elseif (F <= 3.2e+253) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.35e+37) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.15e-100) tmp = x / -tan(B); elseif (F <= 0.092) tmp = F * (sqrt(0.5) / sin(B)); elseif (F <= 3.2e+253) tmp = (1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.35e+37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.15e-100], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 0.092], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.2e+253], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.15 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 0.092:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{+253}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -3.34999999999999984e37Initial program 58.6%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.7%
associate-*r/22.3%
neg-mul-122.3%
Simplified78.7%
if -3.34999999999999984e37 < F < 2.14999999999999999e-100Initial program 99.5%
Taylor expanded in F around -inf 38.0%
Taylor expanded in x around inf 78.1%
mul-1-neg78.1%
associate-/l*78.1%
Simplified78.1%
*-un-lft-identity78.1%
clear-num78.0%
tan-quot78.1%
Applied egg-rr78.1%
*-lft-identity78.1%
Simplified78.1%
div-inv78.3%
add-sqr-sqrt39.5%
sqrt-unprod26.8%
sqr-neg26.8%
div-inv26.8%
div-inv26.7%
sqrt-unprod0.8%
add-sqr-sqrt1.9%
div-inv1.9%
neg-sub01.9%
sub-neg1.9%
div-inv1.9%
add-sqr-sqrt0.8%
sqrt-unprod26.7%
div-inv26.8%
div-inv26.8%
sqr-neg26.8%
Applied egg-rr78.3%
+-lft-identity78.3%
Simplified78.3%
if 2.14999999999999999e-100 < F < 0.091999999999999998Initial program 99.6%
Simplified99.4%
Taylor expanded in F around 0 96.3%
Taylor expanded in x around 0 96.4%
Taylor expanded in F around inf 80.3%
associate-*r/80.3%
Simplified80.3%
if 0.091999999999999998 < F < 3.2000000000000003e253Initial program 70.3%
Taylor expanded in F around inf 87.7%
Taylor expanded in B around 0 68.6%
associate-*r/68.6%
neg-mul-168.6%
Simplified68.6%
Taylor expanded in x around 0 79.8%
neg-mul-179.8%
+-commutative79.8%
unsub-neg79.8%
Simplified79.8%
if 3.2000000000000003e253 < F Initial program 64.4%
Taylor expanded in F around inf 82.3%
Taylor expanded in B around 0 99.6%
Final simplification80.3%
(FPCore (F B x)
:precision binary64
(if (<= F -3.35e+37)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7.4e-118)
(/ x (- (tan B)))
(if (<= F 6.2e-6)
(- (* (* F (/ 1.0 B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 8e+252)
(- (/ 1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7.4e-118) {
tmp = x / -tan(B);
} else if (F <= 6.2e-6) {
tmp = ((F * (1.0 / B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 8e+252) {
tmp = (1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / 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 <= (-3.35d+37)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 7.4d-118) then
tmp = x / -tan(b)
else if (f <= 6.2d-6) then
tmp = ((f * (1.0d0 / b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 8d+252) then
tmp = (1.0d0 / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 7.4e-118) {
tmp = x / -Math.tan(B);
} else if (F <= 6.2e-6) {
tmp = ((F * (1.0 / B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 8e+252) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.35e+37: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 7.4e-118: tmp = x / -math.tan(B) elif F <= 6.2e-6: tmp = ((F * (1.0 / B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 8e+252: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.35e+37) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7.4e-118) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 6.2e-6) tmp = Float64(Float64(Float64(F * Float64(1.0 / B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 8e+252) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.35e+37) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 7.4e-118) tmp = x / -tan(B); elseif (F <= 6.2e-6) tmp = ((F * (1.0 / B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 8e+252) tmp = (1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.35e+37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.4e-118], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 6.2e-6], N[(N[(N[(F * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+252], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.4 \cdot 10^{-118}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;\left(F \cdot \frac{1}{B}\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+252}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -3.34999999999999984e37Initial program 58.6%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.7%
associate-*r/22.3%
neg-mul-122.3%
Simplified78.7%
if -3.34999999999999984e37 < F < 7.40000000000000029e-118Initial program 99.5%
Taylor expanded in F around -inf 38.1%
Taylor expanded in x around inf 77.6%
mul-1-neg77.6%
associate-/l*77.7%
Simplified77.7%
*-un-lft-identity77.7%
clear-num77.6%
tan-quot77.7%
Applied egg-rr77.7%
*-lft-identity77.7%
Simplified77.7%
div-inv77.8%
add-sqr-sqrt40.3%
sqrt-unprod27.4%
sqr-neg27.4%
div-inv27.3%
div-inv27.3%
sqrt-unprod0.8%
add-sqr-sqrt1.9%
div-inv1.9%
neg-sub01.9%
sub-neg1.9%
div-inv1.9%
add-sqr-sqrt0.8%
sqrt-unprod27.3%
div-inv27.3%
div-inv27.4%
sqr-neg27.4%
Applied egg-rr77.8%
+-lft-identity77.8%
Simplified77.8%
if 7.40000000000000029e-118 < F < 6.1999999999999999e-6Initial program 99.7%
Simplified99.4%
Taylor expanded in F around 0 99.3%
Taylor expanded in B around 0 68.1%
div-inv68.0%
Applied egg-rr68.0%
Taylor expanded in B around 0 67.8%
if 6.1999999999999999e-6 < F < 8.0000000000000008e252Initial program 71.7%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 65.8%
associate-*r/65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in x around 0 76.4%
neg-mul-176.4%
+-commutative76.4%
unsub-neg76.4%
Simplified76.4%
if 8.0000000000000008e252 < F Initial program 64.4%
Taylor expanded in F around inf 82.3%
Taylor expanded in B around 0 99.6%
Final simplification78.4%
(FPCore (F B x)
:precision binary64
(if (<= F -3.35e+37)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.15e-105)
(/ x (- (tan B)))
(if (<= F 6.2e-6)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= F 7.2e+249)
(- (/ 1.0 (sin B)) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.15e-105) {
tmp = x / -tan(B);
} else if (F <= 6.2e-6) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (F <= 7.2e+249) {
tmp = (1.0 / sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / 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 <= (-3.35d+37)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.15d-105) then
tmp = x / -tan(b)
else if (f <= 6.2d-6) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (f <= 7.2d+249) then
tmp = (1.0d0 / sin(b)) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.15e-105) {
tmp = x / -Math.tan(B);
} else if (F <= 6.2e-6) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (F <= 7.2e+249) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.35e+37: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.15e-105: tmp = x / -math.tan(B) elif F <= 6.2e-6: tmp = ((F * math.sqrt(0.5)) - x) / B elif F <= 7.2e+249: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.35e+37) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.15e-105) tmp = Float64(x / Float64(-tan(B))); elseif (F <= 6.2e-6) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (F <= 7.2e+249) tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.35e+37) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.15e-105) tmp = x / -tan(B); elseif (F <= 6.2e-6) tmp = ((F * sqrt(0.5)) - x) / B; elseif (F <= 7.2e+249) tmp = (1.0 / sin(B)) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.35e+37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-105], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 6.2e-6], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.2e+249], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-105}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{+249}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -3.34999999999999984e37Initial program 58.6%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.7%
associate-*r/22.3%
neg-mul-122.3%
Simplified78.7%
if -3.34999999999999984e37 < F < 1.15e-105Initial program 99.5%
Taylor expanded in F around -inf 38.1%
Taylor expanded in x around inf 77.6%
mul-1-neg77.6%
associate-/l*77.7%
Simplified77.7%
*-un-lft-identity77.7%
clear-num77.6%
tan-quot77.7%
Applied egg-rr77.7%
*-lft-identity77.7%
Simplified77.7%
div-inv77.8%
add-sqr-sqrt40.3%
sqrt-unprod27.4%
sqr-neg27.4%
div-inv27.3%
div-inv27.3%
sqrt-unprod0.8%
add-sqr-sqrt1.9%
div-inv1.9%
neg-sub01.9%
sub-neg1.9%
div-inv1.9%
add-sqr-sqrt0.8%
sqrt-unprod27.3%
div-inv27.3%
div-inv27.4%
sqr-neg27.4%
Applied egg-rr77.8%
+-lft-identity77.8%
Simplified77.8%
if 1.15e-105 < F < 6.1999999999999999e-6Initial program 99.7%
Simplified99.4%
Taylor expanded in F around 0 99.3%
Taylor expanded in x around 0 99.4%
Taylor expanded in B around 0 67.7%
if 6.1999999999999999e-6 < F < 7.1999999999999994e249Initial program 71.7%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 65.8%
associate-*r/65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in x around 0 76.4%
neg-mul-176.4%
+-commutative76.4%
unsub-neg76.4%
Simplified76.4%
if 7.1999999999999994e249 < F Initial program 64.4%
Taylor expanded in F around inf 82.3%
Taylor expanded in B around 0 99.6%
Final simplification78.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (- (tan B)))))
(if (<= F -3.35e+37)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2.45e-114)
t_0
(if (<= F 6.2e-6)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= F 8e+253) (- (/ 1.0 (sin B)) (/ x B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / -tan(B);
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.45e-114) {
tmp = t_0;
} else if (F <= 6.2e-6) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (F <= 8e+253) {
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 = x / -tan(b)
if (f <= (-3.35d+37)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.45d-114) then
tmp = t_0
else if (f <= 6.2d-6) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (f <= 8d+253) 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 = x / -Math.tan(B);
double tmp;
if (F <= -3.35e+37) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.45e-114) {
tmp = t_0;
} else if (F <= 6.2e-6) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (F <= 8e+253) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / -math.tan(B) tmp = 0 if F <= -3.35e+37: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.45e-114: tmp = t_0 elif F <= 6.2e-6: tmp = ((F * math.sqrt(0.5)) - x) / B elif F <= 8e+253: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(x / Float64(-tan(B))) tmp = 0.0 if (F <= -3.35e+37) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.45e-114) tmp = t_0; elseif (F <= 6.2e-6) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (F <= 8e+253) 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 = x / -tan(B); tmp = 0.0; if (F <= -3.35e+37) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.45e-114) tmp = t_0; elseif (F <= 6.2e-6) tmp = ((F * sqrt(0.5)) - x) / B; elseif (F <= 8e+253) 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[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[F, -3.35e+37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.45e-114], t$95$0, If[LessEqual[F, 6.2e-6], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e+253], 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{x}{-\tan B}\\
\mathbf{if}\;F \leq -3.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.45 \cdot 10^{-114}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+253}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if F < -3.34999999999999984e37Initial program 58.6%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.7%
associate-*r/22.3%
neg-mul-122.3%
Simplified78.7%
if -3.34999999999999984e37 < F < 2.4499999999999999e-114 or 7.9999999999999995e253 < F Initial program 94.2%
Taylor expanded in F around -inf 45.6%
Taylor expanded in x around inf 79.2%
mul-1-neg79.2%
associate-/l*79.3%
Simplified79.3%
*-un-lft-identity79.3%
clear-num79.2%
tan-quot79.2%
Applied egg-rr79.2%
*-lft-identity79.2%
Simplified79.2%
div-inv79.4%
add-sqr-sqrt42.2%
sqrt-unprod27.2%
sqr-neg27.2%
div-inv27.2%
div-inv27.2%
sqrt-unprod0.8%
add-sqr-sqrt1.8%
div-inv1.8%
neg-sub01.8%
sub-neg1.8%
div-inv1.8%
add-sqr-sqrt0.8%
sqrt-unprod27.2%
div-inv27.2%
div-inv27.2%
sqr-neg27.2%
Applied egg-rr79.4%
+-lft-identity79.4%
Simplified79.4%
if 2.4499999999999999e-114 < F < 6.1999999999999999e-6Initial program 99.7%
Simplified99.4%
Taylor expanded in F around 0 99.3%
Taylor expanded in x around 0 99.4%
Taylor expanded in B around 0 67.7%
if 6.1999999999999999e-6 < F < 7.9999999999999995e253Initial program 71.7%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 65.8%
associate-*r/65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in x around 0 76.4%
neg-mul-176.4%
+-commutative76.4%
unsub-neg76.4%
Simplified76.4%
Final simplification77.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (- (tan B)))))
(if (<= F 9.2e-109)
t_0
(if (<= F 6.2e-6)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= F 8e+253) (- (/ 1.0 (sin B)) (/ x B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / -tan(B);
double tmp;
if (F <= 9.2e-109) {
tmp = t_0;
} else if (F <= 6.2e-6) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (F <= 8e+253) {
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 = x / -tan(b)
if (f <= 9.2d-109) then
tmp = t_0
else if (f <= 6.2d-6) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (f <= 8d+253) 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 = x / -Math.tan(B);
double tmp;
if (F <= 9.2e-109) {
tmp = t_0;
} else if (F <= 6.2e-6) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (F <= 8e+253) {
tmp = (1.0 / Math.sin(B)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / -math.tan(B) tmp = 0 if F <= 9.2e-109: tmp = t_0 elif F <= 6.2e-6: tmp = ((F * math.sqrt(0.5)) - x) / B elif F <= 8e+253: tmp = (1.0 / math.sin(B)) - (x / B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(x / Float64(-tan(B))) tmp = 0.0 if (F <= 9.2e-109) tmp = t_0; elseif (F <= 6.2e-6) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (F <= 8e+253) 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 = x / -tan(B); tmp = 0.0; if (F <= 9.2e-109) tmp = t_0; elseif (F <= 6.2e-6) tmp = ((F * sqrt(0.5)) - x) / B; elseif (F <= 8e+253) 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[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]}, If[LessEqual[F, 9.2e-109], t$95$0, If[LessEqual[F, 6.2e-6], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e+253], 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{x}{-\tan B}\\
\mathbf{if}\;F \leq 9.2 \cdot 10^{-109}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+253}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if F < 9.2000000000000006e-109 or 7.9999999999999995e253 < F Initial program 81.4%
Taylor expanded in F around -inf 65.1%
Taylor expanded in x around inf 69.2%
mul-1-neg69.2%
associate-/l*69.2%
Simplified69.2%
*-un-lft-identity69.2%
clear-num69.1%
tan-quot69.2%
Applied egg-rr69.2%
*-lft-identity69.2%
Simplified69.2%
div-inv69.3%
add-sqr-sqrt34.7%
sqrt-unprod22.7%
sqr-neg22.7%
div-inv22.7%
div-inv22.7%
sqrt-unprod1.0%
add-sqr-sqrt1.9%
div-inv1.9%
neg-sub01.9%
sub-neg1.9%
div-inv1.9%
add-sqr-sqrt1.0%
sqrt-unprod22.7%
div-inv22.7%
div-inv22.7%
sqr-neg22.7%
Applied egg-rr69.3%
+-lft-identity69.3%
Simplified69.3%
if 9.2000000000000006e-109 < F < 6.1999999999999999e-6Initial program 99.7%
Simplified99.4%
Taylor expanded in F around 0 99.3%
Taylor expanded in x around 0 99.4%
Taylor expanded in B around 0 67.7%
if 6.1999999999999999e-6 < F < 7.9999999999999995e253Initial program 71.7%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 65.8%
associate-*r/65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in x around 0 76.4%
neg-mul-176.4%
+-commutative76.4%
unsub-neg76.4%
Simplified76.4%
Final simplification70.9%
(FPCore (F B x) :precision binary64 (if (or (<= F 0.0082) (not (<= F 8e+253))) (/ x (- (tan B))) (- (/ 1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((F <= 0.0082) || !(F <= 8e+253)) {
tmp = x / -tan(B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((f <= 0.0082d0) .or. (.not. (f <= 8d+253))) then
tmp = x / -tan(b)
else
tmp = (1.0d0 / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((F <= 0.0082) || !(F <= 8e+253)) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (F <= 0.0082) or not (F <= 8e+253): tmp = x / -math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if ((F <= 0.0082) || !(F <= 8e+253)) tmp = Float64(x / Float64(-tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((F <= 0.0082) || ~((F <= 8e+253))) tmp = x / -tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[F, 0.0082], N[Not[LessEqual[F, 8e+253]], $MachinePrecision]], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 0.0082 \lor \neg \left(F \leq 8 \cdot 10^{+253}\right):\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < 0.00820000000000000069 or 7.9999999999999995e253 < F Initial program 83.3%
Taylor expanded in F around -inf 60.4%
Taylor expanded in x around inf 64.9%
mul-1-neg64.9%
associate-/l*64.9%
Simplified64.9%
*-un-lft-identity64.9%
clear-num64.8%
tan-quot64.9%
Applied egg-rr64.9%
*-lft-identity64.9%
Simplified64.9%
div-inv65.0%
add-sqr-sqrt32.3%
sqrt-unprod21.7%
sqr-neg21.7%
div-inv21.7%
div-inv21.7%
sqrt-unprod1.1%
add-sqr-sqrt2.0%
div-inv2.0%
neg-sub02.0%
sub-neg2.0%
div-inv2.0%
add-sqr-sqrt1.1%
sqrt-unprod21.7%
div-inv21.7%
div-inv21.7%
sqr-neg21.7%
Applied egg-rr65.0%
+-lft-identity65.0%
Simplified65.0%
if 0.00820000000000000069 < F < 7.9999999999999995e253Initial program 70.8%
Taylor expanded in F around inf 86.5%
Taylor expanded in B around 0 67.8%
associate-*r/67.8%
neg-mul-167.8%
Simplified67.8%
Taylor expanded in x around 0 78.7%
neg-mul-178.7%
+-commutative78.7%
unsub-neg78.7%
Simplified78.7%
Final simplification68.3%
(FPCore (F B x) :precision binary64 (/ x (- (tan B))))
double code(double F, double B, double x) {
return x / -tan(B);
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = x / -tan(b)
end function
public static double code(double F, double B, double x) {
return x / -Math.tan(B);
}
def code(F, B, x): return x / -math.tan(B)
function code(F, B, x) return Float64(x / Float64(-tan(B))) end
function tmp = code(F, B, x) tmp = x / -tan(B); end
code[F_, B_, x_] := N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{-\tan B}
\end{array}
Initial program 80.3%
Taylor expanded in F around -inf 55.8%
Taylor expanded in x around inf 59.5%
mul-1-neg59.5%
associate-/l*59.5%
Simplified59.5%
*-un-lft-identity59.5%
clear-num59.5%
tan-quot59.5%
Applied egg-rr59.5%
*-lft-identity59.5%
Simplified59.5%
div-inv59.6%
add-sqr-sqrt29.4%
sqrt-unprod19.6%
sqr-neg19.6%
div-inv19.5%
div-inv19.5%
sqrt-unprod1.2%
add-sqr-sqrt2.1%
div-inv2.1%
neg-sub02.1%
sub-neg2.1%
div-inv2.1%
add-sqr-sqrt1.2%
sqrt-unprod19.5%
div-inv19.5%
div-inv19.6%
sqr-neg19.6%
Applied egg-rr59.6%
+-lft-identity59.6%
Simplified59.6%
Final simplification59.6%
(FPCore (F B x) :precision binary64 (if (<= F -8.2e-47) (/ (- -1.0 x) B) (if (<= F 2.6e-101) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.2e-47) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.6e-101) {
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.2d-47)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.6d-101) 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.2e-47) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.6e-101) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.2e-47: tmp = (-1.0 - x) / B elif F <= 2.6e-101: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.2e-47) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.6e-101) 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.2e-47) tmp = (-1.0 - x) / B; elseif (F <= 2.6e-101) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.2e-47], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.6e-101], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.2 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.20000000000000003e-47Initial program 65.1%
Taylor expanded in F around -inf 92.3%
Taylor expanded in B around 0 51.3%
mul-1-neg51.3%
distribute-neg-frac251.3%
Simplified51.3%
if -8.20000000000000003e-47 < F < 2.6000000000000001e-101Initial program 99.6%
Taylor expanded in F around inf 35.6%
Taylor expanded in B around 0 18.3%
Taylor expanded in x around inf 45.9%
neg-mul-145.9%
Simplified45.9%
if 2.6000000000000001e-101 < F Initial program 75.0%
Taylor expanded in F around inf 73.8%
Taylor expanded in B around 0 34.5%
Final simplification43.2%
(FPCore (F B x) :precision binary64 (if (<= F 2.9e-100) (/ x (- B)) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.9e-100) {
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.9d-100) 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.9e-100) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.9e-100: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.9e-100) 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.9e-100) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.9e-100], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.9 \cdot 10^{-100}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.89999999999999975e-100Initial program 83.4%
Taylor expanded in F around inf 38.3%
Taylor expanded in B around 0 23.6%
Taylor expanded in x around inf 38.4%
neg-mul-138.4%
Simplified38.4%
if 2.89999999999999975e-100 < F Initial program 75.0%
Taylor expanded in F around inf 73.8%
Taylor expanded in B around 0 34.5%
Final simplification37.0%
(FPCore (F B x) :precision binary64 (/ x (- B)))
double code(double F, double B, double x) {
return x / -B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = x / -b
end function
public static double code(double F, double B, double x) {
return x / -B;
}
def code(F, B, x): return x / -B
function code(F, B, x) return Float64(x / Float64(-B)) end
function tmp = code(F, B, x) tmp = x / -B; end
code[F_, B_, x_] := N[(x / (-B)), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{-B}
\end{array}
Initial program 80.3%
Taylor expanded in F around inf 51.6%
Taylor expanded in B around 0 27.7%
Taylor expanded in x around inf 32.7%
neg-mul-132.7%
Simplified32.7%
Final simplification32.7%
(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 80.3%
Taylor expanded in F around inf 51.6%
Taylor expanded in B around 0 27.7%
Taylor expanded in x around 0 7.1%
herbie shell --seed 2024132
(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))))))