
(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 (/ 1.0 (sin B))))
(if (<= F -1.2e+167)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 1e+147)
(fma F (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) t_0) (/ (- x) (tan B)))
(- t_0 (* (/ x (sin B)) (cos B)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -1.2e+167) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 1e+147) {
tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * t_0), (-x / tan(B)));
} else {
tmp = t_0 - ((x / sin(B)) * cos(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -1.2e+167) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 1e+147) tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * t_0), Float64(Float64(-x) / tan(B))); else tmp = Float64(t_0 - Float64(Float64(x / sin(B)) * cos(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e+167], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+147], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * t$95$0), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+147}:\\
\;\;\;\;\mathsf{fma}\left(F, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot t\_0, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \frac{x}{\sin B} \cdot \cos B\\
\end{array}
\end{array}
if F < -1.19999999999999999e167Initial program 30.1%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Applied rewrites99.9%
if -1.19999999999999999e167 < F < 9.9999999999999998e146Initial program 94.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
if 9.9999999999999998e146 < F Initial program 24.7%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -320000000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 110000000.0)
(fma (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) F t_0)
(fma (/ 1.0 (sin B)) 1.0 t_0)))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -320000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 110000000.0) {
tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, t_0);
} else {
tmp = fma((1.0 / sin(B)), 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -320000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 110000000.0) tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, t_0); else tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -320000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -320000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
\end{array}
\end{array}
if F < -3.2e8Initial program 54.4%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.9%
if -3.2e8 < F < 1.1e8Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
if 1.1e8 < F Initial program 54.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites70.9%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites70.8%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.2e+167)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 105000000.0)
(fma t_0 (/ (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ 1.0 F)) t_1)
(fma t_0 1.0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.2e+167) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 105000000.0) {
tmp = fma(t_0, (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) / (1.0 / F)), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.2e+167) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 105000000.0) tmp = fma(t_0, Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) / Float64(1.0 / F)), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e+167], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 105000000.0], N[(t$95$0 * N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(1.0 / F), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 105000000:\\
\;\;\;\;\mathsf{fma}\left(t\_0, \frac{\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\frac{1}{F}}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
\end{array}
if F < -1.19999999999999999e167Initial program 30.1%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Applied rewrites99.9%
if -1.19999999999999999e167 < F < 1.05e8Initial program 94.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites99.6%
if 1.05e8 < F Initial program 54.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites70.9%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites70.8%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+22)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 105000000.0)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (* (cos B) x)) (sin B))
(fma (/ 1.0 (sin B)) 1.0 (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+22) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 105000000.0) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (cos(B) * x)) / sin(B);
} else {
tmp = fma((1.0 / sin(B)), 1.0, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+22) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 105000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(cos(B) * x)) / sin(B)); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 105000000.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 105000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -2e22Initial program 53.6%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.9%
if -2e22 < F < 1.05e8Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
if 1.05e8 < F Initial program 54.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites70.9%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites70.8%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.4)
(/ (- (/ F (sqrt (fma x 2.0 2.0))) (* (cos B) x)) (sin B))
(fma (/ 1.0 (sin B)) 1.0 (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.4) {
tmp = ((F / sqrt(fma(x, 2.0, 2.0))) - (cos(B) * x)) / sin(B);
} else {
tmp = fma((1.0 / sin(B)), 1.0, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, 2.0))) - Float64(cos(B) * x)) / sin(B)); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - \cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 54.4%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.9%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.0
Applied rewrites98.0%
if 1.3999999999999999 < F Initial program 54.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites71.3%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites71.2%
Taylor expanded in F around inf
Applied rewrites99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2500.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1550.0)
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))
(fma (/ 1.0 (sin B)) 1.0 (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2500.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1550.0) {
tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
} else {
tmp = fma((1.0 / sin(B)), 1.0, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2500.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1550.0) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1550.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2500:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1550:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -2500Initial program 54.4%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.9%
if -2500 < F < 1550Initial program 99.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 1550 < F Initial program 54.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites71.3%
lift-fma.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
associate-*l/N/A
div-invN/A
times-fracN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites71.2%
Taylor expanded in F around inf
Applied rewrites99.6%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2500.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1820.0)
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2500.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1820.0) {
tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2500.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1820.0) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2500.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1820.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2500:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1820:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2500Initial program 54.4%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.9%
if -2500 < F < 1820Initial program 99.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 1820 < F Initial program 54.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites71.3%
Applied rewrites71.2%
Taylor expanded in F around inf
Applied rewrites99.6%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2500.0)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1820.0)
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2500.0) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1820.0) {
tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2500.0) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1820.0) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2500.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1820.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2500:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1820:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2500Initial program 54.4%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.8%
if -2500 < F < 1820Initial program 99.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 1820 < F Initial program 54.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites71.3%
Applied rewrites71.2%
Taylor expanded in F around inf
Applied rewrites99.6%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2500.0)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 5.3e-40)
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))
(if (<= F 1.35e+154)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2500.0) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 5.3e-40) {
tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
} else if (F <= 1.35e+154) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2500.0) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 5.3e-40) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)); elseif (F <= 1.35e+154) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2500.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.3e-40], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e+154], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2500:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 5.3 \cdot 10^{-40}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2500Initial program 54.4%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.8%
if -2500 < F < 5.3000000000000002e-40Initial program 99.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6484.0
Applied rewrites84.0%
if 5.3000000000000002e-40 < F < 1.35000000000000003e154Initial program 93.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.7%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6491.9
Applied rewrites91.9%
if 1.35000000000000003e154 < F Initial program 22.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6430.7
Applied rewrites30.7%
Taylor expanded in F around inf
Applied rewrites51.8%
Final simplification83.7%
(FPCore (F B x)
:precision binary64
(if (<= x -3.15e-16)
(/ (* (- x) (cos B)) (sin B))
(if (<= x 7.2e-58)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(/ (- x) (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (x <= -3.15e-16) {
tmp = (-x * cos(B)) / sin(B);
} else if (x <= 7.2e-58) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -3.15e-16) tmp = Float64(Float64(Float64(-x) * cos(B)) / sin(B)); elseif (x <= 7.2e-58) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -3.15e-16], N[(N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e-58], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.15 \cdot 10^{-16}:\\
\;\;\;\;\frac{\left(-x\right) \cdot \cos B}{\sin B}\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if x < -3.1499999999999999e-16Initial program 52.3%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6493.4
Applied rewrites93.4%
Applied rewrites93.6%
if -3.1499999999999999e-16 < x < 7.20000000000000019e-58Initial program 74.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites79.0%
Applied rewrites79.0%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6469.6
Applied rewrites69.6%
if 7.20000000000000019e-58 < x Initial program 85.8%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6492.0
Applied rewrites92.0%
Applied rewrites92.4%
Final simplification80.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -3.15e-16)
t_0
(if (<= x 7.2e-58)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
t_0))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -3.15e-16) {
tmp = t_0;
} else if (x <= 7.2e-58) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (x <= -3.15e-16) tmp = t_0; elseif (x <= 7.2e-58) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.15e-16], t$95$0, If[LessEqual[x, 7.2e-58], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;x \leq -3.15 \cdot 10^{-16}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-58}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.1499999999999999e-16 or 7.20000000000000019e-58 < x Initial program 76.6%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6492.4
Applied rewrites92.4%
Applied rewrites92.7%
if -3.1499999999999999e-16 < x < 7.20000000000000019e-58Initial program 74.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites79.0%
Applied rewrites79.0%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6469.6
Applied rewrites69.6%
(FPCore (F B x) :precision binary64 (if (<= B 4.4e-9) (/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B) (/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 4.4e-9) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 4.4e-9) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 4.4e-9], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 4.3999999999999997e-9Initial program 73.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6465.5
Applied rewrites65.5%
if 4.3999999999999997e-9 < B Initial program 82.6%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6447.7
Applied rewrites47.7%
Applied rewrites47.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2e+167)
(/
(fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
B)
(if (<= F 1500000.0)
(/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
(/ (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 (- 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e+167) {
tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
} else if (F <= 1500000.0) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.2e+167) tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B); elseif (F <= 1500000.0) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.2e+167], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1500000.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1500000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.19999999999999999e167Initial program 30.1%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites69.5%
if -1.19999999999999999e167 < F < 1.5e6Initial program 94.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6456.5
Applied rewrites56.5%
if 1.5e6 < F Initial program 54.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6442.6
Applied rewrites42.6%
Taylor expanded in F around inf
Applied rewrites54.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1e-29)
(/ (fma (* (/ x (* F F)) 2.0) 0.5 (- -1.0 x)) B)
(if (<= F 1.22e-113)
(/ (- x) B)
(if (<= F 3700000.0)
(/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) B)
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e-29) {
tmp = fma(((x / (F * F)) * 2.0), 0.5, (-1.0 - x)) / B;
} else if (F <= 1.22e-113) {
tmp = -x / B;
} else if (F <= 3700000.0) {
tmp = (sqrt((1.0 / fma(F, F, 2.0))) * F) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e-29) tmp = Float64(fma(Float64(Float64(x / Float64(F * F)) * 2.0), 0.5, Float64(-1.0 - x)) / B); elseif (F <= 1.22e-113) tmp = Float64(Float64(-x) / B); elseif (F <= 3700000.0) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e-29], N[(N[(N[(N[(x / N[(F * F), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * 0.5 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22e-113], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 3700000.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-113}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 3700000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.99999999999999943e-30Initial program 60.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6454.7
Applied rewrites54.7%
Taylor expanded in F around -inf
Applied rewrites59.8%
Taylor expanded in x around inf
Applied rewrites60.3%
if -9.99999999999999943e-30 < F < 1.21999999999999995e-113Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6450.0
Applied rewrites50.0%
Taylor expanded in F around 0
Applied rewrites37.7%
if 1.21999999999999995e-113 < F < 3.7e6Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6468.3
Applied rewrites68.3%
Taylor expanded in x around 0
Applied rewrites63.3%
if 3.7e6 < F Initial program 54.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.1
Applied rewrites43.1%
Taylor expanded in F around inf
Applied rewrites54.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1e-29)
(/ (fma (* (/ x (* F F)) 2.0) 0.5 (- -1.0 x)) B)
(if (<= F 1.22e-113)
(/ (- x) B)
(if (<= F 3700000.0)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F B))
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e-29) {
tmp = fma(((x / (F * F)) * 2.0), 0.5, (-1.0 - x)) / B;
} else if (F <= 1.22e-113) {
tmp = -x / B;
} else if (F <= 3700000.0) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e-29) tmp = Float64(fma(Float64(Float64(x / Float64(F * F)) * 2.0), 0.5, Float64(-1.0 - x)) / B); elseif (F <= 1.22e-113) tmp = Float64(Float64(-x) / B); elseif (F <= 3700000.0) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e-29], N[(N[(N[(N[(x / N[(F * F), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * 0.5 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22e-113], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 3700000.0], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-113}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 3700000:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.99999999999999943e-30Initial program 60.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6454.7
Applied rewrites54.7%
Taylor expanded in F around -inf
Applied rewrites59.8%
Taylor expanded in x around inf
Applied rewrites60.3%
if -9.99999999999999943e-30 < F < 1.21999999999999995e-113Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6450.0
Applied rewrites50.0%
Taylor expanded in F around 0
Applied rewrites37.7%
if 1.21999999999999995e-113 < F < 3.7e6Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6468.3
Applied rewrites68.3%
Taylor expanded in x around 0
Applied rewrites63.1%
if 3.7e6 < F Initial program 54.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.1
Applied rewrites43.1%
Taylor expanded in F around inf
Applied rewrites54.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2e+167)
(/
(fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
B)
(if (<= F 1000000.0)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(/ (fma (/ (fma x 2.0 2.0) (* F F)) -0.5 (- 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e+167) {
tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
} else if (F <= 1000000.0) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = fma((fma(x, 2.0, 2.0) / (F * F)), -0.5, (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.2e+167) tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B); elseif (F <= 1000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(fma(Float64(fma(x, 2.0, 2.0) / Float64(F * F)), -0.5, Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.2e+167], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1000000.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -0.5, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.19999999999999999e167Initial program 30.1%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites69.5%
if -1.19999999999999999e167 < F < 1e6Initial program 94.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6456.5
Applied rewrites56.5%
Applied rewrites56.5%
if 1e6 < F Initial program 54.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6442.6
Applied rewrites42.6%
Taylor expanded in F around inf
Applied rewrites54.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2e+167)
(/
(fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
B)
(if (<= F 150000000.0)
(/ (fma (sqrt (/ 1.0 (fma F F 2.0))) F (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e+167) {
tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
} else if (F <= 150000000.0) {
tmp = fma(sqrt((1.0 / fma(F, F, 2.0))), F, -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.2e+167) tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B); elseif (F <= 150000000.0) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, 2.0))), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.2e+167], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 150000000.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{+167}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 150000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.19999999999999999e167Initial program 30.1%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites69.5%
if -1.19999999999999999e167 < F < 1.5e8Initial program 94.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6456.1
Applied rewrites56.1%
Taylor expanded in x around 0
Applied rewrites55.8%
if 1.5e8 < F Initial program 54.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.1
Applied rewrites43.1%
Taylor expanded in F around inf
Applied rewrites54.7%
(FPCore (F B x) :precision binary64 (if (<= F -1e-29) (/ (fma (* (/ x (* F F)) 2.0) 0.5 (- -1.0 x)) B) (if (<= F 1.9e-117) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e-29) {
tmp = fma(((x / (F * F)) * 2.0), 0.5, (-1.0 - x)) / B;
} else if (F <= 1.9e-117) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e-29) tmp = Float64(fma(Float64(Float64(x / Float64(F * F)) * 2.0), 0.5, Float64(-1.0 - x)) / B); elseif (F <= 1.9e-117) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e-29], N[(N[(N[(N[(x / N[(F * F), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision] * 0.5 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-117], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{-29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{x}{F \cdot F} \cdot 2, 0.5, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.99999999999999943e-30Initial program 60.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6454.7
Applied rewrites54.7%
Taylor expanded in F around -inf
Applied rewrites59.8%
Taylor expanded in x around inf
Applied rewrites60.3%
if -9.99999999999999943e-30 < F < 1.89999999999999986e-117Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6449.4
Applied rewrites49.4%
Taylor expanded in F around 0
Applied rewrites37.0%
if 1.89999999999999986e-117 < F Initial program 65.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6449.6
Applied rewrites49.6%
Taylor expanded in F around inf
Applied rewrites45.0%
(FPCore (F B x)
:precision binary64
(if (<= F -9.6e-37)
(/
(fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) (- -1.0 x))
B)
(if (<= F 1.9e-117) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.6e-37) {
tmp = fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), (-1.0 - x)) / B;
} else if (F <= 1.9e-117) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9.6e-37) tmp = Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), Float64(-1.0 - x)) / B); elseif (F <= 1.9e-117) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9.6e-37], N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-117], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.59999999999999963e-37Initial program 62.0%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f6490.0
Applied rewrites90.0%
Taylor expanded in B around 0
Applied rewrites59.1%
if -9.59999999999999963e-37 < F < 1.89999999999999986e-117Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.8
Applied rewrites48.8%
Taylor expanded in F around 0
Applied rewrites37.0%
if 1.89999999999999986e-117 < F Initial program 65.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6449.6
Applied rewrites49.6%
Taylor expanded in F around inf
Applied rewrites45.0%
(FPCore (F B x) :precision binary64 (if (<= F -9.6e-37) (/ (- -1.0 x) B) (if (<= F 1.9e-117) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.6e-37) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.9e-117) {
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 <= (-9.6d-37)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.9d-117) 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 <= -9.6e-37) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.9e-117) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.6e-37: tmp = (-1.0 - x) / B elif F <= 1.9e-117: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.6e-37) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.9e-117) 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 <= -9.6e-37) tmp = (-1.0 - x) / B; elseif (F <= 1.9e-117) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.6e-37], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-117], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-117}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.59999999999999963e-37Initial program 62.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6455.2
Applied rewrites55.2%
Taylor expanded in F around -inf
Applied rewrites59.0%
if -9.59999999999999963e-37 < F < 1.89999999999999986e-117Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.8
Applied rewrites48.8%
Taylor expanded in F around 0
Applied rewrites37.0%
if 1.89999999999999986e-117 < F Initial program 65.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6449.6
Applied rewrites49.6%
Taylor expanded in F around inf
Applied rewrites45.0%
(FPCore (F B x) :precision binary64 (if (<= F -9.6e-37) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.6e-37) {
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 <= (-9.6d-37)) 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 <= -9.6e-37) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.6e-37: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.6e-37) 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 <= -9.6e-37) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.6e-37], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.6 \cdot 10^{-37}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -9.59999999999999963e-37Initial program 62.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6455.2
Applied rewrites55.2%
Taylor expanded in F around -inf
Applied rewrites59.0%
if -9.59999999999999963e-37 < F Initial program 80.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6449.2
Applied rewrites49.2%
Taylor expanded in F around 0
Applied rewrites30.1%
(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 75.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6450.9
Applied rewrites50.9%
Taylor expanded in F around 0
Applied rewrites32.5%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 75.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6450.9
Applied rewrites50.9%
Taylor expanded in F around -inf
Applied rewrites31.4%
Taylor expanded in x around 0
Applied rewrites8.5%
herbie shell --seed 2024240
(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))))))