
(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 28 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
(if (<= F -7.6e+34)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 100000000.0)
(fma (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) F (/ (- x) (tan B)))
(- (pow (sin B) -1.0) (/ (* (cos B) x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.6e+34) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 100000000.0) {
tmp = fma((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), F, (-x / tan(B)));
} else {
tmp = pow(sin(B), -1.0) - ((cos(B) * x) / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7.6e+34) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 100000000.0) tmp = fma(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(Float64(-x) / tan(B))); else tmp = Float64((sin(B) ^ -1.0) - Float64(Float64(cos(B) * x) / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7.6e+34], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(N[Power[N[(2.0 * x + 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[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.6 \cdot 10^{+34}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \frac{\cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -7.6000000000000003e34Initial program 65.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 rewrites76.7%
Applied rewrites76.8%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -7.6000000000000003e34 < F < 1e8Initial 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%
if 1e8 < F Initial 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 rewrites72.2%
Taylor expanded in F around inf
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+43)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 135000000.0)
(fma
(pow (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0)))) -1.0)
F
(/ (- x) (tan B)))
(- (pow (sin B) -1.0) (/ (* (cos B) x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+43) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 135000000.0) {
tmp = fma(pow((sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0)))), -1.0), F, (-x / tan(B)));
} else {
tmp = pow(sin(B), -1.0) - ((cos(B) * x) / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+43) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 135000000.0) tmp = fma((Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0)))) ^ -1.0), F, Float64(Float64(-x) / tan(B))); else tmp = Float64((sin(B) ^ -1.0) - Float64(Float64(cos(B) * x) / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 135000000.0], N[(N[Power[N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 135000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-1}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \frac{\cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -5.0000000000000004e43Initial program 64.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 rewrites75.7%
Applied rewrites75.8%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -5.0000000000000004e43 < F < 1.35e8Initial 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-/.f64N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lift-pow.f64N/A
pow-flipN/A
metadata-evalN/A
pow1/2N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
Applied rewrites99.6%
if 1.35e8 < F Initial 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 rewrites72.2%
Taylor expanded in F around inf
+-commutativeN/A
mul-1-negN/A
sub-negN/A
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+43)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 100000000.0)
(fma
(pow (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0)))) -1.0)
F
(/ (- x) (tan B)))
(- (pow (sin B) -1.0) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+43) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 100000000.0) {
tmp = fma(pow((sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0)))), -1.0), F, (-x / tan(B)));
} else {
tmp = pow(sin(B), -1.0) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+43) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 100000000.0) tmp = fma((Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0)))) ^ -1.0), F, Float64(Float64(-x) / tan(B))); else tmp = Float64((sin(B) ^ -1.0) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[Power[N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-1}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -5.0000000000000004e43Initial program 64.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 rewrites75.7%
Applied rewrites75.8%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -5.0000000000000004e43 < F < 1e8Initial 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-/.f64N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lift-pow.f64N/A
pow-flipN/A
metadata-evalN/A
pow1/2N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
Applied rewrites99.6%
if 1e8 < F Initial program 55.9%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5e+43)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 135000000.0)
(fma
(pow (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0)))) -1.0)
F
(/ (- x) (tan B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5e+43) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 135000000.0) {
tmp = fma(pow((sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0)))), -1.0), F, (-x / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+43) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 135000000.0) tmp = fma((Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0)))) ^ -1.0), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 135000000.0], N[(N[Power[N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 135000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-1}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5.0000000000000004e43Initial program 64.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 rewrites75.7%
Applied rewrites75.8%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -5.0000000000000004e43 < F < 1.35e8Initial 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-/.f64N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lift-pow.f64N/A
pow-flipN/A
metadata-evalN/A
pow1/2N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
Applied rewrites99.6%
if 1.35e8 < F Initial 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 rewrites72.2%
Applied rewrites72.2%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.6e+34)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1000.0)
(- (/ (* (sqrt (pow (fma F F 2.0) -1.0)) F) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.6e+34) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1000.0) {
tmp = ((sqrt(pow(fma(F, F, 2.0), -1.0)) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.6e+34) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1000.0) tmp = Float64(Float64(Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.6e+34], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1000.0], N[(N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.6 \cdot 10^{+34}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1000:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7.6000000000000003e34Initial program 65.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 rewrites76.7%
Applied rewrites76.8%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -7.6000000000000003e34 < F < 1e3Initial 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 x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.2
Applied rewrites99.2%
if 1e3 < F Initial 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 rewrites72.2%
Applied rewrites72.2%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (/ F (sin B)) (sqrt (fma 2.0 x (fma F F 2.0)))) (/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -3.3e+28)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -2.1e-155)
t_0
(if (<= F 7e-127)
(fma
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) B)
F
(/ (- x) (tan B)))
(if (<= F 200000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -3.3e+28) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -2.1e-155) {
tmp = t_0;
} else if (F <= 7e-127) {
tmp = fma((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / B), F, (-x / tan(B)));
} else if (F <= 200000.0) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.3e+28) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -2.1e-155) tmp = t_0; elseif (F <= 7e-127) tmp = fma(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 200000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.3e+28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2.1e-155], t$95$0, If[LessEqual[F, 7e-127], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 200000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.3 \cdot 10^{+28}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -2.1 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-127}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 200000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -3.3e28Initial program 66.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 rewrites77.3%
Applied rewrites77.4%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -3.3e28 < F < -2.1000000000000002e-155 or 6.99999999999999979e-127 < F < 2e5Initial program 99.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f6499.4
Applied rewrites99.4%
Taylor expanded in B around 0
lower-/.f6489.9
Applied rewrites89.9%
metadata-evalN/A
metadata-evalN/A
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites90.0%
if -2.1000000000000002e-155 < F < 6.99999999999999979e-127Initial 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%
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
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6494.9
Applied rewrites94.9%
if 2e5 < F Initial 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 rewrites72.2%
Applied rewrites72.2%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification96.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (/ F (sin B)) (sqrt (fma 2.0 x (fma F F 2.0)))) (/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -3.3e+28)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -2.1e-155)
t_0
(if (<= F 7e-127)
(fma
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) B)
F
(/ (- x) (tan B)))
(if (<= F 1.5e+154)
t_0
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -3.3e+28) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -2.1e-155) {
tmp = t_0;
} else if (F <= 7e-127) {
tmp = fma((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / B), F, (-x / tan(B)));
} else if (F <= 1.5e+154) {
tmp = t_0;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.3e+28) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -2.1e-155) tmp = t_0; elseif (F <= 7e-127) tmp = fma(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 1.5e+154) tmp = t_0; else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.3e+28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2.1e-155], t$95$0, If[LessEqual[F, 7e-127], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+154], t$95$0, N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.3 \cdot 10^{+28}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -2.1 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-127}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - t\_1\\
\end{array}
\end{array}
if F < -3.3e28Initial program 66.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 rewrites77.3%
Applied rewrites77.4%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -3.3e28 < F < -2.1000000000000002e-155 or 6.99999999999999979e-127 < F < 1.50000000000000013e154Initial program 98.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f6498.4
Applied rewrites98.4%
Taylor expanded in B around 0
lower-/.f6487.1
Applied rewrites87.1%
metadata-evalN/A
metadata-evalN/A
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites87.2%
if -2.1000000000000002e-155 < F < 6.99999999999999979e-127Initial 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%
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
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6494.9
Applied rewrites94.9%
if 1.50000000000000013e154 < F Initial program 25.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites28.9%
Taylor expanded in F around inf
Applied rewrites69.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
Applied rewrites69.7%
Final simplification90.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B)))
(t_1 (- (/ (/ F (sin B)) (sqrt (fma 2.0 x (fma F F 2.0)))) (/ x B))))
(if (<= F -4.8e+82)
(-
(/
-1.0
(*
(fma
(fma 0.008333333333333333 (* B B) -0.16666666666666666)
(* B B)
1.0)
B))
t_0)
(if (<= F -2.1e-155)
t_1
(if (<= F 7e-127)
(fma
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) B)
F
(/ (- x) (tan B)))
(if (<= F 1.5e+154)
t_1
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = ((F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (x / B);
double tmp;
if (F <= -4.8e+82) {
tmp = (-1.0 / (fma(fma(0.008333333333333333, (B * B), -0.16666666666666666), (B * B), 1.0) * B)) - t_0;
} else if (F <= -2.1e-155) {
tmp = t_1;
} else if (F <= 7e-127) {
tmp = fma((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / B), F, (-x / tan(B)));
} else if (F <= 1.5e+154) {
tmp = t_1;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(x / B)) tmp = 0.0 if (F <= -4.8e+82) tmp = Float64(Float64(-1.0 / Float64(fma(fma(0.008333333333333333, Float64(B * B), -0.16666666666666666), Float64(B * B), 1.0) * B)) - t_0); elseif (F <= -2.1e-155) tmp = t_1; elseif (F <= 7e-127) tmp = fma(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 1.5e+154) tmp = t_1; else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - 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[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.8e+82], N[(N[(-1.0 / N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.1e-155], t$95$1, If[LessEqual[F, 7e-127], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+154], t$95$1, N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{if}\;F \leq -4.8 \cdot 10^{+82}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, B \cdot B, -0.16666666666666666\right), B \cdot B, 1\right) \cdot B} - t\_0\\
\mathbf{elif}\;F \leq -2.1 \cdot 10^{-155}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-127}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - t\_0\\
\end{array}
\end{array}
if F < -4.79999999999999996e82Initial program 56.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 rewrites70.6%
Applied rewrites70.6%
Taylor expanded in F around -inf
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.3
Applied rewrites78.3%
if -4.79999999999999996e82 < F < -2.1000000000000002e-155 or 6.99999999999999979e-127 < F < 1.50000000000000013e154Initial program 98.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f6498.6
Applied rewrites98.6%
Taylor expanded in B around 0
lower-/.f6485.8
Applied rewrites85.8%
metadata-evalN/A
metadata-evalN/A
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites85.9%
if -2.1000000000000002e-155 < F < 6.99999999999999979e-127Initial 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%
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
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6494.9
Applied rewrites94.9%
if 1.50000000000000013e154 < F Initial program 25.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites28.9%
Taylor expanded in F around inf
Applied rewrites69.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
Applied rewrites69.7%
Final simplification84.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.05)
(- (/ (/ F (sqrt (fma 2.0 x 2.0))) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.05) {
tmp = ((F / sqrt(fma(2.0, x, 2.0))) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.05) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, 2.0))) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.05], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.05:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 69.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 rewrites79.0%
Applied rewrites79.1%
Taylor expanded in F around -inf
Applied rewrites98.6%
if -1.4199999999999999 < F < 2.0499999999999998Initial 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
lower-fma.f6499.6
Applied rewrites99.6%
if 2.0499999999999998 < F Initial program 58.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 rewrites73.6%
Applied rewrites73.6%
Taylor expanded in F around inf
Applied rewrites97.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ (* (sqrt 0.5) F) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((sqrt(0.5) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = ((sqrt(0.5d0) * f) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((Math.sqrt(0.5) * F) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = ((math.sqrt(0.5) * F) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(Float64(sqrt(0.5) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = ((sqrt(0.5) * F) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 69.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 rewrites79.0%
Applied rewrites79.1%
Taylor expanded in F around -inf
Applied rewrites98.6%
if -1.4199999999999999 < F < 1.3999999999999999Initial 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 x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.2
Applied rewrites99.2%
Taylor expanded in F around 0
Applied rewrites99.2%
if 1.3999999999999999 < F Initial program 58.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 rewrites73.6%
Applied rewrites73.6%
Taylor expanded in F around inf
Applied rewrites97.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(/ -1.0 (* (fma (* -0.16666666666666666 B) B 1.0) B))
(/ x (tan B)))))
(if (<= x -2.7e-10)
t_0
(if (<= x -3.5e-154)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(if (<= x 5.8e-88)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))
t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / (fma((-0.16666666666666666 * B), B, 1.0) * B)) - (x / tan(B));
double tmp;
if (x <= -2.7e-10) {
tmp = t_0;
} else if (x <= -3.5e-154) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else if (x <= 5.8e-88) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-1.0 / Float64(fma(Float64(-0.16666666666666666 * B), B, 1.0) * B)) - Float64(x / tan(B))) tmp = 0.0 if (x <= -2.7e-10) tmp = t_0; elseif (x <= -3.5e-154) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); elseif (x <= 5.8e-88) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / N[(N[(N[(-0.16666666666666666 * B), $MachinePrecision] * B + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.7e-10], t$95$0, If[LessEqual[x, -3.5e-154], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[x, 5.8e-88], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\mathsf{fma}\left(-0.16666666666666666 \cdot B, B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-154}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-88}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.7e-10 or 5.8000000000000003e-88 < x Initial program 86.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 rewrites95.2%
Applied rewrites95.2%
Taylor expanded in F around -inf
Applied rewrites89.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6492.8
Applied rewrites92.8%
if -2.7e-10 < x < -3.5000000000000001e-154Initial program 75.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.f6454.0
Applied rewrites54.0%
Applied rewrites54.1%
if -3.5000000000000001e-154 < x < 5.8000000000000003e-88Initial program 75.4%
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.f6461.4
Applied rewrites61.4%
Final simplification75.3%
(FPCore (F B x)
:precision binary64
(if (<= F -4e-13)
(* (+ 1.0 x) (- (pow (* (* F F) B) -1.0) (pow B -1.0)))
(if (<= F 1e+45)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(+ (- (/ x B)) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-13) {
tmp = (1.0 + x) * (pow(((F * F) * B), -1.0) - pow(B, -1.0));
} else if (F <= 1e+45) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = -(x / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e-13) tmp = Float64(Float64(1.0 + x) * Float64((Float64(Float64(F * F) * B) ^ -1.0) - (B ^ -1.0))); elseif (F <= 1e+45) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e-13], N[(N[(1.0 + x), $MachinePrecision] * N[(N[Power[N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] - N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+45], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-13}:\\
\;\;\;\;\left(1 + x\right) \cdot \left({\left(\left(F \cdot F\right) \cdot B\right)}^{-1} - {B}^{-1}\right)\\
\mathbf{elif}\;F \leq 10^{+45}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -4.0000000000000001e-13Initial 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.1
Applied rewrites33.1%
Taylor expanded in F around -inf
Applied rewrites40.3%
Taylor expanded in x around 0
Applied rewrites45.1%
if -4.0000000000000001e-13 < F < 9.9999999999999993e44Initial 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.f6447.7
Applied rewrites47.7%
Applied rewrites47.7%
if 9.9999999999999993e44 < F Initial program 50.7%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites63.1%
Taylor expanded in B around 0
lower-/.f6456.2
Applied rewrites56.2%
Final simplification48.6%
(FPCore (F B x)
:precision binary64
(if (<= F -4e-13)
(* (+ 1.0 x) (- (pow (* (* F F) B) -1.0) (pow B -1.0)))
(if (<= F 7.2e+44)
(/ (fma (sqrt (pow (fma F F 2.0) -1.0)) F (- x)) B)
(+ (- (/ x B)) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-13) {
tmp = (1.0 + x) * (pow(((F * F) * B), -1.0) - pow(B, -1.0));
} else if (F <= 7.2e+44) {
tmp = fma(sqrt(pow(fma(F, F, 2.0), -1.0)), F, -x) / B;
} else {
tmp = -(x / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e-13) tmp = Float64(Float64(1.0 + x) * Float64((Float64(Float64(F * F) * B) ^ -1.0) - (B ^ -1.0))); elseif (F <= 7.2e+44) tmp = Float64(fma(sqrt((fma(F, F, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e-13], N[(N[(1.0 + x), $MachinePrecision] * N[(N[Power[N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] - N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e+44], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-13}:\\
\;\;\;\;\left(1 + x\right) \cdot \left({\left(\left(F \cdot F\right) \cdot B\right)}^{-1} - {B}^{-1}\right)\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -4.0000000000000001e-13Initial 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.1
Applied rewrites33.1%
Taylor expanded in F around -inf
Applied rewrites40.3%
Taylor expanded in x around 0
Applied rewrites45.1%
if -4.0000000000000001e-13 < F < 7.2e44Initial 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.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
Applied rewrites47.7%
if 7.2e44 < F Initial program 50.7%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites63.1%
Taylor expanded in B around 0
lower-/.f6456.2
Applied rewrites56.2%
Final simplification48.6%
(FPCore (F B x)
:precision binary64
(if (<= F -4e-13)
(* (+ 1.0 x) (- (pow (* (* F F) B) -1.0) (pow B -1.0)))
(if (<= F 70.0)
(/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
(+ (- (/ x B)) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-13) {
tmp = (1.0 + x) * (pow(((F * F) * B), -1.0) - pow(B, -1.0));
} else if (F <= 70.0) {
tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
} else {
tmp = -(x / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e-13) tmp = Float64(Float64(1.0 + x) * Float64((Float64(Float64(F * F) * B) ^ -1.0) - (B ^ -1.0))); elseif (F <= 70.0) tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e-13], N[(N[(1.0 + x), $MachinePrecision] * N[(N[Power[N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] - N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 70.0], N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-13}:\\
\;\;\;\;\left(1 + x\right) \cdot \left({\left(\left(F \cdot F\right) \cdot B\right)}^{-1} - {B}^{-1}\right)\\
\mathbf{elif}\;F \leq 70:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -4.0000000000000001e-13Initial 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.1
Applied rewrites33.1%
Taylor expanded in F around -inf
Applied rewrites40.3%
Taylor expanded in x around 0
Applied rewrites45.1%
if -4.0000000000000001e-13 < F < 70Initial 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.f6447.4
Applied rewrites47.4%
Taylor expanded in F around 0
Applied rewrites47.4%
if 70 < F Initial program 57.4%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites39.0%
Taylor expanded in F around inf
Applied rewrites60.6%
Taylor expanded in B around 0
lower-/.f6454.7
Applied rewrites54.7%
Final simplification48.3%
(FPCore (F B x)
:precision binary64
(if (<= F -4e-13)
(* (+ 1.0 x) (- (pow (* (* F F) B) -1.0) (pow B -1.0)))
(if (<= F 4.05e-47)
(/ (- x) B)
(+ (- (/ x B)) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-13) {
tmp = (1.0 + x) * (pow(((F * F) * B), -1.0) - pow(B, -1.0));
} else if (F <= 4.05e-47) {
tmp = -x / B;
} else {
tmp = -(x / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e-13) tmp = Float64(Float64(1.0 + x) * Float64((Float64(Float64(F * F) * B) ^ -1.0) - (B ^ -1.0))); elseif (F <= 4.05e-47) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e-13], N[(N[(1.0 + x), $MachinePrecision] * N[(N[Power[N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] - N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.05e-47], N[((-x) / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-13}:\\
\;\;\;\;\left(1 + x\right) \cdot \left({\left(\left(F \cdot F\right) \cdot B\right)}^{-1} - {B}^{-1}\right)\\
\mathbf{elif}\;F \leq 4.05 \cdot 10^{-47}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -4.0000000000000001e-13Initial 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.1
Applied rewrites33.1%
Taylor expanded in F around -inf
Applied rewrites40.3%
Taylor expanded in x around 0
Applied rewrites45.1%
if -4.0000000000000001e-13 < F < 4.0500000000000002e-47Initial 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.f6448.2
Applied rewrites48.2%
Taylor expanded in F around 0
Applied rewrites41.9%
if 4.0500000000000002e-47 < F Initial program 65.1%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites40.0%
Taylor expanded in F around inf
Applied rewrites52.0%
Taylor expanded in B around 0
lower-/.f6447.1
Applied rewrites47.1%
Final simplification44.4%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.7e-10) (not (<= x 6.5e-88))) (- (/ -1.0 (* (fma (* -0.16666666666666666 B) B 1.0) B)) (/ x (tan B))) (- (/ (/ F (sin B)) (sqrt (fma 2.0 x (fma F F 2.0)))) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.7e-10) || !(x <= 6.5e-88)) {
tmp = (-1.0 / (fma((-0.16666666666666666 * B), B, 1.0) * B)) - (x / tan(B));
} else {
tmp = ((F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -2.7e-10) || !(x <= 6.5e-88)) tmp = Float64(Float64(-1.0 / Float64(fma(Float64(-0.16666666666666666 * B), B, 1.0) * B)) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(F / sin(B)) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.7e-10], N[Not[LessEqual[x, 6.5e-88]], $MachinePrecision]], N[(N[(-1.0 / N[(N[(N[(-0.16666666666666666 * B), $MachinePrecision] * B + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-10} \lor \neg \left(x \leq 6.5 \cdot 10^{-88}\right):\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(-0.16666666666666666 \cdot B, B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\end{array}
\end{array}
if x < -2.7e-10 or 6.50000000000000006e-88 < x Initial program 86.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 rewrites95.2%
Applied rewrites95.2%
Taylor expanded in F around -inf
Applied rewrites89.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6492.8
Applied rewrites92.8%
if -2.7e-10 < x < 6.50000000000000006e-88Initial program 75.4%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
lower-/.f6468.0
Applied rewrites68.0%
metadata-evalN/A
metadata-evalN/A
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites67.2%
Final simplification79.5%
(FPCore (F B x) :precision binary64 (if (<= B 4.3e-19) (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (- (/ -1.0 (* (fma (* -0.16666666666666666 B) B 1.0) B)) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 4.3e-19) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (-1.0 / (fma((-0.16666666666666666 * B), B, 1.0) * B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 4.3e-19) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-1.0 / Float64(fma(Float64(-0.16666666666666666 * B), B, 1.0) * B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 4.3e-19], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[(N[(N[(-0.16666666666666666 * B), $MachinePrecision] * B + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 4.3 \cdot 10^{-19}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(-0.16666666666666666 \cdot B, B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 4.3e-19Initial program 78.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.f6456.4
Applied rewrites56.4%
Applied rewrites56.5%
if 4.3e-19 < B Initial program 86.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 rewrites86.5%
Applied rewrites86.4%
Taylor expanded in F around -inf
Applied rewrites53.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
unpow2N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f6446.3
Applied rewrites46.3%
Final simplification53.3%
(FPCore (F B x) :precision binary64 (if (<= B 3.6e-7) (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (- (* 0.16666666666666666 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.6e-7) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (0.16666666666666666 * B) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.6e-7) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(0.16666666666666666 * B) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.6e-7], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(0.16666666666666666 * B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot B - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 3.59999999999999994e-7Initial program 78.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6456.9
Applied rewrites56.9%
Applied rewrites56.9%
if 3.59999999999999994e-7 < B Initial program 86.0%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites17.5%
Taylor expanded in F around inf
Applied rewrites19.9%
Taylor expanded in B around inf
Applied rewrites20.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
Applied rewrites20.2%
Final simplification45.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+154)
(+
(/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)
(/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 2.8e+139)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(+
(*
(- x)
(/
(fma
(fma
(fma -0.0021164021164021165 (* B B) -0.022222222222222223)
(* B B)
-0.3333333333333333)
(* B B)
1.0)
B))
(/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+154) {
tmp = ((x * fma(0.3333333333333333, (B * B), -1.0)) / B) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 2.8e+139) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (-x * (fma(fma(fma(-0.0021164021164021165, (B * B), -0.022222222222222223), (B * B), -0.3333333333333333), (B * B), 1.0) / B)) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+154) tmp = Float64(Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 2.8e+139) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(Float64(-x) * Float64(fma(fma(fma(-0.0021164021164021165, Float64(B * B), -0.022222222222222223), Float64(B * B), -0.3333333333333333), Float64(B * B), 1.0) / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+154], N[(N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e+139], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[((-x) * N[(N[(N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision] + -0.022222222222222223), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, B \cdot B, -0.022222222222222223\right), B \cdot B, -0.3333333333333333\right), B \cdot B, 1\right)}{B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -1.35000000000000003e154Initial program 42.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites21.9%
Taylor expanded in F around inf
Applied rewrites31.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in F around -inf
Applied rewrites43.6%
if -1.35000000000000003e154 < F < 2.7999999999999998e139Initial program 96.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.f6448.4
Applied rewrites48.4%
Applied rewrites48.5%
if 2.7999999999999998e139 < F Initial program 32.2%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites26.4%
Taylor expanded in F around inf
Applied rewrites63.8%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6455.5
Applied rewrites55.5%
Final simplification48.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+154)
(+
(/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)
(/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 2.8e+139)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(+
(*
(- x)
(/
(fma
(fma -0.022222222222222223 (* B B) -0.3333333333333333)
(* B B)
1.0)
B))
(/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+154) {
tmp = ((x * fma(0.3333333333333333, (B * B), -1.0)) / B) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 2.8e+139) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (-x * (fma(fma(-0.022222222222222223, (B * B), -0.3333333333333333), (B * B), 1.0) / B)) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+154) tmp = Float64(Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 2.8e+139) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(Float64(-x) * Float64(fma(fma(-0.022222222222222223, Float64(B * B), -0.3333333333333333), Float64(B * B), 1.0) / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+154], N[(N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e+139], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[((-x) * N[(N[(N[(-0.022222222222222223 * N[(B * B), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x\right) \cdot \frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.022222222222222223, B \cdot B, -0.3333333333333333\right), B \cdot B, 1\right)}{B} + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -1.35000000000000003e154Initial program 42.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites21.9%
Taylor expanded in F around inf
Applied rewrites31.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in F around -inf
Applied rewrites43.6%
if -1.35000000000000003e154 < F < 2.7999999999999998e139Initial program 96.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.f6448.4
Applied rewrites48.4%
Applied rewrites48.5%
if 2.7999999999999998e139 < F Initial program 32.2%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites26.4%
Taylor expanded in F around inf
Applied rewrites63.8%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6455.2
Applied rewrites55.2%
Final simplification48.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+154)
(+
(/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)
(/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 4.5e+143)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(+
(- (/ (fma (* (* B B) x) -0.3333333333333333 x) B))
(/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+154) {
tmp = ((x * fma(0.3333333333333333, (B * B), -1.0)) / B) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 4.5e+143) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = -(fma(((B * B) * x), -0.3333333333333333, x) / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+154) tmp = Float64(Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 4.5e+143) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-Float64(fma(Float64(Float64(B * B) * x), -0.3333333333333333, x) / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+154], N[(N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e+143], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision] / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{+143}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, -0.3333333333333333, x\right)}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -1.35000000000000003e154Initial program 42.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites21.9%
Taylor expanded in F around inf
Applied rewrites31.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in F around -inf
Applied rewrites43.6%
if -1.35000000000000003e154 < F < 4.4999999999999997e143Initial program 96.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.f6448.2
Applied rewrites48.2%
Applied rewrites48.2%
if 4.4999999999999997e143 < F Initial program 30.2%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in F around inf
Applied rewrites65.6%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6456.2
Applied rewrites56.2%
Final simplification48.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)))
(if (<= F -1.35e+154)
(+ t_0 (/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 4.5e+143)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(+ t_0 (/ (fma (* B B) 0.16666666666666666 1.0) B))))))
double code(double F, double B, double x) {
double t_0 = (x * fma(0.3333333333333333, (B * B), -1.0)) / B;
double tmp;
if (F <= -1.35e+154) {
tmp = t_0 + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 4.5e+143) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = t_0 + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B) tmp = 0.0 if (F <= -1.35e+154) tmp = Float64(t_0 + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 4.5e+143) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(t_0 + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -1.35e+154], N[(t$95$0 + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e+143], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(t$95$0 + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t\_0 + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{+143}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -1.35000000000000003e154Initial program 42.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites21.9%
Taylor expanded in F around inf
Applied rewrites31.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in F around -inf
Applied rewrites43.6%
if -1.35000000000000003e154 < F < 4.4999999999999997e143Initial program 96.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.f6448.2
Applied rewrites48.2%
Applied rewrites48.2%
if 4.4999999999999997e143 < F Initial program 30.2%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites27.2%
Taylor expanded in F around inf
Applied rewrites65.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6456.2
Applied rewrites56.2%
Final simplification48.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+154)
(+
(/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)
(/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 1e+45)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(+ (- (/ x B)) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+154) {
tmp = ((x * fma(0.3333333333333333, (B * B), -1.0)) / B) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 1e+45) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = -(x / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+154) tmp = Float64(Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 1e+45) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+154], N[(N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+45], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 10^{+45}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -1.35000000000000003e154Initial program 42.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites21.9%
Taylor expanded in F around inf
Applied rewrites31.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-outN/A
lower-*.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6414.2
Applied rewrites14.2%
Taylor expanded in F around -inf
Applied rewrites43.6%
if -1.35000000000000003e154 < F < 9.9999999999999993e44Initial program 96.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.f6447.3
Applied rewrites47.3%
Applied rewrites47.4%
if 9.9999999999999993e44 < F Initial program 50.7%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites63.1%
Taylor expanded in B around 0
lower-/.f6456.2
Applied rewrites56.2%
Final simplification48.6%
(FPCore (F B x)
:precision binary64
(if (<= F -4e-13)
(/ (fma (/ 0.5 F) (/ (fma 2.0 x 2.0) F) (- -1.0 x)) B)
(if (<= F 1e+45)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(+ (- (/ x B)) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-13) {
tmp = fma((0.5 / F), (fma(2.0, x, 2.0) / F), (-1.0 - x)) / B;
} else if (F <= 1e+45) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = -(x / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e-13) tmp = Float64(fma(Float64(0.5 / F), Float64(fma(2.0, x, 2.0) / F), Float64(-1.0 - x)) / B); elseif (F <= 1e+45) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e-13], N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e+45], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-13}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 10^{+45}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -4.0000000000000001e-13Initial 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.1
Applied rewrites33.1%
Taylor expanded in F around -inf
Applied rewrites45.2%
if -4.0000000000000001e-13 < F < 9.9999999999999993e44Initial 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.f6447.7
Applied rewrites47.7%
Applied rewrites47.7%
if 9.9999999999999993e44 < F Initial program 50.7%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.9%
Taylor expanded in F around inf
Applied rewrites63.1%
Taylor expanded in B around 0
lower-/.f6456.2
Applied rewrites56.2%
Final simplification48.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.6e-40)
(/ (- -1.0 x) B)
(if (<= F 4.05e-47)
(/ (- x) B)
(+ (- (/ x B)) (/ (fma (* B B) 0.16666666666666666 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e-40) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.05e-47) {
tmp = -x / B;
} else {
tmp = -(x / B) + (fma((B * B), 0.16666666666666666, 1.0) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.6e-40) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.05e-47) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(-Float64(x / B)) + Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.6e-40], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.05e-47], N[((-x) / B), $MachinePrecision], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{-40}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.05 \cdot 10^{-47}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B}\\
\end{array}
\end{array}
if F < -2.6000000000000001e-40Initial program 72.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6434.1
Applied rewrites34.1%
Taylor expanded in F around -inf
Applied rewrites44.0%
if -2.6000000000000001e-40 < F < 4.0500000000000002e-47Initial 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.f6448.4
Applied rewrites48.4%
Taylor expanded in F around 0
Applied rewrites42.7%
if 4.0500000000000002e-47 < F Initial program 65.1%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites40.0%
Taylor expanded in F around inf
Applied rewrites52.0%
Taylor expanded in B around 0
lower-/.f6447.1
Applied rewrites47.1%
Final simplification44.4%
(FPCore (F B x) :precision binary64 (if (<= F -2.6e-40) (/ (- -1.0 x) B) (if (<= F 4.05e-47) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e-40) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.05e-47) {
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.6d-40)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.05d-47) 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.6e-40) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.05e-47) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.6e-40: tmp = (-1.0 - x) / B elif F <= 4.05e-47: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.6e-40) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.05e-47) 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.6e-40) tmp = (-1.0 - x) / B; elseif (F <= 4.05e-47) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.6e-40], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.05e-47], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{-40}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.05 \cdot 10^{-47}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.6000000000000001e-40Initial program 72.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6434.1
Applied rewrites34.1%
Taylor expanded in F around -inf
Applied rewrites44.0%
if -2.6000000000000001e-40 < F < 4.0500000000000002e-47Initial 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.f6448.4
Applied rewrites48.4%
Taylor expanded in F around 0
Applied rewrites42.7%
if 4.0500000000000002e-47 < F Initial program 65.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.f6439.0
Applied rewrites39.0%
Taylor expanded in F around inf
Applied rewrites46.6%
Final simplification44.2%
(FPCore (F B x) :precision binary64 (if (<= F -2.6e-40) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e-40) {
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.6d-40)) 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.6e-40) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.6e-40: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.6e-40) 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.6e-40) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.6e-40], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{-40}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.6000000000000001e-40Initial program 72.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6434.1
Applied rewrites34.1%
Taylor expanded in F around -inf
Applied rewrites44.0%
if -2.6000000000000001e-40 < F Initial program 85.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.f6444.4
Applied rewrites44.4%
Taylor expanded in F around 0
Applied rewrites33.7%
Final simplification37.2%
(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 80.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6440.9
Applied rewrites40.9%
Taylor expanded in F around 0
Applied rewrites28.5%
Final simplification28.5%
herbie shell --seed 2024318
(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))))))