
(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 23 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 -1e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 220000000.0)
(fma (/ F (sin B)) (pow (fma x 2.0 (fma F F 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 <= -1e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 220000000.0) {
tmp = fma((F / sin(B)), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), -t_0);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 220000000.0) tmp = fma(Float64(F / sin(B)), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(-t_0)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 220000000.0], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $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 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 220000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, -t_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1e17Initial program 57.2%
+-commutative57.2%
unsub-neg57.2%
associate-*l/73.2%
associate-*r/73.2%
*-commutative73.2%
Simplified73.4%
Taylor expanded in F around -inf 99.6%
Taylor expanded in F around 0 99.8%
if -1e17 < F < 2.2e8Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
if 2.2e8 < F Initial program 62.6%
Taylor expanded in F around inf 99.7%
div-inv99.7%
expm1-log1p-u67.2%
expm1-udef67.2%
Applied egg-rr67.2%
expm1-def67.2%
expm1-log1p99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+71)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 400000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -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 <= -4e+71) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 400000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4e+71) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 400000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+71], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 400000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+71}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 400000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -4.0000000000000002e71Initial program 52.8%
+-commutative52.8%
unsub-neg52.8%
associate-*l/68.7%
associate-*r/68.6%
*-commutative68.6%
Simplified68.8%
Taylor expanded in F around -inf 99.6%
Taylor expanded in F around 0 99.8%
if -4.0000000000000002e71 < F < 4e8Initial program 97.8%
+-commutative97.8%
unsub-neg97.8%
associate-*l/99.4%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
if 4e8 < F Initial program 62.6%
Taylor expanded in F around inf 99.7%
div-inv99.7%
expm1-log1p-u67.2%
expm1-udef67.2%
Applied egg-rr67.2%
expm1-def67.2%
expm1-log1p99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 125000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 125000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1d+17)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 125000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1e+17) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 125000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1e+17: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 125000000.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 125000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1e+17) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 125000000.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 125000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 125000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1e17Initial program 57.2%
+-commutative57.2%
unsub-neg57.2%
associate-*l/73.2%
associate-*r/73.2%
*-commutative73.2%
Simplified73.4%
Taylor expanded in F around -inf 99.6%
Taylor expanded in F around 0 99.8%
if -1e17 < F < 1.25e8Initial program 99.5%
if 1.25e8 < F Initial program 62.6%
Taylor expanded in F around inf 99.7%
div-inv99.7%
expm1-log1p-u67.2%
expm1-udef67.2%
Applied egg-rr67.2%
expm1-def67.2%
expm1-log1p99.7%
Simplified99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.52)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (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 <= -1e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.52) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / 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 <= (-1d+17)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.52d0) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / 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 <= -1e+17) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.52) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / 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 <= -1e+17: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.52: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / 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 <= -1e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.52) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / 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 <= -1e+17) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.52) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / 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, -1e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.52], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.52:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1e17Initial program 57.2%
+-commutative57.2%
unsub-neg57.2%
associate-*l/73.2%
associate-*r/73.2%
*-commutative73.2%
Simplified73.4%
Taylor expanded in F around -inf 99.6%
Taylor expanded in F around 0 99.8%
if -1e17 < F < 1.52Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.4%
associate-*r/99.4%
*-commutative99.4%
Simplified99.6%
Taylor expanded in F around 0 98.7%
if 1.52 < F Initial program 63.1%
Taylor expanded in F around inf 99.7%
div-inv99.7%
expm1-log1p-u67.6%
expm1-udef67.6%
Applied egg-rr67.6%
expm1-def67.6%
expm1-log1p99.7%
Simplified99.7%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 116000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F 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 <= -1e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 116000000.0) {
tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= (-1d+17)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 116000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / 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 <= -1e+17) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 116000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -1e+17: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 116000000.0: tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -1e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 116000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / 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 <= -1e+17) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 116000000.0) tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / 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, -1e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 116000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $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 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 116000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1e17Initial program 57.2%
+-commutative57.2%
unsub-neg57.2%
associate-*l/73.2%
associate-*r/73.2%
*-commutative73.2%
Simplified73.4%
Taylor expanded in F around -inf 99.6%
Taylor expanded in F around 0 99.8%
if -1e17 < F < 1.16e8Initial program 99.5%
Taylor expanded in B around 0 87.7%
if 1.16e8 < F Initial program 62.6%
Taylor expanded in F around inf 99.7%
div-inv99.7%
expm1-log1p-u67.2%
expm1-udef67.2%
Applied egg-rr67.2%
expm1-def67.2%
expm1-log1p99.7%
Simplified99.7%
Final simplification94.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2.5e-121)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 2.7e-51)
(* (cos B) (- (/ x (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 <= -1e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2.5e-121) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 2.7e-51) {
tmp = cos(B) * -(x / 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 <= (-1d+17)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2.5d-121)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 2.7d-51) then
tmp = cos(b) * -(x / 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 <= -1e+17) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2.5e-121) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 2.7e-51) {
tmp = Math.cos(B) * -(x / 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 <= -1e+17: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2.5e-121: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 2.7e-51: tmp = math.cos(B) * -(x / 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 <= -1e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2.5e-121) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 2.7e-51) tmp = Float64(cos(B) * Float64(-Float64(x / 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 <= -1e+17) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2.5e-121) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 2.7e-51) tmp = cos(B) * -(x / 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, -1e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.5e-121], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e-51], N[(N[Cos[B], $MachinePrecision] * (-N[(x / 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 -1 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq -2.5 \cdot 10^{-121}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-51}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1e17Initial program 57.2%
+-commutative57.2%
unsub-neg57.2%
associate-*l/73.2%
associate-*r/73.2%
*-commutative73.2%
Simplified73.4%
Taylor expanded in F around -inf 99.6%
Taylor expanded in F around 0 99.8%
if -1e17 < F < -2.49999999999999995e-121Initial program 99.8%
Taylor expanded in B around 0 79.9%
if -2.49999999999999995e-121 < F < 2.6999999999999997e-51Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 81.0%
mul-1-neg81.0%
*-commutative81.0%
associate-*l/81.1%
*-commutative81.1%
Simplified81.1%
if 2.6999999999999997e-51 < F Initial program 65.3%
Taylor expanded in F around inf 96.5%
div-inv96.5%
expm1-log1p-u65.0%
expm1-udef65.0%
Applied egg-rr65.0%
expm1-def65.0%
expm1-log1p96.5%
Simplified96.5%
Final simplification91.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -9.8e-74)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.1e-51)
(* (cos B) (- (/ x (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 <= -9.8e-74) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.1e-51) {
tmp = cos(B) * -(x / 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 <= (-9.8d-74)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.1d-51) then
tmp = cos(b) * -(x / 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 <= -9.8e-74) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.1e-51) {
tmp = Math.cos(B) * -(x / 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 <= -9.8e-74: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.1e-51: tmp = math.cos(B) * -(x / 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 <= -9.8e-74) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.1e-51) tmp = Float64(cos(B) * Float64(-Float64(x / 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 <= -9.8e-74) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.1e-51) tmp = cos(B) * -(x / 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, -9.8e-74], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.1e-51], N[(N[Cos[B], $MachinePrecision] * (-N[(x / 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 -9.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-51}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -9.8000000000000006e-74Initial program 61.7%
+-commutative61.7%
unsub-neg61.7%
associate-*l/76.1%
associate-*r/76.1%
*-commutative76.1%
Simplified76.2%
Taylor expanded in F around -inf 93.1%
Taylor expanded in F around 0 93.3%
if -9.8000000000000006e-74 < F < 2.10000000000000002e-51Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 77.5%
mul-1-neg77.5%
*-commutative77.5%
associate-*l/77.6%
*-commutative77.6%
Simplified77.6%
if 2.10000000000000002e-51 < F Initial program 65.3%
Taylor expanded in F around inf 96.5%
div-inv96.5%
expm1-log1p-u65.0%
expm1-udef65.0%
Applied egg-rr65.0%
expm1-def65.0%
expm1-log1p96.5%
Simplified96.5%
Final simplification88.8%
(FPCore (F B x)
:precision binary64
(if (<= F -9.2e-74)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 2.45e-51)
(* (cos B) (- (/ x (sin B))))
(if (or (<= F 4.8e+106) (not (<= F 6.8e+201)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
(- (/ 1.0 (sin B)) (+ (/ x B) (* -0.3333333333333333 (* B x))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.2e-74) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 2.45e-51) {
tmp = cos(B) * -(x / sin(B));
} else if ((F <= 4.8e+106) || !(F <= 6.8e+201)) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-9.2d-74)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 2.45d-51) then
tmp = cos(b) * -(x / sin(b))
else if ((f <= 4.8d+106) .or. (.not. (f <= 6.8d+201))) then
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9.2e-74) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 2.45e-51) {
tmp = Math.cos(B) * -(x / Math.sin(B));
} else if ((F <= 4.8e+106) || !(F <= 6.8e+201)) {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.2e-74: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 2.45e-51: tmp = math.cos(B) * -(x / math.sin(B)) elif (F <= 4.8e+106) or not (F <= 6.8e+201): tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.2e-74) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 2.45e-51) tmp = Float64(cos(B) * Float64(-Float64(x / sin(B)))); elseif ((F <= 4.8e+106) || !(F <= 6.8e+201)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9.2e-74) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 2.45e-51) tmp = cos(B) * -(x / sin(B)); elseif ((F <= 4.8e+106) || ~((F <= 6.8e+201))) tmp = (x * (-1.0 / tan(B))) + (1.0 / B); else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.2e-74], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.45e-51], N[(N[Cos[B], $MachinePrecision] * (-N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 4.8e+106], N[Not[LessEqual[F, 6.8e+201]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.2 \cdot 10^{-74}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.45 \cdot 10^{-51}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{+106} \lor \neg \left(F \leq 6.8 \cdot 10^{+201}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -9.19999999999999922e-74Initial program 61.7%
+-commutative61.7%
unsub-neg61.7%
associate-*l/76.1%
associate-*r/76.1%
*-commutative76.1%
Simplified76.2%
Taylor expanded in F around -inf 93.1%
Taylor expanded in B around 0 69.5%
if -9.19999999999999922e-74 < F < 2.44999999999999987e-51Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 77.5%
mul-1-neg77.5%
*-commutative77.5%
associate-*l/77.6%
*-commutative77.6%
Simplified77.6%
if 2.44999999999999987e-51 < F < 4.8000000000000001e106 or 6.8e201 < F Initial program 74.2%
Taylor expanded in B around 0 60.9%
Taylor expanded in F around inf 73.2%
if 4.8000000000000001e106 < F < 6.8e201Initial program 45.2%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification74.6%
(FPCore (F B x)
:precision binary64
(if (<= F -9.8e-74)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 2.4e-51)
(* (cos B) (- (/ x (sin B))))
(if (or (<= F 3e+106) (not (<= F 7.2e+201)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
(- (/ 1.0 (sin B)) (+ (/ x B) (* -0.3333333333333333 (* B x))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.8e-74) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 2.4e-51) {
tmp = cos(B) * -(x / sin(B));
} else if ((F <= 3e+106) || !(F <= 7.2e+201)) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-9.8d-74)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 2.4d-51) then
tmp = cos(b) * -(x / sin(b))
else if ((f <= 3d+106) .or. (.not. (f <= 7.2d+201))) then
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9.8e-74) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 2.4e-51) {
tmp = Math.cos(B) * -(x / Math.sin(B));
} else if ((F <= 3e+106) || !(F <= 7.2e+201)) {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.8e-74: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 2.4e-51: tmp = math.cos(B) * -(x / math.sin(B)) elif (F <= 3e+106) or not (F <= 7.2e+201): tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.8e-74) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 2.4e-51) tmp = Float64(cos(B) * Float64(-Float64(x / sin(B)))); elseif ((F <= 3e+106) || !(F <= 7.2e+201)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9.8e-74) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 2.4e-51) tmp = cos(B) * -(x / sin(B)); elseif ((F <= 3e+106) || ~((F <= 7.2e+201))) tmp = (x * (-1.0 / tan(B))) + (1.0 / B); else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.8e-74], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e-51], N[(N[Cos[B], $MachinePrecision] * (-N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[Or[LessEqual[F, 3e+106], N[Not[LessEqual[F, 7.2e+201]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.8 \cdot 10^{-74}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-51}:\\
\;\;\;\;\cos B \cdot \left(-\frac{x}{\sin B}\right)\\
\mathbf{elif}\;F \leq 3 \cdot 10^{+106} \lor \neg \left(F \leq 7.2 \cdot 10^{+201}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -9.8000000000000006e-74Initial program 61.7%
+-commutative61.7%
unsub-neg61.7%
associate-*l/76.1%
associate-*r/76.1%
*-commutative76.1%
Simplified76.2%
Taylor expanded in F around -inf 93.1%
Taylor expanded in F around 0 93.3%
if -9.8000000000000006e-74 < F < 2.4e-51Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 77.5%
mul-1-neg77.5%
*-commutative77.5%
associate-*l/77.6%
*-commutative77.6%
Simplified77.6%
if 2.4e-51 < F < 3.0000000000000001e106 or 7.19999999999999951e201 < F Initial program 74.2%
Taylor expanded in B around 0 60.9%
Taylor expanded in F around inf 73.2%
if 3.0000000000000001e106 < F < 7.19999999999999951e201Initial program 45.2%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification82.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B))
(t_1 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
(if (<= F -1e+17)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 1.48e-241)
t_0
(if (<= F 4.9e-119)
t_1
(if (<= F 3.8e-57)
t_0
(if (or (<= F 1.8e+106) (not (<= F 7.2e+201)))
t_1
(-
(/ 1.0 (sin B))
(+ (/ x B) (* -0.3333333333333333 (* B x)))))))))))
double code(double F, double B, double x) {
double t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double t_1 = (x * (-1.0 / tan(B))) + (1.0 / B);
double tmp;
if (F <= -1e+17) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 1.48e-241) {
tmp = t_0;
} else if (F <= 4.9e-119) {
tmp = t_1;
} else if (F <= 3.8e-57) {
tmp = t_0;
} else if ((F <= 1.8e+106) || !(F <= 7.2e+201)) {
tmp = t_1;
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
t_1 = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
if (f <= (-1d+17)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 1.48d-241) then
tmp = t_0
else if (f <= 4.9d-119) then
tmp = t_1
else if (f <= 3.8d-57) then
tmp = t_0
else if ((f <= 1.8d+106) .or. (.not. (f <= 7.2d+201))) then
tmp = t_1
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double t_1 = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
double tmp;
if (F <= -1e+17) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 1.48e-241) {
tmp = t_0;
} else if (F <= 4.9e-119) {
tmp = t_1;
} else if (F <= 3.8e-57) {
tmp = t_0;
} else if ((F <= 1.8e+106) || !(F <= 7.2e+201)) {
tmp = t_1;
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B t_1 = (x * (-1.0 / math.tan(B))) + (1.0 / B) tmp = 0 if F <= -1e+17: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 1.48e-241: tmp = t_0 elif F <= 4.9e-119: tmp = t_1 elif F <= 3.8e-57: tmp = t_0 elif (F <= 1.8e+106) or not (F <= 7.2e+201): tmp = t_1 else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B) t_1 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)) tmp = 0.0 if (F <= -1e+17) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 1.48e-241) tmp = t_0; elseif (F <= 4.9e-119) tmp = t_1; elseif (F <= 3.8e-57) tmp = t_0; elseif ((F <= 1.8e+106) || !(F <= 7.2e+201)) tmp = t_1; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; t_1 = (x * (-1.0 / tan(B))) + (1.0 / B); tmp = 0.0; if (F <= -1e+17) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 1.48e-241) tmp = t_0; elseif (F <= 4.9e-119) tmp = t_1; elseif (F <= 3.8e-57) tmp = t_0; elseif ((F <= 1.8e+106) || ~((F <= 7.2e+201))) tmp = t_1; else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+17], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.48e-241], t$95$0, If[LessEqual[F, 4.9e-119], t$95$1, If[LessEqual[F, 3.8e-57], t$95$0, If[Or[LessEqual[F, 1.8e+106], N[Not[LessEqual[F, 7.2e+201]], $MachinePrecision]], t$95$1, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
t_1 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.48 \cdot 10^{-241}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-57}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+106} \lor \neg \left(F \leq 7.2 \cdot 10^{+201}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -1e17Initial program 57.2%
+-commutative57.2%
unsub-neg57.2%
associate-*l/73.2%
associate-*r/73.2%
*-commutative73.2%
Simplified73.4%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 73.3%
if -1e17 < F < 1.47999999999999999e-241 or 4.9e-119 < F < 3.7999999999999997e-57Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in B around 0 68.3%
Taylor expanded in F around 0 68.0%
if 1.47999999999999999e-241 < F < 4.9e-119 or 3.7999999999999997e-57 < F < 1.8e106 or 7.19999999999999951e201 < F Initial program 81.1%
Taylor expanded in B around 0 66.7%
Taylor expanded in F around inf 68.7%
if 1.8e106 < F < 7.19999999999999951e201Initial program 45.2%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification71.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(t_1 (+ (* x (/ -1.0 (tan B))) (/ 1.0 B))))
(if (<= F -1e+17)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F 2.1e-244)
(- (* (/ F B) t_0) (/ x B))
(if (<= F 1.8e-119)
t_1
(if (<= F 1.15e-60)
(/ (- (* F t_0) x) B)
(if (or (<= F 1.5e+107) (not (<= F 6.8e+201)))
t_1
(-
(/ 1.0 (sin B))
(+ (/ x B) (* -0.3333333333333333 (* B x)))))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = (x * (-1.0 / tan(B))) + (1.0 / B);
double tmp;
if (F <= -1e+17) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 2.1e-244) {
tmp = ((F / B) * t_0) - (x / B);
} else if (F <= 1.8e-119) {
tmp = t_1;
} else if (F <= 1.15e-60) {
tmp = ((F * t_0) - x) / B;
} else if ((F <= 1.5e+107) || !(F <= 6.8e+201)) {
tmp = t_1;
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
if (f <= (-1d+17)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 2.1d-244) then
tmp = ((f / b) * t_0) - (x / b)
else if (f <= 1.8d-119) then
tmp = t_1
else if (f <= 1.15d-60) then
tmp = ((f * t_0) - x) / b
else if ((f <= 1.5d+107) .or. (.not. (f <= 6.8d+201))) then
tmp = t_1
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
double tmp;
if (F <= -1e+17) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 2.1e-244) {
tmp = ((F / B) * t_0) - (x / B);
} else if (F <= 1.8e-119) {
tmp = t_1;
} else if (F <= 1.15e-60) {
tmp = ((F * t_0) - x) / B;
} else if ((F <= 1.5e+107) || !(F <= 6.8e+201)) {
tmp = t_1;
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = (x * (-1.0 / math.tan(B))) + (1.0 / B) tmp = 0 if F <= -1e+17: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 2.1e-244: tmp = ((F / B) * t_0) - (x / B) elif F <= 1.8e-119: tmp = t_1 elif F <= 1.15e-60: tmp = ((F * t_0) - x) / B elif (F <= 1.5e+107) or not (F <= 6.8e+201): tmp = t_1 else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)) tmp = 0.0 if (F <= -1e+17) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 2.1e-244) tmp = Float64(Float64(Float64(F / B) * t_0) - Float64(x / B)); elseif (F <= 1.8e-119) tmp = t_1; elseif (F <= 1.15e-60) tmp = Float64(Float64(Float64(F * t_0) - x) / B); elseif ((F <= 1.5e+107) || !(F <= 6.8e+201)) tmp = t_1; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = (x * (-1.0 / tan(B))) + (1.0 / B); tmp = 0.0; if (F <= -1e+17) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 2.1e-244) tmp = ((F / B) * t_0) - (x / B); elseif (F <= 1.8e-119) tmp = t_1; elseif (F <= 1.15e-60) tmp = ((F * t_0) - x) / B; elseif ((F <= 1.5e+107) || ~((F <= 6.8e+201))) tmp = t_1; else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+17], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e-244], N[(N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-119], t$95$1, If[LessEqual[F, 1.15e-60], N[(N[(N[(F * t$95$0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[Or[LessEqual[F, 1.5e+107], N[Not[LessEqual[F, 6.8e+201]], $MachinePrecision]], t$95$1, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-244}:\\
\;\;\;\;\frac{F}{B} \cdot t_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-60}:\\
\;\;\;\;\frac{F \cdot t_0 - x}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+107} \lor \neg \left(F \leq 6.8 \cdot 10^{+201}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -1e17Initial program 57.2%
+-commutative57.2%
unsub-neg57.2%
associate-*l/73.2%
associate-*r/73.2%
*-commutative73.2%
Simplified73.4%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 73.3%
if -1e17 < F < 2.10000000000000002e-244Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in B around 0 66.0%
Taylor expanded in F around 0 65.7%
if 2.10000000000000002e-244 < F < 1.8e-119 or 1.1500000000000001e-60 < F < 1.50000000000000012e107 or 6.8e201 < F Initial program 81.1%
Taylor expanded in B around 0 66.7%
Taylor expanded in F around inf 68.7%
if 1.8e-119 < F < 1.1500000000000001e-60Initial program 99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
*-commutative99.9%
fma-def99.9%
fma-def99.9%
metadata-eval99.9%
metadata-eval99.9%
distribute-lft-neg-in99.9%
associate-*r/99.9%
*-rgt-identity99.9%
Simplified99.9%
Taylor expanded in B around 0 82.0%
Taylor expanded in F around 0 82.0%
if 1.50000000000000012e107 < F < 6.8e201Initial program 45.2%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification71.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.65e-212)
(- (/ -1.0 B) t_0)
(if (<= F 1.22e-223)
(- (* B -0.16666666666666666) t_0)
(if (or (<= F 6.2e+106) (not (<= F 7e+201)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
(- (/ 1.0 (sin B)) (+ (/ x B) (* -0.3333333333333333 (* B x)))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.65e-212) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.22e-223) {
tmp = (B * -0.16666666666666666) - t_0;
} else if ((F <= 6.2e+106) || !(F <= 7e+201)) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else {
tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.65d-212)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 1.22d-223) then
tmp = (b * (-0.16666666666666666d0)) - t_0
else if ((f <= 6.2d+106) .or. (.not. (f <= 7d+201))) then
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
else
tmp = (1.0d0 / sin(b)) - ((x / b) + ((-0.3333333333333333d0) * (b * x)))
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.65e-212) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.22e-223) {
tmp = (B * -0.16666666666666666) - t_0;
} else if ((F <= 6.2e+106) || !(F <= 7e+201)) {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
} else {
tmp = (1.0 / Math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x)));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.65e-212: tmp = (-1.0 / B) - t_0 elif F <= 1.22e-223: tmp = (B * -0.16666666666666666) - t_0 elif (F <= 6.2e+106) or not (F <= 7e+201): tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) else: tmp = (1.0 / math.sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.65e-212) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 1.22e-223) tmp = Float64(Float64(B * -0.16666666666666666) - t_0); elseif ((F <= 6.2e+106) || !(F <= 7e+201)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / B) + Float64(-0.3333333333333333 * Float64(B * x)))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.65e-212) tmp = (-1.0 / B) - t_0; elseif (F <= 1.22e-223) tmp = (B * -0.16666666666666666) - t_0; elseif ((F <= 6.2e+106) || ~((F <= 7e+201))) tmp = (x * (-1.0 / tan(B))) + (1.0 / B); else tmp = (1.0 / sin(B)) - ((x / B) + (-0.3333333333333333 * (B * x))); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.65e-212], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.22e-223], N[(N[(B * -0.16666666666666666), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, 6.2e+106], N[Not[LessEqual[F, 7e+201]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / B), $MachinePrecision] + N[(-0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.65 \cdot 10^{-212}:\\
\;\;\;\;\frac{-1}{B} - t_0\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-223}:\\
\;\;\;\;B \cdot -0.16666666666666666 - t_0\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{+106} \lor \neg \left(F \leq 7 \cdot 10^{+201}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \left(\frac{x}{B} + -0.3333333333333333 \cdot \left(B \cdot x\right)\right)\\
\end{array}
\end{array}
if F < -1.6500000000000001e-212Initial program 70.9%
+-commutative70.9%
unsub-neg70.9%
associate-*l/81.7%
associate-*r/81.7%
*-commutative81.7%
Simplified81.9%
Taylor expanded in F around -inf 79.2%
Taylor expanded in B around 0 65.5%
if -1.6500000000000001e-212 < F < 1.21999999999999998e-223Initial program 99.4%
+-commutative99.4%
unsub-neg99.4%
associate-*l/99.4%
associate-*r/99.4%
*-commutative99.4%
Simplified99.7%
Taylor expanded in F around -inf 38.5%
Taylor expanded in B around 0 41.6%
Taylor expanded in B around inf 71.3%
*-commutative71.3%
Simplified71.3%
if 1.21999999999999998e-223 < F < 6.1999999999999999e106 or 7.0000000000000004e201 < F Initial program 82.9%
Taylor expanded in B around 0 68.8%
Taylor expanded in F around inf 65.0%
if 6.1999999999999999e106 < F < 7.0000000000000004e201Initial program 45.2%
Taylor expanded in F around inf 99.6%
Taylor expanded in B around 0 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification67.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5.9e-213)
(- (/ -1.0 B) t_0)
(if (<= F 1.7e-226)
(- (* B -0.16666666666666666) t_0)
(if (or (<= F 1.15e+175) (not (<= F 6.8e+201)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 B))
(/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.9e-213) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.7e-226) {
tmp = (B * -0.16666666666666666) - t_0;
} else if ((F <= 1.15e+175) || !(F <= 6.8e+201)) {
tmp = (x * (-1.0 / tan(B))) + (1.0 / B);
} else {
tmp = 1.0 / sin(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 = x / tan(b)
if (f <= (-5.9d-213)) then
tmp = ((-1.0d0) / b) - t_0
else if (f <= 1.7d-226) then
tmp = (b * (-0.16666666666666666d0)) - t_0
else if ((f <= 1.15d+175) .or. (.not. (f <= 6.8d+201))) then
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / b)
else
tmp = 1.0d0 / sin(b)
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 <= -5.9e-213) {
tmp = (-1.0 / B) - t_0;
} else if (F <= 1.7e-226) {
tmp = (B * -0.16666666666666666) - t_0;
} else if ((F <= 1.15e+175) || !(F <= 6.8e+201)) {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / B);
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.9e-213: tmp = (-1.0 / B) - t_0 elif F <= 1.7e-226: tmp = (B * -0.16666666666666666) - t_0 elif (F <= 1.15e+175) or not (F <= 6.8e+201): tmp = (x * (-1.0 / math.tan(B))) + (1.0 / B) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.9e-213) tmp = Float64(Float64(-1.0 / B) - t_0); elseif (F <= 1.7e-226) tmp = Float64(Float64(B * -0.16666666666666666) - t_0); elseif ((F <= 1.15e+175) || !(F <= 6.8e+201)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5.9e-213) tmp = (-1.0 / B) - t_0; elseif (F <= 1.7e-226) tmp = (B * -0.16666666666666666) - t_0; elseif ((F <= 1.15e+175) || ~((F <= 6.8e+201))) tmp = (x * (-1.0 / tan(B))) + (1.0 / B); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.9e-213], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.7e-226], N[(N[(B * -0.16666666666666666), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, 1.15e+175], N[Not[LessEqual[F, 6.8e+201]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.9 \cdot 10^{-213}:\\
\;\;\;\;\frac{-1}{B} - t_0\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-226}:\\
\;\;\;\;B \cdot -0.16666666666666666 - t_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{+175} \lor \neg \left(F \leq 6.8 \cdot 10^{+201}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -5.8999999999999998e-213Initial program 70.9%
+-commutative70.9%
unsub-neg70.9%
associate-*l/81.7%
associate-*r/81.7%
*-commutative81.7%
Simplified81.9%
Taylor expanded in F around -inf 79.2%
Taylor expanded in B around 0 65.5%
if -5.8999999999999998e-213 < F < 1.70000000000000004e-226Initial program 99.4%
+-commutative99.4%
unsub-neg99.4%
associate-*l/99.4%
associate-*r/99.4%
*-commutative99.4%
Simplified99.7%
Taylor expanded in F around -inf 38.5%
Taylor expanded in B around 0 41.6%
Taylor expanded in B around inf 71.3%
*-commutative71.3%
Simplified71.3%
if 1.70000000000000004e-226 < F < 1.15e175 or 6.8e201 < F Initial program 81.4%
Taylor expanded in B around 0 64.6%
Taylor expanded in F around inf 65.2%
if 1.15e175 < F < 6.8e201Initial program 11.2%
Taylor expanded in F around inf 99.1%
Taylor expanded in x around 0 82.3%
Final simplification66.8%
(FPCore (F B x) :precision binary64 (if (or (<= x -1e-29) (not (<= x 2.6e-62))) (- (/ -1.0 B) (/ x (tan B))) (/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1e-29) || !(x <= 2.6e-62)) {
tmp = (-1.0 / B) - (x / tan(B));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-1d-29)) .or. (.not. (x <= 2.6d-62))) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1e-29) || !(x <= 2.6e-62)) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1e-29) or not (x <= 2.6e-62): tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1e-29) || !(x <= 2.6e-62)) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1e-29) || ~((x <= 2.6e-62))) tmp = (-1.0 / B) - (x / tan(B)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1e-29], N[Not[LessEqual[x, 2.6e-62]], $MachinePrecision]], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-29} \lor \neg \left(x \leq 2.6 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if x < -9.99999999999999943e-30 or 2.5999999999999999e-62 < x Initial program 82.6%
+-commutative82.6%
unsub-neg82.6%
associate-*l/95.6%
associate-*r/95.6%
*-commutative95.6%
Simplified95.8%
Taylor expanded in F around -inf 88.2%
Taylor expanded in B around 0 88.5%
if -9.99999999999999943e-30 < x < 2.5999999999999999e-62Initial program 69.2%
Taylor expanded in F around inf 32.6%
Taylor expanded in x around 0 32.6%
Final simplification61.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2.1e-120)
(+ (* B (- (* x 0.3333333333333333) 0.16666666666666666)) (/ (- -1.0 x) B))
(if (<= F 1.4e-29)
(- (* B -0.16666666666666666) (/ x (tan B)))
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-120) {
tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
} else if (F <= 1.4e-29) {
tmp = (B * -0.16666666666666666) - (x / tan(B));
} else {
tmp = 1.0 / sin(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-120)) then
tmp = (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0)) + (((-1.0d0) - x) / b)
else if (f <= 1.4d-29) then
tmp = (b * (-0.16666666666666666d0)) - (x / tan(b))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-120) {
tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
} else if (F <= 1.4e-29) {
tmp = (B * -0.16666666666666666) - (x / Math.tan(B));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-120: tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B) elif F <= 1.4e-29: tmp = (B * -0.16666666666666666) - (x / math.tan(B)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-120) tmp = Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)) + Float64(Float64(-1.0 - x) / B)); elseif (F <= 1.4e-29) tmp = Float64(Float64(B * -0.16666666666666666) - Float64(x / tan(B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.1e-120) tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B); elseif (F <= 1.4e-29) tmp = (B * -0.16666666666666666) - (x / tan(B)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-120], N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-29], N[(N[(B * -0.16666666666666666), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-120}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-29}:\\
\;\;\;\;B \cdot -0.16666666666666666 - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.1e-120Initial program 65.4%
+-commutative65.4%
unsub-neg65.4%
associate-*l/78.4%
associate-*r/78.3%
*-commutative78.3%
Simplified78.5%
Taylor expanded in F around -inf 87.6%
Taylor expanded in B around 0 56.4%
Taylor expanded in B around 0 52.2%
if -2.1e-120 < F < 1.4000000000000001e-29Initial program 99.4%
+-commutative99.4%
unsub-neg99.4%
associate-*l/99.4%
associate-*r/99.4%
*-commutative99.4%
Simplified99.6%
Taylor expanded in F around -inf 37.3%
Taylor expanded in B around 0 31.0%
Taylor expanded in B around inf 52.7%
*-commutative52.7%
Simplified52.7%
if 1.4000000000000001e-29 < F Initial program 64.9%
Taylor expanded in F around inf 96.4%
Taylor expanded in x around 0 53.0%
Final simplification52.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2e-120)
(+ (* B (- (* x 0.3333333333333333) 0.16666666666666666)) (/ (- -1.0 x) B))
(if (<= F 1.4e-29)
(- (/ (- x) B) (* B (* x -0.3333333333333333)))
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e-120) {
tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
} else if (F <= 1.4e-29) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} else {
tmp = 1.0 / sin(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 <= (-2d-120)) then
tmp = (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0)) + (((-1.0d0) - x) / b)
else if (f <= 1.4d-29) then
tmp = (-x / b) - (b * (x * (-0.3333333333333333d0)))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2e-120) {
tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
} else if (F <= 1.4e-29) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e-120: tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B) elif F <= 1.4e-29: tmp = (-x / B) - (B * (x * -0.3333333333333333)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e-120) tmp = Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)) + Float64(Float64(-1.0 - x) / B)); elseif (F <= 1.4e-29) tmp = Float64(Float64(Float64(-x) / B) - Float64(B * Float64(x * -0.3333333333333333))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2e-120) tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B); elseif (F <= 1.4e-29) tmp = (-x / B) - (B * (x * -0.3333333333333333)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e-120], N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e-29], N[(N[((-x) / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{-120}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-29}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.99999999999999996e-120Initial program 65.4%
+-commutative65.4%
unsub-neg65.4%
associate-*l/78.4%
associate-*r/78.3%
*-commutative78.3%
Simplified78.5%
Taylor expanded in F around -inf 87.6%
Taylor expanded in B around 0 56.4%
Taylor expanded in B around 0 52.2%
if -1.99999999999999996e-120 < F < 1.4000000000000001e-29Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 81.2%
mul-1-neg81.2%
*-commutative81.2%
associate-*l/81.4%
*-commutative81.4%
Simplified81.4%
Taylor expanded in B around 0 47.5%
*-commutative47.5%
distribute-rgt-out--47.5%
metadata-eval47.5%
Simplified47.5%
if 1.4000000000000001e-29 < F Initial program 64.9%
Taylor expanded in F around inf 96.4%
Taylor expanded in x around 0 53.0%
Final simplification50.9%
(FPCore (F B x)
:precision binary64
(if (<= F -8.6e-124)
(/ (- -1.0 x) B)
(if (<= F 1.7e-51)
(- (/ (- x) B) (* B (* x -0.3333333333333333)))
(- (/ (- 1.0 x) B) (/ x (* B (* F F)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.6e-124) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.7e-51) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} else {
tmp = ((1.0 - x) / B) - (x / (B * (F * F)));
}
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.6d-124)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.7d-51) then
tmp = (-x / b) - (b * (x * (-0.3333333333333333d0)))
else
tmp = ((1.0d0 - x) / b) - (x / (b * (f * f)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.6e-124) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.7e-51) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} else {
tmp = ((1.0 - x) / B) - (x / (B * (F * F)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.6e-124: tmp = (-1.0 - x) / B elif F <= 1.7e-51: tmp = (-x / B) - (B * (x * -0.3333333333333333)) else: tmp = ((1.0 - x) / B) - (x / (B * (F * F))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.6e-124) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.7e-51) tmp = Float64(Float64(Float64(-x) / B) - Float64(B * Float64(x * -0.3333333333333333))); else tmp = Float64(Float64(Float64(1.0 - x) / B) - Float64(x / Float64(B * Float64(F * F)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.6e-124) tmp = (-1.0 - x) / B; elseif (F <= 1.7e-51) tmp = (-x / B) - (B * (x * -0.3333333333333333)); else tmp = ((1.0 - x) / B) - (x / (B * (F * F))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.6e-124], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.7e-51], N[(N[((-x) / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.6 \cdot 10^{-124}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-51}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B} - \frac{x}{B \cdot \left(F \cdot F\right)}\\
\end{array}
\end{array}
if F < -8.6e-124Initial program 66.1%
+-commutative66.1%
fma-def66.1%
+-commutative66.1%
*-commutative66.1%
fma-def66.1%
fma-def66.1%
metadata-eval66.1%
metadata-eval66.1%
distribute-lft-neg-in66.1%
associate-*r/66.2%
*-rgt-identity66.2%
Simplified66.2%
Taylor expanded in B around 0 49.4%
Taylor expanded in F around -inf 51.9%
sub-neg51.9%
neg-mul-151.9%
distribute-neg-in51.9%
+-commutative51.9%
distribute-neg-in51.9%
metadata-eval51.9%
unsub-neg51.9%
Simplified51.9%
if -8.6e-124 < F < 1.70000000000000001e-51Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 80.3%
mul-1-neg80.3%
*-commutative80.3%
associate-*l/80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in B around 0 48.5%
*-commutative48.5%
distribute-rgt-out--48.5%
metadata-eval48.5%
Simplified48.5%
if 1.70000000000000001e-51 < F Initial program 65.7%
+-commutative65.7%
fma-def65.7%
+-commutative65.7%
*-commutative65.7%
fma-def65.7%
fma-def65.7%
metadata-eval65.7%
metadata-eval65.7%
distribute-lft-neg-in65.7%
associate-*r/65.7%
*-rgt-identity65.7%
Simplified65.7%
Taylor expanded in B around 0 32.5%
Taylor expanded in F around inf 38.3%
Taylor expanded in F around 0 38.3%
+-commutative38.3%
+-commutative38.3%
associate-+l+38.3%
associate-*r/38.3%
+-commutative38.3%
distribute-lft-in38.3%
metadata-eval38.3%
associate-*r*38.3%
metadata-eval38.3%
neg-mul-138.3%
unsub-neg38.3%
unpow238.3%
associate-*l*38.3%
mul-1-neg38.3%
unsub-neg38.3%
div-sub38.3%
Simplified38.3%
Taylor expanded in x around inf 38.5%
associate-*r/38.5%
neg-mul-138.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
Final simplification46.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2.1e-120)
(+ (* B (- (* x 0.3333333333333333) 0.16666666666666666)) (/ (- -1.0 x) B))
(if (<= F 1.2e-51)
(- (/ (- x) B) (* B (* x -0.3333333333333333)))
(- (/ (- 1.0 x) B) (/ x (* B (* F F)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-120) {
tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
} else if (F <= 1.2e-51) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} else {
tmp = ((1.0 - x) / B) - (x / (B * (F * F)));
}
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-120)) then
tmp = (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0)) + (((-1.0d0) - x) / b)
else if (f <= 1.2d-51) then
tmp = (-x / b) - (b * (x * (-0.3333333333333333d0)))
else
tmp = ((1.0d0 - x) / b) - (x / (b * (f * f)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-120) {
tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B);
} else if (F <= 1.2e-51) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} else {
tmp = ((1.0 - x) / B) - (x / (B * (F * F)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-120: tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B) elif F <= 1.2e-51: tmp = (-x / B) - (B * (x * -0.3333333333333333)) else: tmp = ((1.0 - x) / B) - (x / (B * (F * F))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-120) tmp = Float64(Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666)) + Float64(Float64(-1.0 - x) / B)); elseif (F <= 1.2e-51) tmp = Float64(Float64(Float64(-x) / B) - Float64(B * Float64(x * -0.3333333333333333))); else tmp = Float64(Float64(Float64(1.0 - x) / B) - Float64(x / Float64(B * Float64(F * F)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.1e-120) tmp = (B * ((x * 0.3333333333333333) - 0.16666666666666666)) + ((-1.0 - x) / B); elseif (F <= 1.2e-51) tmp = (-x / B) - (B * (x * -0.3333333333333333)); else tmp = ((1.0 - x) / B) - (x / (B * (F * F))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-120], N[(N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e-51], N[(N[((-x) / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-120}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-51}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B} - \frac{x}{B \cdot \left(F \cdot F\right)}\\
\end{array}
\end{array}
if F < -2.1e-120Initial program 65.4%
+-commutative65.4%
unsub-neg65.4%
associate-*l/78.4%
associate-*r/78.3%
*-commutative78.3%
Simplified78.5%
Taylor expanded in F around -inf 87.6%
Taylor expanded in B around 0 56.4%
Taylor expanded in B around 0 52.2%
if -2.1e-120 < F < 1.2e-51Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in F around 0 80.8%
mul-1-neg80.8%
*-commutative80.8%
associate-*l/80.9%
*-commutative80.9%
Simplified80.9%
Taylor expanded in B around 0 48.6%
*-commutative48.6%
distribute-rgt-out--48.6%
metadata-eval48.6%
Simplified48.6%
if 1.2e-51 < F Initial program 65.7%
+-commutative65.7%
fma-def65.7%
+-commutative65.7%
*-commutative65.7%
fma-def65.7%
fma-def65.7%
metadata-eval65.7%
metadata-eval65.7%
distribute-lft-neg-in65.7%
associate-*r/65.7%
*-rgt-identity65.7%
Simplified65.7%
Taylor expanded in B around 0 32.5%
Taylor expanded in F around inf 38.3%
Taylor expanded in F around 0 38.3%
+-commutative38.3%
+-commutative38.3%
associate-+l+38.3%
associate-*r/38.3%
+-commutative38.3%
distribute-lft-in38.3%
metadata-eval38.3%
associate-*r*38.3%
metadata-eval38.3%
neg-mul-138.3%
unsub-neg38.3%
unpow238.3%
associate-*l*38.3%
mul-1-neg38.3%
unsub-neg38.3%
div-sub38.3%
Simplified38.3%
Taylor expanded in x around inf 38.5%
associate-*r/38.5%
neg-mul-138.5%
*-commutative38.5%
unpow238.5%
Simplified38.5%
Final simplification46.6%
(FPCore (F B x)
:precision binary64
(if (<= F -8.6e-124)
(/ (- -1.0 x) B)
(if (<= F 1.4e-59)
(- (/ (- x) B) (* B (* x -0.3333333333333333)))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.6e-124) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-59) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} 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.6d-124)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.4d-59) then
tmp = (-x / b) - (b * (x * (-0.3333333333333333d0)))
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.6e-124) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-59) {
tmp = (-x / B) - (B * (x * -0.3333333333333333));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.6e-124: tmp = (-1.0 - x) / B elif F <= 1.4e-59: tmp = (-x / B) - (B * (x * -0.3333333333333333)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.6e-124) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4e-59) tmp = Float64(Float64(Float64(-x) / B) - Float64(B * Float64(x * -0.3333333333333333))); 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.6e-124) tmp = (-1.0 - x) / B; elseif (F <= 1.4e-59) tmp = (-x / B) - (B * (x * -0.3333333333333333)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.6e-124], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4e-59], N[(N[((-x) / B), $MachinePrecision] - N[(B * N[(x * -0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.6 \cdot 10^{-124}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-59}:\\
\;\;\;\;\frac{-x}{B} - B \cdot \left(x \cdot -0.3333333333333333\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.6e-124Initial program 66.1%
+-commutative66.1%
fma-def66.1%
+-commutative66.1%
*-commutative66.1%
fma-def66.1%
fma-def66.1%
metadata-eval66.1%
metadata-eval66.1%
distribute-lft-neg-in66.1%
associate-*r/66.2%
*-rgt-identity66.2%
Simplified66.2%
Taylor expanded in B around 0 49.4%
Taylor expanded in F around -inf 51.9%
sub-neg51.9%
neg-mul-151.9%
distribute-neg-in51.9%
+-commutative51.9%
distribute-neg-in51.9%
metadata-eval51.9%
unsub-neg51.9%
Simplified51.9%
if -8.6e-124 < F < 1.3999999999999999e-59Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 80.3%
mul-1-neg80.3%
*-commutative80.3%
associate-*l/80.4%
*-commutative80.4%
Simplified80.4%
Taylor expanded in B around 0 48.5%
*-commutative48.5%
distribute-rgt-out--48.5%
metadata-eval48.5%
Simplified48.5%
if 1.3999999999999999e-59 < F Initial program 65.7%
+-commutative65.7%
fma-def65.7%
+-commutative65.7%
*-commutative65.7%
fma-def65.7%
fma-def65.7%
metadata-eval65.7%
metadata-eval65.7%
distribute-lft-neg-in65.7%
associate-*r/65.7%
*-rgt-identity65.7%
Simplified65.7%
Taylor expanded in B around 0 32.5%
Taylor expanded in F around inf 38.5%
neg-mul-138.5%
sub-neg38.5%
Simplified38.5%
Final simplification46.5%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e-120) (/ (- -1.0 x) B) (if (<= F 2e-52) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-120) {
tmp = (-1.0 - x) / B;
} else if (F <= 2e-52) {
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.1d-120)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2d-52) 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.1e-120) {
tmp = (-1.0 - x) / B;
} else if (F <= 2e-52) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-120: tmp = (-1.0 - x) / B elif F <= 2e-52: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-120) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2e-52) tmp = Float64(Float64(-x) / 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.1e-120) tmp = (-1.0 - x) / B; elseif (F <= 2e-52) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-120], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2e-52], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-120}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-52}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.1e-120Initial program 65.4%
+-commutative65.4%
fma-def65.4%
+-commutative65.4%
*-commutative65.4%
fma-def65.4%
fma-def65.4%
metadata-eval65.4%
metadata-eval65.4%
distribute-lft-neg-in65.4%
associate-*r/65.5%
*-rgt-identity65.5%
Simplified65.5%
Taylor expanded in B around 0 49.3%
Taylor expanded in F around -inf 51.8%
sub-neg51.8%
neg-mul-151.8%
distribute-neg-in51.8%
+-commutative51.8%
distribute-neg-in51.8%
metadata-eval51.8%
unsub-neg51.8%
Simplified51.8%
if -2.1e-120 < F < 2e-52Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in B around 0 58.7%
Taylor expanded in F around 0 48.1%
associate-*r/48.1%
neg-mul-148.1%
Simplified48.1%
if 2e-52 < F Initial program 65.7%
+-commutative65.7%
fma-def65.7%
+-commutative65.7%
*-commutative65.7%
fma-def65.7%
fma-def65.7%
metadata-eval65.7%
metadata-eval65.7%
distribute-lft-neg-in65.7%
associate-*r/65.7%
*-rgt-identity65.7%
Simplified65.7%
Taylor expanded in B around 0 32.5%
Taylor expanded in F around inf 38.5%
neg-mul-138.5%
sub-neg38.5%
Simplified38.5%
Final simplification46.4%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e-120) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-120) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.1d-120)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-120) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-120: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-120) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.1e-120) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-120], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-120}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.1e-120Initial program 65.4%
+-commutative65.4%
fma-def65.4%
+-commutative65.4%
*-commutative65.4%
fma-def65.4%
fma-def65.4%
metadata-eval65.4%
metadata-eval65.4%
distribute-lft-neg-in65.4%
associate-*r/65.5%
*-rgt-identity65.5%
Simplified65.5%
Taylor expanded in B around 0 49.3%
Taylor expanded in F around -inf 51.8%
sub-neg51.8%
neg-mul-151.8%
distribute-neg-in51.8%
+-commutative51.8%
distribute-neg-in51.8%
metadata-eval51.8%
unsub-neg51.8%
Simplified51.8%
if -2.1e-120 < F Initial program 82.2%
+-commutative82.2%
fma-def82.2%
+-commutative82.2%
*-commutative82.2%
fma-def82.2%
fma-def82.2%
metadata-eval82.2%
metadata-eval82.2%
distribute-lft-neg-in82.2%
associate-*r/82.4%
*-rgt-identity82.4%
Simplified82.4%
Taylor expanded in B around 0 45.3%
Taylor expanded in F around 0 33.0%
associate-*r/33.0%
neg-mul-133.0%
Simplified33.0%
Final simplification39.9%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 76.1%
+-commutative76.1%
fma-def76.1%
+-commutative76.1%
*-commutative76.1%
fma-def76.1%
fma-def76.1%
metadata-eval76.1%
metadata-eval76.1%
distribute-lft-neg-in76.1%
associate-*r/76.2%
*-rgt-identity76.2%
Simplified76.2%
Taylor expanded in B around 0 46.8%
Taylor expanded in F around 0 32.3%
associate-*r/32.3%
neg-mul-132.3%
Simplified32.3%
Final simplification32.3%
(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 76.1%
+-commutative76.1%
fma-def76.1%
+-commutative76.1%
*-commutative76.1%
fma-def76.1%
fma-def76.1%
metadata-eval76.1%
metadata-eval76.1%
distribute-lft-neg-in76.1%
associate-*r/76.2%
*-rgt-identity76.2%
Simplified76.2%
Taylor expanded in B around 0 46.8%
Taylor expanded in F around -inf 31.5%
sub-neg31.5%
neg-mul-131.5%
distribute-neg-in31.5%
+-commutative31.5%
distribute-neg-in31.5%
metadata-eval31.5%
unsub-neg31.5%
Simplified31.5%
Taylor expanded in x around 0 10.8%
Final simplification10.8%
herbie shell --seed 2023195
(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))))))