
(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 24 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 (* (cos B) x)))
(if (<= F -100000000.0)
(/ (- -1.0 t_0) (sin B))
(if (<= F 2.1e+116)
(fma
(/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))
F
(/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -100000000.0) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 2.1e+116) {
tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, (-x / tan(B)));
} 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 <= -100000000.0) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 2.1e+116) tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(Float64(-x) / tan(B))); 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, -100000000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e+116], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $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 -100000000:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1e8Initial program 55.9%
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 rewrites75.3%
Applied rewrites75.4%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -1e8 < F < 2.1000000000000001e116Initial program 99.5%
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.8%
if 2.1000000000000001e116 < F Initial program 47.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 rewrites59.3%
Applied rewrites59.3%
Taylor expanded in F around inf
Applied rewrites99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+135)
(fma (- x) (/ (cos B) (sin B)) (/ -1.0 (sin B)))
(if (<= F 2e+75)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (* (cos B) x)) (sin B))
(fma (/ (/ 1.0 F) (sin B)) F (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+135) {
tmp = fma(-x, (cos(B) / sin(B)), (-1.0 / sin(B)));
} else if (F <= 2e+75) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (cos(B) * x)) / sin(B);
} else {
tmp = fma(((1.0 / F) / sin(B)), F, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+135) tmp = fma(Float64(-x), Float64(cos(B) / sin(B)), Float64(-1.0 / sin(B))); elseif (F <= 2e+75) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(cos(B) * x)) / sin(B)); else tmp = fma(Float64(Float64(1.0 / F) / sin(B)), F, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+135], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+75], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{\cos B}{\sin B}, \frac{-1}{\sin B}\right)\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+75}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{F}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -9.99999999999999962e134Initial program 32.9%
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.6
Applied rewrites99.6%
if -9.99999999999999962e134 < F < 1.99999999999999985e75Initial program 97.5%
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.7%
Applied rewrites99.6%
if 1.99999999999999985e75 < F Initial program 56.4%
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 rewrites66.4%
Taylor expanded in F around inf
lower-/.f6499.7
Applied rewrites99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B)))
(t_1 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
(if (<= F -128000000000.0)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F -3.2e-36)
(/ 1.0 (/ (sin B) (fma t_1 F (- x))))
(if (<= F 5.3e-173)
(fma (/ t_1 B) F t_0)
(if (<= F 1.62)
(fma (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) F (/ (- x) B))
(fma (/ (/ 1.0 F) (sin B)) F t_0)))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double tmp;
if (F <= -128000000000.0) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= -3.2e-36) {
tmp = 1.0 / (sin(B) / fma(t_1, F, -x));
} else if (F <= 5.3e-173) {
tmp = fma((t_1 / B), F, t_0);
} else if (F <= 1.62) {
tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, (-x / B));
} else {
tmp = fma(((1.0 / F) / sin(B)), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) tmp = 0.0 if (F <= -128000000000.0) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= -3.2e-36) tmp = Float64(1.0 / Float64(sin(B) / fma(t_1, F, Float64(-x)))); elseif (F <= 5.3e-173) tmp = fma(Float64(t_1 / B), F, t_0); elseif (F <= 1.62) tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(Float64(-x) / B)); else tmp = fma(Float64(Float64(1.0 / F) / sin(B)), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -128000000000.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.2e-36], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(t$95$1 * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.3e-173], N[(N[(t$95$1 / B), $MachinePrecision] * F + t$95$0), $MachinePrecision], If[LessEqual[F, 1.62], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
\mathbf{if}\;F \leq -128000000000:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq -3.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left(t\_1, F, -x\right)}}\\
\mathbf{elif}\;F \leq 5.3 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_1}{B}, F, t\_0\right)\\
\mathbf{elif}\;F \leq 1.62:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{F}}{\sin B}, F, t\_0\right)\\
\end{array}
\end{array}
if F < -1.28e11Initial program 55.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 rewrites75.0%
Applied rewrites75.0%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -1.28e11 < F < -3.20000000000000021e-36Initial program 99.4%
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%
Applied rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6499.6
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6493.4
Applied rewrites93.4%
if -3.20000000000000021e-36 < F < 5.29999999999999964e-173Initial program 99.5%
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.8%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.5
Applied rewrites96.5%
if 5.29999999999999964e-173 < F < 1.6200000000000001Initial program 99.4%
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.5%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6487.5
Applied rewrites87.5%
if 1.6200000000000001 < F Initial program 62.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 rewrites71.0%
Taylor expanded in F around inf
lower-/.f6499.5
Applied rewrites99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B)))
(t_1 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
(if (<= F -128000000000.0)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F -3.2e-36)
(/ 1.0 (/ (sin B) (fma t_1 F (- x))))
(if (<= F 3.8e-173)
(fma (/ t_1 B) F t_0)
(if (<= F 1.62)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(fma (/ (/ 1.0 F) (sin B)) F t_0)))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double tmp;
if (F <= -128000000000.0) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= -3.2e-36) {
tmp = 1.0 / (sin(B) / fma(t_1, F, -x));
} else if (F <= 3.8e-173) {
tmp = fma((t_1 / B), F, t_0);
} else if (F <= 1.62) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = fma(((1.0 / F) / sin(B)), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) tmp = 0.0 if (F <= -128000000000.0) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= -3.2e-36) tmp = Float64(1.0 / Float64(sin(B) / fma(t_1, F, Float64(-x)))); elseif (F <= 3.8e-173) tmp = fma(Float64(t_1 / B), F, t_0); elseif (F <= 1.62) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); else tmp = fma(Float64(Float64(1.0 / F) / sin(B)), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -128000000000.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.2e-36], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(t$95$1 * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-173], N[(N[(t$95$1 / B), $MachinePrecision] * F + t$95$0), $MachinePrecision], If[LessEqual[F, 1.62], 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[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
\mathbf{if}\;F \leq -128000000000:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq -3.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left(t\_1, F, -x\right)}}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_1}{B}, F, t\_0\right)\\
\mathbf{elif}\;F \leq 1.62:\\
\;\;\;\;\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}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{F}}{\sin B}, F, t\_0\right)\\
\end{array}
\end{array}
if F < -1.28e11Initial program 55.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 rewrites75.0%
Applied rewrites75.0%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -1.28e11 < F < -3.20000000000000021e-36Initial program 99.4%
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%
Applied rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6499.6
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6493.4
Applied rewrites93.4%
if -3.20000000000000021e-36 < F < 3.8000000000000003e-173Initial program 99.5%
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.8%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.5
Applied rewrites96.5%
if 3.8000000000000003e-173 < F < 1.6200000000000001Initial program 99.4%
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.5%
Applied rewrites99.6%
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.f6486.8
Applied rewrites86.8%
if 1.6200000000000001 < F Initial program 62.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 rewrites71.0%
Taylor expanded in F around inf
lower-/.f6499.5
Applied rewrites99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.35e+166)
(/ (- -1.0 t_0) (sin B))
(if (<= F 2e+75)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) t_0) (sin B))
(fma (/ (/ 1.0 F) (sin B)) F (/ (- x) (tan B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.35e+166) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 2e+75) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - t_0) / sin(B);
} else {
tmp = fma(((1.0 / F) / sin(B)), F, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.35e+166) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 2e+75) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - t_0) / sin(B)); else tmp = fma(Float64(Float64(1.0 / F) / sin(B)), F, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.35e+166], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+75], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.35 \cdot 10^{+166}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+75}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{F}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -2.35e166Initial program 25.4%
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 rewrites49.1%
Applied rewrites49.0%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -2.35e166 < F < 1.99999999999999985e75Initial program 95.9%
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.7%
Applied rewrites99.6%
if 1.99999999999999985e75 < F Initial program 56.4%
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 rewrites66.4%
Taylor expanded in F around inf
lower-/.f6499.7
Applied rewrites99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -6000000.0)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 1.42)
(- (/ (/ F (sin B)) (sqrt (fma 2.0 x 2.0))) (/ x (tan B)))
(fma (/ (/ 1.0 F) (sin B)) F (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6000000.0) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 1.42) {
tmp = ((F / sin(B)) / sqrt(fma(2.0, x, 2.0))) - (x / tan(B));
} else {
tmp = fma(((1.0 / F) / sin(B)), F, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6000000.0) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 1.42) tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(2.0, x, 2.0))) - Float64(x / tan(B))); else tmp = fma(Float64(Float64(1.0 / F) / sin(B)), F, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6000000.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6000000:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{F}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -6e6Initial program 55.9%
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 rewrites75.3%
Applied rewrites75.4%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -6e6 < F < 1.4199999999999999Initial program 99.5%
Taylor expanded in F around 0
sub-negN/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
associate-*r/N/A
associate-*l/N/A
*-lft-identityN/A
associate-*l/N/A
lower-fma.f64N/A
Applied rewrites99.1%
Applied rewrites99.2%
if 1.4199999999999999 < F Initial program 62.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 rewrites71.0%
Taylor expanded in F around inf
lower-/.f6499.5
Applied rewrites99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -6000000.0)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1.42)
(/ (- (/ F (sqrt (fma x 2.0 2.0))) t_0) (sin B))
(fma (/ (/ 1.0 F) (sin B)) F (/ (- x) (tan B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -6000000.0) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1.42) {
tmp = ((F / sqrt(fma(x, 2.0, 2.0))) - t_0) / sin(B);
} else {
tmp = fma(((1.0 / F) / sin(B)), F, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -6000000.0) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1.42) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, 2.0))) - t_0) / sin(B)); else tmp = fma(Float64(Float64(1.0 / F) / sin(B)), F, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -6000000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -6000000:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{1}{F}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -6e6Initial program 55.9%
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 rewrites75.3%
Applied rewrites75.4%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -6e6 < F < 1.4199999999999999Initial program 99.5%
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.7%
Applied rewrites99.6%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.1
Applied rewrites99.1%
if 1.4199999999999999 < F Initial program 62.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 rewrites71.0%
Taylor expanded in F around inf
lower-/.f6499.5
Applied rewrites99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
(if (<= F -128000000000.0)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F -3.2e-36)
(/ 1.0 (/ (sin B) (fma t_0 F (- x))))
(if (<= F 3.8e-173)
(fma (/ t_0 B) F (/ (- x) (tan B)))
(if (<= F 1.62)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(- (/ 1.0 (sin B)) (* (/ 1.0 (tan B)) x))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double tmp;
if (F <= -128000000000.0) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= -3.2e-36) {
tmp = 1.0 / (sin(B) / fma(t_0, F, -x));
} else if (F <= 3.8e-173) {
tmp = fma((t_0 / B), F, (-x / tan(B)));
} else if (F <= 1.62) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = (1.0 / sin(B)) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) tmp = 0.0 if (F <= -128000000000.0) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= -3.2e-36) tmp = Float64(1.0 / Float64(sin(B) / fma(t_0, F, Float64(-x)))); elseif (F <= 3.8e-173) tmp = fma(Float64(t_0 / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 1.62) 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 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -128000000000.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.2e-36], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-173], N[(N[(t$95$0 / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.62], 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 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
\mathbf{if}\;F \leq -128000000000:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq -3.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left(t\_0, F, -x\right)}}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.62:\\
\;\;\;\;\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}{\sin B} - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if F < -1.28e11Initial program 55.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 rewrites75.0%
Applied rewrites75.0%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -1.28e11 < F < -3.20000000000000021e-36Initial program 99.4%
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%
Applied rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6499.6
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6493.4
Applied rewrites93.4%
if -3.20000000000000021e-36 < F < 3.8000000000000003e-173Initial program 99.5%
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.8%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.5
Applied rewrites96.5%
if 3.8000000000000003e-173 < F < 1.6200000000000001Initial program 99.4%
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.5%
Applied rewrites99.6%
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.f6486.8
Applied rewrites86.8%
if 1.6200000000000001 < F Initial program 62.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.5
Applied rewrites99.5%
Final simplification96.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))) (t_1 (* (cos B) x)))
(if (<= F -128000000000.0)
(/ (- -1.0 t_1) (sin B))
(if (<= F -3.2e-36)
(/ 1.0 (/ (sin B) (fma t_0 F (- x))))
(if (<= F 3.8e-173)
(fma (/ t_0 B) F (/ (- x) (tan B)))
(if (<= F 1.62)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(/ (- 1.0 t_1) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double t_1 = cos(B) * x;
double tmp;
if (F <= -128000000000.0) {
tmp = (-1.0 - t_1) / sin(B);
} else if (F <= -3.2e-36) {
tmp = 1.0 / (sin(B) / fma(t_0, F, -x));
} else if (F <= 3.8e-173) {
tmp = fma((t_0 / B), F, (-x / tan(B)));
} else if (F <= 1.62) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = (1.0 - t_1) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) t_1 = Float64(cos(B) * x) tmp = 0.0 if (F <= -128000000000.0) tmp = Float64(Float64(-1.0 - t_1) / sin(B)); elseif (F <= -3.2e-36) tmp = Float64(1.0 / Float64(sin(B) / fma(t_0, F, Float64(-x)))); elseif (F <= 3.8e-173) tmp = fma(Float64(t_0 / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 1.62) 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 - t_1) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -128000000000.0], N[(N[(-1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.2e-36], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-173], N[(N[(t$95$0 / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.62], 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 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -128000000000:\\
\;\;\;\;\frac{-1 - t\_1}{\sin B}\\
\mathbf{elif}\;F \leq -3.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left(t\_0, F, -x\right)}}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.62:\\
\;\;\;\;\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 - t\_1}{\sin B}\\
\end{array}
\end{array}
if F < -1.28e11Initial program 55.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 rewrites75.0%
Applied rewrites75.0%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -1.28e11 < F < -3.20000000000000021e-36Initial program 99.4%
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%
Applied rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6499.6
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6493.4
Applied rewrites93.4%
if -3.20000000000000021e-36 < F < 3.8000000000000003e-173Initial program 99.5%
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.8%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.5
Applied rewrites96.5%
if 3.8000000000000003e-173 < F < 1.6200000000000001Initial program 99.4%
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.5%
Applied rewrites99.6%
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.f6486.8
Applied rewrites86.8%
if 1.6200000000000001 < F Initial program 62.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 rewrites71.0%
Applied rewrites70.9%
Taylor expanded in F around inf
Applied rewrites99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
(if (<= F -128000000000.0)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F -3.2e-36)
(/ 1.0 (/ (sin B) (fma t_0 F (- x))))
(if (<= F 3.8e-173)
(fma (/ t_0 B) F (/ (- x) (tan B)))
(if (<= F 1.32e+157)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(-
(/ (fma 0.16666666666666666 (* B B) 1.0) B)
(* (/ 1.0 (tan B)) x))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double tmp;
if (F <= -128000000000.0) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= -3.2e-36) {
tmp = 1.0 / (sin(B) / fma(t_0, F, -x));
} else if (F <= 3.8e-173) {
tmp = fma((t_0 / B), F, (-x / tan(B)));
} else if (F <= 1.32e+157) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = (fma(0.16666666666666666, (B * B), 1.0) / B) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) tmp = 0.0 if (F <= -128000000000.0) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= -3.2e-36) tmp = Float64(1.0 / Float64(sin(B) / fma(t_0, F, Float64(-x)))); elseif (F <= 3.8e-173) tmp = fma(Float64(t_0 / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 1.32e+157) 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(fma(0.16666666666666666, Float64(B * B), 1.0) / B) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -128000000000.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.2e-36], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-173], N[(N[(t$95$0 / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.32e+157], 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[(N[(0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
\mathbf{if}\;F \leq -128000000000:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq -3.2 \cdot 10^{-36}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left(t\_0, F, -x\right)}}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-173}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_0}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.32 \cdot 10^{+157}:\\
\;\;\;\;\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{\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)}{B} - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if F < -1.28e11Initial program 55.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 rewrites75.0%
Applied rewrites75.0%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -1.28e11 < F < -3.20000000000000021e-36Initial program 99.4%
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%
Applied rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6499.6
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6493.4
Applied rewrites93.4%
if -3.20000000000000021e-36 < F < 3.8000000000000003e-173Initial program 99.5%
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.8%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.5
Applied rewrites96.5%
if 3.8000000000000003e-173 < F < 1.3199999999999999e157Initial program 96.5%
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.7%
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.f6480.0
Applied rewrites80.0%
if 1.3199999999999999e157 < F Initial program 39.3%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites19.9%
Taylor expanded in F around inf
Applied rewrites55.9%
Final simplification86.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(fma
(/ (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) B)
F
(/ (- x) (tan B)))))
(if (<= x -3.1e-122)
t_0
(if (<= x 2.8e-109)
(/
1.0
(/ (sin B) (fma (- 1.0) x (/ F (sqrt (fma x 2.0 (fma F F 2.0)))))))
t_0))))
double code(double F, double B, double x) {
double t_0 = fma((sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) / B), F, (-x / tan(B)));
double tmp;
if (x <= -3.1e-122) {
tmp = t_0;
} else if (x <= 2.8e-109) {
tmp = 1.0 / (sin(B) / fma(-1.0, x, (F / sqrt(fma(x, 2.0, fma(F, F, 2.0))))));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = fma(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) / B), F, Float64(Float64(-x) / tan(B))) tmp = 0.0 if (x <= -3.1e-122) tmp = t_0; elseif (x <= 2.8e-109) tmp = Float64(1.0 / Float64(sin(B) / fma(Float64(-1.0), x, Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0))))))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e-122], t$95$0, If[LessEqual[x, 2.8e-109], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[((-1.0) * x + N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{-122}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{-109}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left(-1, x, \frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.0999999999999998e-122 or 2.79999999999999979e-109 < x Initial program 81.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 rewrites92.4%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6487.3
Applied rewrites87.3%
if -3.0999999999999998e-122 < x < 2.79999999999999979e-109Initial program 68.9%
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 rewrites71.2%
Applied rewrites71.2%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6471.1
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6471.1
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6471.1
Applied rewrites71.1%
Taylor expanded in B around 0
Applied rewrites68.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (/ -1.0 B) (* (/ -1.0 (tan B)) x))))
(if (<= x -0.9)
t_0
(if (<= x 1.66e-16)
(/
1.0
(/ (sin B) (fma (- 1.0) x (/ F (sqrt (fma x 2.0 (fma F F 2.0)))))))
t_0))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) + ((-1.0 / tan(B)) * x);
double tmp;
if (x <= -0.9) {
tmp = t_0;
} else if (x <= 1.66e-16) {
tmp = 1.0 / (sin(B) / fma(-1.0, x, (F / sqrt(fma(x, 2.0, fma(F, F, 2.0))))));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) + Float64(Float64(-1.0 / tan(B)) * x)) tmp = 0.0 if (x <= -0.9) tmp = t_0; elseif (x <= 1.66e-16) tmp = Float64(1.0 / Float64(sin(B) / fma(Float64(-1.0), x, Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0))))))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.9], t$95$0, If[LessEqual[x, 1.66e-16], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[((-1.0) * x + N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{if}\;x \leq -0.9:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.66 \cdot 10^{-16}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left(-1, x, \frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -0.900000000000000022 or 1.6600000000000001e-16 < x Initial program 83.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6494.0
Applied rewrites94.0%
Taylor expanded in B around 0
Applied rewrites96.7%
if -0.900000000000000022 < x < 1.6600000000000001e-16Initial program 71.6%
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 rewrites74.5%
Applied rewrites74.5%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6474.4
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6474.4
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6474.4
Applied rewrites74.4%
Taylor expanded in B around 0
Applied rewrites64.9%
Final simplification78.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (/ -1.0 B) (* (/ -1.0 (tan B)) x))))
(if (<= x -4.8e-7)
t_0
(if (<= x 1.66e-16)
(/ (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 = (-1.0 / B) + ((-1.0 / tan(B)) * x);
double tmp;
if (x <= -4.8e-7) {
tmp = t_0;
} else if (x <= 1.66e-16) {
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(-1.0 / B) + Float64(Float64(-1.0 / tan(B)) * x)) tmp = 0.0 if (x <= -4.8e-7) tmp = t_0; elseif (x <= 1.66e-16) 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[(N[(-1.0 / B), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e-7], t$95$0, If[LessEqual[x, 1.66e-16], 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{-1}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.66 \cdot 10^{-16}:\\
\;\;\;\;\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 < -4.79999999999999957e-7 or 1.6600000000000001e-16 < x Initial program 83.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6494.0
Applied rewrites94.0%
Taylor expanded in B around 0
Applied rewrites96.8%
if -4.79999999999999957e-7 < x < 1.6600000000000001e-16Initial program 71.4%
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 rewrites74.4%
Applied rewrites74.4%
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.f6464.6
Applied rewrites64.6%
Final simplification78.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -1.15e-45)
t_0
(if (<= x 1.4e-110) (/ (* (sqrt (/ 1.0 (fma F F 2.0))) F) (sin B)) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -1.15e-45) {
tmp = t_0;
} else if (x <= 1.4e-110) {
tmp = (sqrt((1.0 / fma(F, F, 2.0))) * F) / 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 <= -1.15e-45) tmp = t_0; elseif (x <= 1.4e-110) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * F) / 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, -1.15e-45], t$95$0, If[LessEqual[x, 1.4e-110], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $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 -1.15 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-110}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.14999999999999996e-45 or 1.4e-110 < x Initial program 80.5%
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 rewrites92.1%
Applied rewrites92.0%
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.f6483.2
Applied rewrites83.2%
Applied rewrites83.4%
if -1.14999999999999996e-45 < x < 1.4e-110Initial program 71.9%
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 rewrites74.8%
Applied rewrites74.8%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6458.5
Applied rewrites58.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -1.15e-45)
t_0
(if (<= x 1.4e-110) (/ 1.0 (* (/ (sin B) F) (sqrt (fma F F 2.0)))) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -1.15e-45) {
tmp = t_0;
} else if (x <= 1.4e-110) {
tmp = 1.0 / ((sin(B) / F) * sqrt(fma(F, F, 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (x <= -1.15e-45) tmp = t_0; elseif (x <= 1.4e-110) tmp = Float64(1.0 / Float64(Float64(sin(B) / F) * sqrt(fma(F, F, 2.0)))); 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, -1.15e-45], t$95$0, If[LessEqual[x, 1.4e-110], N[(1.0 / N[(N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-110}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{F} \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.14999999999999996e-45 or 1.4e-110 < x Initial program 80.5%
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 rewrites92.1%
Applied rewrites92.0%
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.f6483.2
Applied rewrites83.2%
Applied rewrites83.4%
if -1.14999999999999996e-45 < x < 1.4e-110Initial program 71.9%
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 rewrites74.8%
Applied rewrites74.8%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6474.7
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6474.7
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6474.7
Applied rewrites74.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6456.6
Applied rewrites56.6%
Final simplification72.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -1.15e-45)
t_0
(if (<= x 1.4e-110) (* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B))) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -1.15e-45) {
tmp = t_0;
} else if (x <= 1.4e-110) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / 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 <= -1.15e-45) tmp = t_0; elseif (x <= 1.4e-110) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / 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, -1.15e-45], t$95$0, If[LessEqual[x, 1.4e-110], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-45}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-110}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.14999999999999996e-45 or 1.4e-110 < x Initial program 80.5%
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 rewrites92.1%
Applied rewrites92.0%
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.f6483.2
Applied rewrites83.2%
Applied rewrites83.4%
if -1.14999999999999996e-45 < x < 1.4e-110Initial program 71.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6455.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(if (<= B 0.195)
(/
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* B B) (* 0.16666666666666666 F) F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.195) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma((B * B), (0.16666666666666666 * F), F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.195) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(Float64(B * B), Float64(0.16666666666666666 * F), F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.195], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.195:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 0.19500000000000001Initial program 73.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites56.6%
if 0.19500000000000001 < B Initial program 85.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 rewrites85.3%
Applied rewrites85.2%
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.f6452.9
Applied rewrites52.9%
Applied rewrites52.9%
(FPCore (F B x)
:precision binary64
(if (<= F -8.5e-5)
(/ (- -1.0 x) B)
(if (<= F 470000000000.0)
(/ (- (/ F (sqrt (fma 2.0 x 2.0))) x) B)
(/
(- (fma (fma (- 1.0 x) 0.16666666666666666 (* 0.5 x)) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= 470000000000.0) {
tmp = ((F / sqrt(fma(2.0, x, 2.0))) - x) / B;
} else {
tmp = (fma(fma((1.0 - x), 0.16666666666666666, (0.5 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8.5e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 470000000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, 2.0))) - x) / B); else tmp = Float64(Float64(fma(fma(Float64(1.0 - x), 0.16666666666666666, Float64(0.5 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8.5e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 470000000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(1.0 - x), $MachinePrecision] * 0.16666666666666666 + N[(0.5 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 470000000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(1 - x, 0.16666666666666666, 0.5 \cdot x\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -8.500000000000001e-5Initial program 57.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.f6441.3
Applied rewrites41.3%
Taylor expanded in F around -inf
Applied rewrites45.9%
if -8.500000000000001e-5 < F < 4.7e11Initial 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.f6453.9
Applied rewrites53.9%
Applied rewrites53.9%
Applied rewrites53.9%
Taylor expanded in F around 0
Applied rewrites53.9%
if 4.7e11 < F Initial program 60.7%
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 rewrites69.8%
Applied rewrites69.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites28.1%
Taylor expanded in F around inf
Applied rewrites41.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2.1e-18)
(/ (- -1.0 x) B)
(if (<= F 470000000000.0)
(/ (- x) B)
(/
(- (fma (fma (- 1.0 x) 0.16666666666666666 (* 0.5 x)) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-18) {
tmp = (-1.0 - x) / B;
} else if (F <= 470000000000.0) {
tmp = -x / B;
} else {
tmp = (fma(fma((1.0 - x), 0.16666666666666666, (0.5 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-18) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 470000000000.0) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(fma(fma(Float64(1.0 - x), 0.16666666666666666, Float64(0.5 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-18], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 470000000000.0], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(N[(1.0 - x), $MachinePrecision] * 0.16666666666666666 + N[(0.5 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 470000000000:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(1 - x, 0.16666666666666666, 0.5 \cdot x\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.1e-18Initial program 60.8%
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.0
Applied rewrites42.0%
Taylor expanded in F around -inf
Applied rewrites43.0%
if -2.1e-18 < F < 4.7e11Initial 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.f6454.1
Applied rewrites54.1%
Taylor expanded in F around 0
Applied rewrites40.2%
if 4.7e11 < F Initial program 60.7%
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 rewrites69.8%
Applied rewrites69.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites28.1%
Taylor expanded in F around inf
Applied rewrites41.8%
(FPCore (F B x)
:precision binary64
(if (<= F 7.4e+143)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/
(- (fma (fma (- 1.0 x) 0.16666666666666666 (* 0.5 x)) (* B B) 1.0) x)
B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 7.4e+143) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = (fma(fma((1.0 - x), 0.16666666666666666, (0.5 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 7.4e+143) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(Float64(fma(fma(Float64(1.0 - x), 0.16666666666666666, Float64(0.5 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 7.4e+143], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(1.0 - x), $MachinePrecision] * 0.16666666666666666 + N[(0.5 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 7.4 \cdot 10^{+143}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(1 - x, 0.16666666666666666, 0.5 \cdot x\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < 7.4000000000000003e143Initial program 84.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.f6446.9
Applied rewrites46.9%
Applied rewrites46.9%
Applied rewrites47.0%
Taylor expanded in x around 0
Applied rewrites47.0%
if 7.4000000000000003e143 < F Initial program 42.5%
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 rewrites54.1%
Applied rewrites54.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites26.4%
Taylor expanded in F around inf
Applied rewrites47.3%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e-18) (/ (- -1.0 x) B) (if (<= F 1.55e-48) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-18) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.55e-48) {
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-18)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.55d-48) 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-18) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.55e-48) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-18: tmp = (-1.0 - x) / B elif F <= 1.55e-48: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-18) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.55e-48) 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-18) tmp = (-1.0 - x) / B; elseif (F <= 1.55e-48) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-18], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.55e-48], 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^{-18}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-48}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.1e-18Initial program 60.8%
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.0
Applied rewrites42.0%
Taylor expanded in F around -inf
Applied rewrites43.0%
if -2.1e-18 < F < 1.55000000000000008e-48Initial 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.f6454.9
Applied rewrites54.9%
Taylor expanded in F around 0
Applied rewrites42.3%
if 1.55000000000000008e-48 < F Initial program 66.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.f6430.7
Applied rewrites30.7%
Taylor expanded in F around inf
Applied rewrites39.0%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e-18) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-18) {
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-18)) 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-18) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-18: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-18) 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-18) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-18], 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^{-18}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.1e-18Initial program 60.8%
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.0
Applied rewrites42.0%
Taylor expanded in F around -inf
Applied rewrites43.0%
if -2.1e-18 < F Initial program 84.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.7
Applied rewrites43.7%
Taylor expanded in F around 0
Applied rewrites32.0%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(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.8%
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.2
Applied rewrites43.2%
Taylor expanded in F around 0
Applied rewrites29.2%
(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.8%
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.2
Applied rewrites43.2%
Taylor expanded in F around -inf
Applied rewrites28.4%
Taylor expanded in x around 0
Applied rewrites8.4%
herbie shell --seed 2024268
(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))))))