
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+40)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.5e+21)
(- (/ (/ F (sin B)) (sqrt (fma 2.0 x (fma F F 2.0)))) t_0)
(fma (/ -1.0 (tan B)) x (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+40) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.5e+21) {
tmp = ((F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - t_0;
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+40) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.5e+21) tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - t_0); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+40], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.5e+21], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+40}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -2.00000000000000006e40Initial program 63.2%
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 rewrites73.2%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites73.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2.00000000000000006e40 < F < 1.5e21Initial 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.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f6499.7
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.7
Applied rewrites99.7%
if 1.5e21 < F Initial program 59.8%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+68)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 2.5e+21)
(- (/ F (* (sqrt (fma x 2.0 (fma F F 2.0))) (sin B))) (/ x (tan B)))
(fma (/ -1.0 (tan B)) x (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+68) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 2.5e+21) {
tmp = (F / (sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - (x / tan(B));
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+68) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 2.5e+21) tmp = Float64(Float64(F / Float64(sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - Float64(x / tan(B))); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+68], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e+21], N[(N[(F / N[(N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+68}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -9.99999999999999953e67Initial program 60.2%
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.8%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
mul-1-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f6499.7
Applied rewrites99.7%
if -9.99999999999999953e67 < F < 2.5e21Initial program 98.8%
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%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
if 2.5e21 < F Initial program 59.8%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.5)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.001)
(- (/ F (* (sqrt (fma x 2.0 2.0)) (sin B))) t_0)
(fma (/ -1.0 (tan B)) x (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.5) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.001) {
tmp = (F / (sqrt(fma(x, 2.0, 2.0)) * sin(B))) - t_0;
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.001) tmp = Float64(Float64(F / Float64(sqrt(fma(x, 2.0, 2.0)) * sin(B))) - t_0); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.001], N[(N[(F / N[(N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.001:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)} \cdot \sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.5Initial program 65.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.2%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites75.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -1.5 < F < 1e-3Initial 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.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.4
Applied rewrites99.4%
if 1e-3 < F Initial program 62.4%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6499.3
Applied rewrites99.3%
Applied rewrites99.3%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -165000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.02e-5)
(- (/ F (* (sqrt (+ (fma x 2.0 (* F F)) 2.0)) B)) t_0)
(fma (/ -1.0 (tan B)) x (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -165000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.02e-5) {
tmp = (F / (sqrt((fma(x, 2.0, (F * F)) + 2.0)) * B)) - t_0;
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -165000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.02e-5) tmp = Float64(Float64(F / Float64(sqrt(Float64(fma(x, 2.0, Float64(F * F)) + 2.0)) * B)) - t_0); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -165000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(F / N[(N[Sqrt[N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -165000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, F \cdot F\right) + 2} \cdot B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.65e11Initial program 65.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.8%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites74.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -1.65e11 < F < 1.0200000000000001e-5Initial 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.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.8
Applied rewrites86.8%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6498.2
Applied rewrites98.2%
Applied rewrites98.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -165000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.02e-5)
(- (/ F (* (sqrt (+ (fma x 2.0 (* F F)) 2.0)) B)) t_0)
(/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -165000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.02e-5) {
tmp = (F / (sqrt((fma(x, 2.0, (F * F)) + 2.0)) * B)) - t_0;
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -165000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.02e-5) tmp = Float64(Float64(F / Float64(sqrt(Float64(fma(x, 2.0, Float64(F * F)) + 2.0)) * B)) - t_0); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -165000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(F / N[(N[Sqrt[N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -165000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, F \cdot F\right) + 2} \cdot B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.65e11Initial program 65.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.8%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites74.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -1.65e11 < F < 1.0200000000000001e-5Initial 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.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.8
Applied rewrites86.8%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6498.2
Applied rewrites98.2%
Applied rewrites98.1%
(FPCore (F B x)
:precision binary64
(if (<= F -165000000000.0)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 1.02e-5)
(- (/ F (* (sqrt (+ (fma x 2.0 (* F F)) 2.0)) B)) (/ x (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -165000000000.0) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 1.02e-5) {
tmp = (F / (sqrt((fma(x, 2.0, (F * F)) + 2.0)) * B)) - (x / tan(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -165000000000.0) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 1.02e-5) tmp = Float64(Float64(F / Float64(sqrt(Float64(fma(x, 2.0, Float64(F * F)) + 2.0)) * B)) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -165000000000.0], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(F / N[(N[Sqrt[N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $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 -165000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, F \cdot F\right) + 2} \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.65e11Initial program 65.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.8%
Applied rewrites74.8%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
mul-1-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f6499.6
Applied rewrites99.6%
if -1.65e11 < F < 1.0200000000000001e-5Initial 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.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.8
Applied rewrites86.8%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6498.2
Applied rewrites98.2%
Applied rewrites98.1%
(FPCore (F B x) :precision binary64 (if (<= F 1.02e-5) (- (/ F (* (sqrt (+ (fma x 2.0 (* F F)) 2.0)) B)) (/ x (tan B))) (/ (- 1.0 (* (cos B) x)) (sin B))))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.02e-5) {
tmp = (F / (sqrt((fma(x, 2.0, (F * F)) + 2.0)) * B)) - (x / tan(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 1.02e-5) tmp = Float64(Float64(F / Float64(sqrt(Float64(fma(x, 2.0, Float64(F * F)) + 2.0)) * B)) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 1.02e-5], N[(N[(F / N[(N[Sqrt[N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $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 1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, F \cdot F\right) + 2} \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < 1.0200000000000001e-5Initial program 87.1%
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 rewrites90.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites90.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.1
Applied rewrites77.1%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6498.2
Applied rewrites98.2%
Applied rewrites98.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (fma x 2.0 (* F F)) 2.0))
(t_1 (- (/ F (* (sqrt t_0) B)) (/ x (tan B)))))
(if (<= x -6.5e-157)
t_1
(if (<= x 3.5e-65) (/ (fma (sqrt (/ 1.0 t_0)) F (- x)) (sin B)) t_1))))
double code(double F, double B, double x) {
double t_0 = fma(x, 2.0, (F * F)) + 2.0;
double t_1 = (F / (sqrt(t_0) * B)) - (x / tan(B));
double tmp;
if (x <= -6.5e-157) {
tmp = t_1;
} else if (x <= 3.5e-65) {
tmp = fma(sqrt((1.0 / t_0)), F, -x) / sin(B);
} else {
tmp = t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(fma(x, 2.0, Float64(F * F)) + 2.0) t_1 = Float64(Float64(F / Float64(sqrt(t_0) * B)) - Float64(x / tan(B))) tmp = 0.0 if (x <= -6.5e-157) tmp = t_1; elseif (x <= 3.5e-65) tmp = Float64(fma(sqrt(Float64(1.0 / t_0)), F, Float64(-x)) / sin(B)); else tmp = t_1; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(F / N[(N[Sqrt[t$95$0], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e-157], t$95$1, If[LessEqual[x, 3.5e-65], N[(N[(N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(x, 2, F \cdot F\right) + 2\\
t_1 := \frac{F}{\sqrt{t\_0} \cdot B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{-157}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-65}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{t\_0}}, F, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.5000000000000002e-157 or 3.50000000000000005e-65 < x Initial program 82.0%
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 rewrites89.0%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites89.0%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.1
Applied rewrites83.1%
if -6.5000000000000002e-157 < x < 3.50000000000000005e-65Initial program 76.2%
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 rewrites77.4%
Applied rewrites77.5%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6472.0
Applied rewrites72.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ F (* (sqrt (+ (fma x 2.0 (* F F)) 2.0)) B)) (/ x (tan B)))))
(if (<= x -6.5e-157)
t_0
(if (<= x 3.4e-65)
(- (/ F (* (sqrt (fma x 2.0 (fma F F 2.0))) (sin B))) (/ x B))
t_0))))
double code(double F, double B, double x) {
double t_0 = (F / (sqrt((fma(x, 2.0, (F * F)) + 2.0)) * B)) - (x / tan(B));
double tmp;
if (x <= -6.5e-157) {
tmp = t_0;
} else if (x <= 3.4e-65) {
tmp = (F / (sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / Float64(sqrt(Float64(fma(x, 2.0, Float64(F * F)) + 2.0)) * B)) - Float64(x / tan(B))) tmp = 0.0 if (x <= -6.5e-157) tmp = t_0; elseif (x <= 3.4e-65) tmp = Float64(Float64(F / Float64(sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[(N[Sqrt[N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.5e-157], t$95$0, If[LessEqual[x, 3.4e-65], N[(N[(F / N[(N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(x, 2, F \cdot F\right) + 2} \cdot B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -6.5 \cdot 10^{-157}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{-65}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.5000000000000002e-157 or 3.39999999999999987e-65 < x Initial program 82.0%
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 rewrites89.0%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites89.0%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.1
Applied rewrites83.1%
if -6.5000000000000002e-157 < x < 3.39999999999999987e-65Initial program 76.2%
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 rewrites77.4%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites77.4%
Taylor expanded in B around 0
lower-/.f6471.4
Applied rewrites71.4%
Final simplification78.7%
(FPCore (F B x)
:precision binary64
(if (<= F -8.8e+111)
(- (/ (fma -0.16666666666666666 (* B B) -1.0) B) (/ x (tan B)))
(if (<= F 118000000.0)
(- (/ F (* (sqrt (fma x 2.0 (fma F F 2.0))) (sin B))) (/ x B))
(fma (- x) (/ 1.0 B) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.8e+111) {
tmp = (fma(-0.16666666666666666, (B * B), -1.0) / B) - (x / tan(B));
} else if (F <= 118000000.0) {
tmp = (F / (sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - (x / B);
} else {
tmp = fma(-x, (1.0 / B), (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8.8e+111) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B) - Float64(x / tan(B))); elseif (F <= 118000000.0) tmp = Float64(Float64(F / Float64(sqrt(fma(x, 2.0, fma(F, F, 2.0))) * sin(B))) - Float64(x / B)); else tmp = fma(Float64(-x), Float64(1.0 / B), Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8.8e+111], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 118000000.0], N[(N[(F / N[(N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(1.0 / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.8 \cdot 10^{+111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 118000000:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{B}, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -8.79999999999999994e111Initial program 52.4%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.1%
Applied rewrites30.1%
Taylor expanded in F around -inf
Applied rewrites52.8%
if -8.79999999999999994e111 < F < 1.18e8Initial program 98.8%
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%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6466.3
Applied rewrites66.3%
if 1.18e8 < F Initial program 60.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites71.6%
Final simplification65.4%
(FPCore (F B x)
:precision binary64
(if (<= F -7.2e+111)
(- (/ (fma -0.16666666666666666 (* B B) -1.0) B) (/ x (tan B)))
(if (<= F -5.5e-128)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
(if (<= F 1.02e-5)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(fma (- x) (/ 1.0 B) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e+111) {
tmp = (fma(-0.16666666666666666, (B * B), -1.0) / B) - (x / tan(B));
} else if (F <= -5.5e-128) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
} else if (F <= 1.02e-5) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = fma(-x, (1.0 / B), (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7.2e+111) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B) - Float64(x / tan(B))); elseif (F <= -5.5e-128) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (F <= 1.02e-5) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = fma(Float64(-x), Float64(1.0 / B), Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7.2e+111], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.5e-128], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) * N[(1.0 / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{+111}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -5.5 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{B}, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -7.2000000000000004e111Initial program 52.4%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.1%
Applied rewrites30.1%
Taylor expanded in F around -inf
Applied rewrites52.8%
if -7.2000000000000004e111 < F < -5.5000000000000004e-128Initial program 96.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.f6463.2
Applied rewrites63.2%
if -5.5000000000000004e-128 < F < 1.0200000000000001e-5Initial 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.f6451.0
Applied rewrites51.0%
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites51.1%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6498.2
Applied rewrites98.2%
Taylor expanded in B around 0
Applied rewrites71.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.6e+110)
(- (/ (fma -0.16666666666666666 (* B B) -1.0) B) (/ x (tan B)))
(if (<= F 1.02e-5)
(- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) B)) (/ x B))
(fma (- x) (/ 1.0 B) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e+110) {
tmp = (fma(-0.16666666666666666, (B * B), -1.0) / B) - (x / tan(B));
} else if (F <= 1.02e-5) {
tmp = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - (x / B);
} else {
tmp = fma(-x, (1.0 / B), (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.6e+110) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B) - Float64(x / tan(B))); elseif (F <= 1.02e-5) tmp = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - Float64(x / B)); else tmp = fma(Float64(-x), Float64(1.0 / B), Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.6e+110], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(1.0 / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{+110}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{B}, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.59999999999999997e110Initial program 53.4%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites29.6%
Applied rewrites29.5%
Taylor expanded in F around -inf
Applied rewrites51.8%
if -1.59999999999999997e110 < F < 1.0200000000000001e-5Initial program 98.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.f6450.2
Applied rewrites50.2%
Applied rewrites50.2%
Applied rewrites50.2%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6498.2
Applied rewrites98.2%
Taylor expanded in B around 0
Applied rewrites71.4%
Final simplification56.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2.45e+129)
(/ (- -1.0 x) B)
(if (<= F 1.02e-5)
(- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) B)) (/ x B))
(fma (- x) (/ 1.0 B) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.45e+129) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.02e-5) {
tmp = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - (x / B);
} else {
tmp = fma(-x, (1.0 / B), (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.45e+129) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.02e-5) tmp = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - Float64(x / B)); else tmp = fma(Float64(-x), Float64(1.0 / B), Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.45e+129], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(1.0 / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.45 \cdot 10^{+129}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{B}, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -2.45e129Initial program 43.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.f6422.3
Applied rewrites22.3%
Taylor expanded in F around -inf
Applied rewrites38.3%
if -2.45e129 < F < 1.0200000000000001e-5Initial program 98.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.f6449.8
Applied rewrites49.8%
Applied rewrites49.7%
Applied rewrites49.8%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6498.2
Applied rewrites98.2%
Taylor expanded in B around 0
Applied rewrites71.4%
Final simplification54.6%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+76)
(/ (- -1.0 x) B)
(if (<= F 4.4e+21)
(- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) B)) (/ x B))
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+76) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.4e+21) {
tmp = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+76) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.4e+21) tmp = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+76], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.4e+21], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+76}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.4 \cdot 10^{+21}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -4.99999999999999991e76Initial program 58.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.f6427.0
Applied rewrites27.0%
Taylor expanded in F around -inf
Applied rewrites38.7%
if -4.99999999999999991e76 < F < 4.4e21Initial program 98.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.f6451.3
Applied rewrites51.3%
Applied rewrites51.3%
Applied rewrites51.3%
if 4.4e21 < F Initial program 59.2%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites58.4%
Final simplification50.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.42)
(/ (- -1.0 x) B)
(if (<= F 140000.0)
(/ (- (/ F (sqrt (fma x 2.0 2.0))) x) B)
(/ (- (fma (/ (fma 2.0 x 2.0) (* F F)) -0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.42) {
tmp = (-1.0 - x) / B;
} else if (F <= 140000.0) {
tmp = ((F / sqrt(fma(x, 2.0, 2.0))) - x) / B;
} else {
tmp = (fma((fma(2.0, x, 2.0) / (F * F)), -0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 140000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, 2.0))) - x) / B); else tmp = Float64(Float64(fma(Float64(fma(2.0, x, 2.0) / Float64(F * F)), -0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.42], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 140000.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 140000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, -0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 65.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.f6432.2
Applied rewrites32.2%
Taylor expanded in F around -inf
Applied rewrites41.4%
if -1.4199999999999999 < F < 1.4e5Initial 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.f6450.4
Applied rewrites50.4%
Applied rewrites50.4%
Taylor expanded in F around 0
Applied rewrites50.5%
if 1.4e5 < F Initial program 61.4%
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.f6427.8
Applied rewrites27.8%
Taylor expanded in F around inf
Applied rewrites43.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+79)
(/ (- -1.0 x) B)
(if (<= F 3.6e+162)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/
(+ (* (fma 0.3333333333333333 x 0.16666666666666666) (* B B)) (- 1.0 x))
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+79) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e+162) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = ((fma(0.3333333333333333, x, 0.16666666666666666) * (B * B)) + (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+79) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.6e+162) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(Float64(Float64(fma(0.3333333333333333, x, 0.16666666666666666) * Float64(B * B)) + Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+79], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e+162], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+79}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{+162}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right) \cdot \left(B \cdot B\right) + \left(1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -9.99999999999999967e78Initial program 58.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.f6427.0
Applied rewrites27.0%
Taylor expanded in F around -inf
Applied rewrites38.7%
if -9.99999999999999967e78 < F < 3.59999999999999994e162Initial program 97.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.f6448.4
Applied rewrites48.4%
Applied rewrites48.4%
Taylor expanded in x around 0
Applied rewrites48.4%
if 3.59999999999999994e162 < F Initial program 31.7%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites46.4%
Final simplification46.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.5e-77)
(/ (- -1.0 x) B)
(if (<= F 2.7e-114)
(/ (- x) B)
(/
(+ (* (fma 0.3333333333333333 x 0.16666666666666666) (* B B)) (- 1.0 x))
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-77) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.7e-114) {
tmp = -x / B;
} else {
tmp = ((fma(0.3333333333333333, x, 0.16666666666666666) * (B * B)) + (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-77) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.7e-114) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(Float64(fma(0.3333333333333333, x, 0.16666666666666666) * Float64(B * B)) + Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-77], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.7e-114], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-114}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right) \cdot \left(B \cdot B\right) + \left(1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.50000000000000008e-77Initial program 69.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.f6433.9
Applied rewrites33.9%
Taylor expanded in F around -inf
Applied rewrites38.5%
if -1.50000000000000008e-77 < F < 2.7e-114Initial program 99.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.f6450.7
Applied rewrites50.7%
Taylor expanded in F around 0
Applied rewrites36.4%
if 2.7e-114 < F Initial program 72.9%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/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
lower-/.f64N/A
lower-sin.f6481.8
Applied rewrites81.8%
Taylor expanded in B around 0
Applied rewrites37.9%
Final simplification37.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.5e-77) (/ (- -1.0 x) B) (if (<= F 1.45e-12) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-77) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.45e-12) {
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 <= (-1.5d-77)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.45d-12) 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 <= -1.5e-77) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.45e-12) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.5e-77: tmp = (-1.0 - x) / B elif F <= 1.45e-12: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-77) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.45e-12) 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 <= -1.5e-77) tmp = (-1.0 - x) / B; elseif (F <= 1.45e-12) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-77], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45e-12], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-12}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.50000000000000008e-77Initial program 69.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.f6433.9
Applied rewrites33.9%
Taylor expanded in F around -inf
Applied rewrites38.5%
if -1.50000000000000008e-77 < F < 1.4500000000000001e-12Initial 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.f6451.1
Applied rewrites51.1%
Taylor expanded in F around 0
Applied rewrites32.8%
if 1.4500000000000001e-12 < F Initial program 62.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.f6428.1
Applied rewrites28.1%
Taylor expanded in F around inf
Applied rewrites43.2%
(FPCore (F B x) :precision binary64 (if (<= F -1.5e-77) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-77) {
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 <= (-1.5d-77)) 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 <= -1.5e-77) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.5e-77: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-77) 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 <= -1.5e-77) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-77], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.50000000000000008e-77Initial program 69.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.f6433.9
Applied rewrites33.9%
Taylor expanded in F around -inf
Applied rewrites38.5%
if -1.50000000000000008e-77 < F Initial program 83.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.f6441.3
Applied rewrites41.3%
Taylor expanded in F around 0
Applied rewrites26.7%
(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 79.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.f6439.2
Applied rewrites39.2%
Taylor expanded in F around 0
Applied rewrites25.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 79.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.f6439.2
Applied rewrites39.2%
Taylor expanded in F around -inf
Applied rewrites23.3%
Taylor expanded in x around 0
Applied rewrites7.4%
herbie shell --seed 2024237
(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))))))