
(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)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
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]
\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)}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
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]
\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)}
(FPCore (F B x)
:precision binary64
(if (<= F -1e+16)
(* -1.0 (* F (/ (/ (fma (cos B) x 1.0) (sin B)) F)))
(if (<= F 1900000.0)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(fma F (/ (/ 1.0 (sin B)) F) (/ (- x) (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -1e+16) {
tmp = -1.0 * (F * ((fma(cos(B), x, 1.0) / sin(B)) / F));
} else if (F <= 1900000.0) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = fma(F, ((1.0 / sin(B)) / F), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+16) tmp = Float64(-1.0 * Float64(F * Float64(Float64(fma(cos(B), x, 1.0) / sin(B)) / F))); elseif (F <= 1900000.0) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); else tmp = fma(F, Float64(Float64(1.0 / sin(B)) / F), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+16], N[(-1.0 * N[(F * N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1900000.0], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+16}:\\
\;\;\;\;-1 \cdot \left(F \cdot \frac{\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}}{F}\right)\\
\mathbf{elif}\;F \leq 1900000:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sin B}}{F}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -1e16Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.2%
Applied rewrites49.2%
if -1e16 < F < 1.9e6Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.3%
Applied rewrites76.5%
if 1.9e6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
lift-/.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
associate-/r*N/A
*-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
rgt-mult-inverseN/A
lower-/.f64N/A
lift-sin.f6452.5%
Applied rewrites52.5%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0105)
(* -1.0 (* F (/ (/ (fma (cos B) x 1.0) (sin B)) F)))
(if (<= F 5.5e-6)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow 2.0 -0.5)))
(fma F (/ (/ 1.0 (sin B)) F) (/ (- x) (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.0105) {
tmp = -1.0 * (F * ((fma(cos(B), x, 1.0) / sin(B)) / F));
} else if (F <= 5.5e-6) {
tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow(2.0, -0.5));
} else {
tmp = fma(F, ((1.0 / sin(B)) / F), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.0105) tmp = Float64(-1.0 * Float64(F * Float64(Float64(fma(cos(B), x, 1.0) / sin(B)) / F))); elseif (F <= 5.5e-6) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (2.0 ^ -0.5))); else tmp = fma(F, Float64(Float64(1.0 / sin(B)) / F), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.0105], N[(-1.0 * N[(F * N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.5e-6], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.0105:\\
\;\;\;\;-1 \cdot \left(F \cdot \frac{\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}}{F}\right)\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-6}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {2}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sin B}}{F}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -0.0105000000000000007Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.2%
Applied rewrites49.2%
if -0.0105000000000000007 < F < 5.4999999999999999e-6Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.5%
Applied rewrites54.5%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval56.5%
Applied rewrites56.5%
if 5.4999999999999999e-6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
lift-/.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
associate-/r*N/A
*-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
rgt-mult-inverseN/A
lower-/.f64N/A
lift-sin.f6452.5%
Applied rewrites52.5%
(FPCore (F B x)
:precision binary64
(if (<= F -0.00072)
(* -1.0 (* F (/ (/ (fma (cos B) x 1.0) (sin B)) F)))
(if (<= F 5.5e-6)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F (sin B)) (pow (+ 2.0 (* 2.0 x)) -0.5)))
(fma F (/ (/ 1.0 (sin B)) F) (/ (- x) (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.00072) {
tmp = -1.0 * (F * ((fma(cos(B), x, 1.0) / sin(B)) / F));
} else if (F <= 5.5e-6) {
tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((2.0 + (2.0 * x)), -0.5));
} else {
tmp = fma(F, ((1.0 / sin(B)) / F), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.00072) tmp = Float64(-1.0 * Float64(F * Float64(Float64(fma(cos(B), x, 1.0) / sin(B)) / F))); elseif (F <= 5.5e-6) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))); else tmp = fma(F, Float64(Float64(1.0 / sin(B)) / F), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.00072], N[(-1.0 * N[(F * N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.5e-6], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.00072:\\
\;\;\;\;-1 \cdot \left(F \cdot \frac{\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}}{F}\right)\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-6}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sin B}}{F}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -7.20000000000000045e-4Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.2%
Applied rewrites49.2%
if -7.20000000000000045e-4 < F < 5.4999999999999999e-6Initial program 76.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval54.5%
Applied rewrites54.5%
if 5.4999999999999999e-6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
lift-/.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
associate-/r*N/A
*-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
rgt-mult-inverseN/A
lower-/.f64N/A
lift-sin.f6452.5%
Applied rewrites52.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -24000.0)
(* -1.0 (* F (/ (/ (fma (cos B) x 1.0) (sin B)) F)))
(if (<= F 5.5e-6)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) t_0)
(fma F (/ (/ 1.0 (sin B)) F) t_0)))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -24000.0) {
tmp = -1.0 * (F * ((fma(cos(B), x, 1.0) / sin(B)) / F));
} else if (F <= 5.5e-6) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), t_0);
} else {
tmp = fma(F, ((1.0 / sin(B)) / F), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -24000.0) tmp = Float64(-1.0 * Float64(F * Float64(Float64(fma(cos(B), x, 1.0) / sin(B)) / F))); elseif (F <= 5.5e-6) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), t_0); else tmp = fma(F, Float64(Float64(1.0 / sin(B)) / F), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -24000.0], N[(-1.0 * N[(F * N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.5e-6], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + t$95$0), $MachinePrecision], N[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -24000:\\
\;\;\;\;-1 \cdot \left(F \cdot \frac{\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}}{F}\right)\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{\sin B}}{F}, t\_0\right)\\
\end{array}
if F < -24000Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.2%
Applied rewrites49.2%
if -24000 < F < 5.4999999999999999e-6Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
if 5.4999999999999999e-6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
lift-/.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
associate-/r*N/A
*-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
associate-*r/N/A
lift-/.f64N/A
rgt-mult-inverseN/A
lower-/.f64N/A
lift-sin.f6452.5%
Applied rewrites52.5%
(FPCore (F B x)
:precision binary64
(if (<= F -24000.0)
(* -1.0 (* F (/ (/ (fma (cos B) x 1.0) (sin B)) F)))
(if (<= F 5.5e-6)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) (/ (- x) (tan B)))
(- (* (/ 1.0 (* (sin B) F)) F) (/ x (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -24000.0) {
tmp = -1.0 * (F * ((fma(cos(B), x, 1.0) / sin(B)) / F));
} else if (F <= 5.5e-6) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), (-x / tan(B)));
} else {
tmp = ((1.0 / (sin(B) * F)) * F) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -24000.0) tmp = Float64(-1.0 * Float64(F * Float64(Float64(fma(cos(B), x, 1.0) / sin(B)) / F))); elseif (F <= 5.5e-6) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(Float64(1.0 / Float64(sin(B) * F)) * F) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -24000.0], N[(-1.0 * N[(F * N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.5e-6], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -24000:\\
\;\;\;\;-1 \cdot \left(F \cdot \frac{\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}}{F}\right)\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B \cdot F} \cdot F - \frac{x}{\tan B}\\
\end{array}
if F < -24000Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.2%
Applied rewrites49.2%
if -24000 < F < 5.4999999999999999e-6Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
if 5.4999999999999999e-6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lift-sin.f64N/A
Applied rewrites52.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -24000.0)
(* -1.0 (* F (/ (/ (fma (cos B) x 1.0) (sin B)) F)))
(if (<= F 1.5e+26)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) t_0)
(if (<= F 5.8e+227)
(fma F (/ 1.0 (* F (sin B))) (* -1.0 (/ x B)))
(fma F (/ 1.0 (* B F)) t_0))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -24000.0) {
tmp = -1.0 * (F * ((fma(cos(B), x, 1.0) / sin(B)) / F));
} else if (F <= 1.5e+26) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), t_0);
} else if (F <= 5.8e+227) {
tmp = fma(F, (1.0 / (F * sin(B))), (-1.0 * (x / B)));
} else {
tmp = fma(F, (1.0 / (B * F)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -24000.0) tmp = Float64(-1.0 * Float64(F * Float64(Float64(fma(cos(B), x, 1.0) / sin(B)) / F))); elseif (F <= 1.5e+26) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), t_0); elseif (F <= 5.8e+227) tmp = fma(F, Float64(1.0 / Float64(F * sin(B))), Float64(-1.0 * Float64(x / B))); else tmp = fma(F, Float64(1.0 / Float64(B * F)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -24000.0], N[(-1.0 * N[(F * N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+26], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 5.8e+227], N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -24000:\\
\;\;\;\;-1 \cdot \left(F \cdot \frac{\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B}}{F}\right)\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, t\_0\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{B \cdot F}, t\_0\right)\\
\end{array}
if F < -24000Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.2%
Applied rewrites49.2%
if -24000 < F < 1.49999999999999999e26Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
if 1.49999999999999999e26 < F < 5.7999999999999997e227Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6432.6%
Applied rewrites32.6%
if 5.7999999999999997e227 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f6450.0%
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -24000.0)
(* (/ (fma (cos B) x 1.0) (* (sin B) F)) (- F))
(if (<= F 1.5e+26)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) t_0)
(if (<= F 5.8e+227)
(fma F (/ 1.0 (* F (sin B))) (* -1.0 (/ x B)))
(fma F (/ 1.0 (* B F)) t_0))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -24000.0) {
tmp = (fma(cos(B), x, 1.0) / (sin(B) * F)) * -F;
} else if (F <= 1.5e+26) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), t_0);
} else if (F <= 5.8e+227) {
tmp = fma(F, (1.0 / (F * sin(B))), (-1.0 * (x / B)));
} else {
tmp = fma(F, (1.0 / (B * F)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -24000.0) tmp = Float64(Float64(fma(cos(B), x, 1.0) / Float64(sin(B) * F)) * Float64(-F)); elseif (F <= 1.5e+26) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), t_0); elseif (F <= 5.8e+227) tmp = fma(F, Float64(1.0 / Float64(F * sin(B))), Float64(-1.0 * Float64(x / B))); else tmp = fma(F, Float64(1.0 / Float64(B * F)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -24000.0], N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, 1.5e+26], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 5.8e+227], N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -24000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B \cdot F} \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, t\_0\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{B \cdot F}, t\_0\right)\\
\end{array}
if F < -24000Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites49.1%
if -24000 < F < 1.49999999999999999e26Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
if 1.49999999999999999e26 < F < 5.7999999999999997e227Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6432.6%
Applied rewrites32.6%
if 5.7999999999999997e227 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f6450.0%
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (/ 1.0 (* F (sin B)))))
(if (<= F -1.45e+189)
(* -1.0 (* F (+ t_1 (/ x (* B F)))))
(if (<= F -6.1e+29)
(fma F (/ (/ -1.0 F) B) t_0)
(if (<= F -1.28e-101)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x B))
(if (<= F 4.2e+19)
(fma F (/ (pow (fma 2.0 x 2.0) -0.5) B) t_0)
(if (<= F 5.8e+227)
(fma F t_1 (* -1.0 (/ x B)))
(fma F (/ 1.0 (* B F)) t_0))))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = 1.0 / (F * sin(B));
double tmp;
if (F <= -1.45e+189) {
tmp = -1.0 * (F * (t_1 + (x / (B * F))));
} else if (F <= -6.1e+29) {
tmp = fma(F, ((-1.0 / F) / B), t_0);
} else if (F <= -1.28e-101) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / B);
} else if (F <= 4.2e+19) {
tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / B), t_0);
} else if (F <= 5.8e+227) {
tmp = fma(F, t_1, (-1.0 * (x / B)));
} else {
tmp = fma(F, (1.0 / (B * F)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(1.0 / Float64(F * sin(B))) tmp = 0.0 if (F <= -1.45e+189) tmp = Float64(-1.0 * Float64(F * Float64(t_1 + Float64(x / Float64(B * F))))); elseif (F <= -6.1e+29) tmp = fma(F, Float64(Float64(-1.0 / F) / B), t_0); elseif (F <= -1.28e-101) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B)); elseif (F <= 4.2e+19) tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / B), t_0); elseif (F <= 5.8e+227) tmp = fma(F, t_1, Float64(-1.0 * Float64(x / B))); else tmp = fma(F, Float64(1.0 / Float64(B * F)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45e+189], N[(-1.0 * N[(F * N[(t$95$1 + N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6.1e+29], N[(F * N[(N[(-1.0 / F), $MachinePrecision] / B), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, -1.28e-101], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e+19], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 5.8e+227], N[(F * t$95$1 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{1}{F \cdot \sin B}\\
\mathbf{if}\;F \leq -1.45 \cdot 10^{+189}:\\
\;\;\;\;-1 \cdot \left(F \cdot \left(t\_1 + \frac{x}{B \cdot F}\right)\right)\\
\mathbf{elif}\;F \leq -6.1 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{-1}{F}}{B}, t\_0\right)\\
\mathbf{elif}\;F \leq -1.28 \cdot 10^{-101}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{B}, t\_0\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_1, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{B \cdot F}, t\_0\right)\\
\end{array}
if F < -1.4500000000000001e189Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6432.9%
Applied rewrites32.9%
if -1.4500000000000001e189 < F < -6.0999999999999998e29Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around -inf
lower-/.f6452.1%
Applied rewrites52.1%
if -6.0999999999999998e29 < F < -1.27999999999999995e-101Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6449.0%
Applied rewrites49.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.0%
Applied rewrites49.0%
if -1.27999999999999995e-101 < F < 4.2e19Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around 0
Applied rewrites50.4%
if 4.2e19 < F < 5.7999999999999997e227Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6432.6%
Applied rewrites32.6%
if 5.7999999999999997e227 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f6450.0%
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (* F (sin B)))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.9e+156)
(* -1.0 (* F (+ t_0 (/ x (* B F)))))
(if (<= F 1.5e+26)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) t_1)
(if (<= F 5.8e+227)
(fma F t_0 (* -1.0 (/ x B)))
(fma F (/ 1.0 (* B F)) t_1))))))double code(double F, double B, double x) {
double t_0 = 1.0 / (F * sin(B));
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.9e+156) {
tmp = -1.0 * (F * (t_0 + (x / (B * F))));
} else if (F <= 1.5e+26) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), t_1);
} else if (F <= 5.8e+227) {
tmp = fma(F, t_0, (-1.0 * (x / B)));
} else {
tmp = fma(F, (1.0 / (B * F)), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / Float64(F * sin(B))) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.9e+156) tmp = Float64(-1.0 * Float64(F * Float64(t_0 + Float64(x / Float64(B * F))))); elseif (F <= 1.5e+26) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), t_1); elseif (F <= 5.8e+227) tmp = fma(F, t_0, Float64(-1.0 * Float64(x / B))); else tmp = fma(F, Float64(1.0 / Float64(B * F)), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.9e+156], N[(-1.0 * N[(F * N[(t$95$0 + N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+26], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e+227], N[(F * t$95$0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{1}{F \cdot \sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.9 \cdot 10^{+156}:\\
\;\;\;\;-1 \cdot \left(F \cdot \left(t\_0 + \frac{x}{B \cdot F}\right)\right)\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+26}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_0, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{B \cdot F}, t\_1\right)\\
\end{array}
if F < -1.90000000000000012e156Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6432.9%
Applied rewrites32.9%
if -1.90000000000000012e156 < F < 1.49999999999999999e26Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
if 1.49999999999999999e26 < F < 5.7999999999999997e227Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6432.6%
Applied rewrites32.6%
if 5.7999999999999997e227 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f6450.0%
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (* F (sin B)))) (t_1 (/ (- x) (tan B))))
(if (<= F -0.0105)
(* -1.0 (* F (+ t_0 (/ x (* B F)))))
(if (<= F 4.2e+19)
(fma F (/ (pow (fma 2.0 x 2.0) -0.5) B) t_1)
(if (<= F 5.8e+227)
(fma F t_0 (* -1.0 (/ x B)))
(fma F (/ 1.0 (* B F)) t_1))))))double code(double F, double B, double x) {
double t_0 = 1.0 / (F * sin(B));
double t_1 = -x / tan(B);
double tmp;
if (F <= -0.0105) {
tmp = -1.0 * (F * (t_0 + (x / (B * F))));
} else if (F <= 4.2e+19) {
tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / B), t_1);
} else if (F <= 5.8e+227) {
tmp = fma(F, t_0, (-1.0 * (x / B)));
} else {
tmp = fma(F, (1.0 / (B * F)), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / Float64(F * sin(B))) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.0105) tmp = Float64(-1.0 * Float64(F * Float64(t_0 + Float64(x / Float64(B * F))))); elseif (F <= 4.2e+19) tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / B), t_1); elseif (F <= 5.8e+227) tmp = fma(F, t_0, Float64(-1.0 * Float64(x / B))); else tmp = fma(F, Float64(1.0 / Float64(B * F)), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0105], N[(-1.0 * N[(F * N[(t$95$0 + N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e+19], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e+227], N[(F * t$95$0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{1}{F \cdot \sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.0105:\\
\;\;\;\;-1 \cdot \left(F \cdot \left(t\_0 + \frac{x}{B \cdot F}\right)\right)\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{B}, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_0, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{B \cdot F}, t\_1\right)\\
\end{array}
if F < -0.0105000000000000007Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6432.9%
Applied rewrites32.9%
if -0.0105000000000000007 < F < 4.2e19Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around 0
Applied rewrites50.4%
if 4.2e19 < F < 5.7999999999999997e227Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6432.6%
Applied rewrites32.6%
if 5.7999999999999997e227 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f6450.0%
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.08e-10)
(fma
F
(/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (fabs B))
(* -1.0 (/ x (fabs B))))
(+ (- (* x (/ 1.0 (tan (fabs B))))) (* (/ F (fabs B)) (/ 1.0 F))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 1.08e-10) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / fabs(B)), (-1.0 * (x / fabs(B))));
} else {
tmp = -(x * (1.0 / tan(fabs(B)))) + ((F / fabs(B)) * (1.0 / F));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 1.08e-10) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / abs(B)), Float64(-1.0 * Float64(x / abs(B)))); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(abs(B))))) + Float64(Float64(F / abs(B)) * Float64(1.0 / F))); end return Float64(copysign(1.0, B) * tmp) end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 1.08e-10], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / N[Abs[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Abs[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 1.08 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\left|B\right|}, -1 \cdot \frac{x}{\left|B\right|}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan \left(\left|B\right|\right)}\right) + \frac{F}{\left|B\right|} \cdot \frac{1}{F}\\
\end{array}
if B < 1.08000000000000002e-10Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6443.4%
Applied rewrites43.4%
if 1.08000000000000002e-10 < B Initial program 76.3%
Taylor expanded in F around inf
lower-/.f6447.5%
Applied rewrites47.5%
Taylor expanded in B around 0
lower-/.f6446.1%
Applied rewrites46.1%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1e-24)
(fma
F
(/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (fabs B))
(* -1.0 (/ x (fabs B))))
(fma F (/ 1.0 (* (fabs B) F)) (/ (- x) (tan (fabs B)))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 1e-24) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / fabs(B)), (-1.0 * (x / fabs(B))));
} else {
tmp = fma(F, (1.0 / (fabs(B) * F)), (-x / tan(fabs(B))));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 1e-24) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / abs(B)), Float64(-1.0 * Float64(x / abs(B)))); else tmp = fma(F, Float64(1.0 / Float64(abs(B) * F)), Float64(Float64(-x) / tan(abs(B)))); end return Float64(copysign(1.0, B) * tmp) end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 1e-24], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / N[Abs[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(N[Abs[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 10^{-24}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\left|B\right|}, -1 \cdot \frac{x}{\left|B\right|}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{\left|B\right| \cdot F}, \frac{-x}{\tan \left(\left|B\right|\right)}\right)\\
\end{array}
if B < 9.99999999999999924e-25Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6443.4%
Applied rewrites43.4%
if 9.99999999999999924e-25 < B Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f6450.0%
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(if (<= F -7600000000000.0)
(/ -1.0 (sin B))
(if (<= F 5.5e-6)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(fma F (/ 1.0 (* F (sin B))) (* -1.0 (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -7600000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 5.5e-6) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = fma(F, (1.0 / (F * sin(B))), (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7600000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 5.5e-6) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = fma(F, Float64(1.0 / Float64(F * sin(B))), Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7600000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.5e-6], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -7600000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-6}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -7.6e12Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.0%
Applied rewrites17.0%
if -7.6e12 < F < 5.4999999999999999e-6Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6449.0%
Applied rewrites49.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.0%
Applied rewrites49.0%
Taylor expanded in B around 0
lower-/.f6435.2%
Applied rewrites35.2%
if 5.4999999999999999e-6 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4%
Applied rewrites52.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6432.6%
Applied rewrites32.6%
(FPCore (F B x)
:precision binary64
(if (<= F -7600000000000.0)
(/ -1.0 (sin B))
(if (<= F 5.2e+174)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) (* -1.0 (/ x B)))
(if (<= F 1.02e+260)
(/ 1.0 (sin B))
(- (* (/ -1.0 F) (/ F (sin B))) (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -7600000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 5.2e+174) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), (-1.0 * (x / B)));
} else if (F <= 1.02e+260) {
tmp = 1.0 / sin(B);
} else {
tmp = ((-1.0 / F) * (F / sin(B))) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7600000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 5.2e+174) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), Float64(-1.0 * Float64(x / B))); elseif (F <= 1.02e+260) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(Float64(-1.0 / F) * Float64(F / sin(B))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7600000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e+174], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e+260], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 / F), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -7600000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+174}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{+260}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{F} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\end{array}
if F < -7.6e12Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.0%
Applied rewrites17.0%
if -7.6e12 < F < 5.1999999999999997e174Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6443.4%
Applied rewrites43.4%
if 5.1999999999999997e174 < F < 1.02e260Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if 1.02e260 < F Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6449.0%
Applied rewrites49.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.0%
Applied rewrites49.0%
Taylor expanded in F around 0
Applied rewrites35.3%
Taylor expanded in F around -inf
lower-/.f6427.3%
Applied rewrites27.3%
(FPCore (F B x)
:precision binary64
(if (<= F -7600000000000.0)
(/ -1.0 (sin B))
(if (<= F 5.2e+174)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) (* -1.0 (/ x B)))
(if (<= F 1.85e+256)
(/ 1.0 (sin B))
(* -1.0 (* (/ (+ 1.0 x) (* F B)) F))))))double code(double F, double B, double x) {
double tmp;
if (F <= -7600000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 5.2e+174) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), (-1.0 * (x / B)));
} else if (F <= 1.85e+256) {
tmp = 1.0 / sin(B);
} else {
tmp = -1.0 * (((1.0 + x) / (F * B)) * F);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7600000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 5.2e+174) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), Float64(-1.0 * Float64(x / B))); elseif (F <= 1.85e+256) tmp = Float64(1.0 / sin(B)); else tmp = Float64(-1.0 * Float64(Float64(Float64(1.0 + x) / Float64(F * B)) * F)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7600000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e+174], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e+256], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(N[(1.0 + x), $MachinePrecision] / N[(F * B), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -7600000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+174}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{+256}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\frac{1 + x}{F \cdot B} \cdot F\right)\\
\end{array}
if F < -7.6e12Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.0%
Applied rewrites17.0%
if -7.6e12 < F < 5.1999999999999997e174Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in B around 0
Applied rewrites70.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6443.4%
Applied rewrites43.4%
if 5.1999999999999997e174 < F < 1.85000000000000016e256Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if 1.85000000000000016e256 < F Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
associate-/l/N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6426.6%
Applied rewrites26.6%
(FPCore (F B x)
:precision binary64
(if (<= F -7600000000000.0)
(/ -1.0 (sin B))
(if (<= F 1420.0)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 1.85e+256)
(/ 1.0 (sin B))
(* -1.0 (* (/ (+ 1.0 x) (* F B)) F))))))double code(double F, double B, double x) {
double tmp;
if (F <= -7600000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 1420.0) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.85e+256) {
tmp = 1.0 / sin(B);
} else {
tmp = -1.0 * (((1.0 + x) / (F * B)) * F);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7600000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1420.0) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 1.85e+256) tmp = Float64(1.0 / sin(B)); else tmp = Float64(-1.0 * Float64(Float64(Float64(1.0 + x) / Float64(F * B)) * F)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7600000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1420.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e+256], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(N[(1.0 + x), $MachinePrecision] / N[(F * B), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -7600000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1420:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{+256}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\frac{1 + x}{F \cdot B} \cdot F\right)\\
\end{array}
if F < -7.6e12Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.0%
Applied rewrites17.0%
if -7.6e12 < F < 1420Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6449.0%
Applied rewrites49.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.0%
Applied rewrites49.0%
Taylor expanded in B around 0
lower-/.f6435.2%
Applied rewrites35.2%
if 1420 < F < 1.85000000000000016e256Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if 1.85000000000000016e256 < F Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
associate-/l/N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6426.6%
Applied rewrites26.6%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0105)
(/ -1.0 (sin B))
(if (<= F 1350.0)
(- (* (pow (fma x 2.0 2.0) -0.5) (/ F B)) (/ x B))
(if (<= F 1.85e+256)
(/ 1.0 (sin B))
(* -1.0 (* (/ (+ 1.0 x) (* F B)) F))))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.0105) {
tmp = -1.0 / sin(B);
} else if (F <= 1350.0) {
tmp = (pow(fma(x, 2.0, 2.0), -0.5) * (F / B)) - (x / B);
} else if (F <= 1.85e+256) {
tmp = 1.0 / sin(B);
} else {
tmp = -1.0 * (((1.0 + x) / (F * B)) * F);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.0105) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1350.0) tmp = Float64(Float64((fma(x, 2.0, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 1.85e+256) tmp = Float64(1.0 / sin(B)); else tmp = Float64(-1.0 * Float64(Float64(Float64(1.0 + x) / Float64(F * B)) * F)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.0105], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1350.0], N[(N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.85e+256], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(N[(1.0 + x), $MachinePrecision] / N[(F * B), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.0105:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1350:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{+256}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(\frac{1 + x}{F \cdot B} \cdot F\right)\\
\end{array}
if F < -0.0105000000000000007Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.0%
Applied rewrites17.0%
if -0.0105000000000000007 < F < 1350Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6449.0%
Applied rewrites49.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.0%
Applied rewrites49.0%
Taylor expanded in F around 0
Applied rewrites35.3%
Taylor expanded in B around 0
lower-/.f6428.1%
Applied rewrites28.1%
if 1350 < F < 1.85000000000000016e256Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if 1.85000000000000016e256 < F Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-/.f64N/A
div-add-revN/A
associate-/l/N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6426.6%
Applied rewrites26.6%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0105)
(/ -1.0 (sin B))
(if (<= F 6.3e+38)
(- (* (pow (fma x 2.0 2.0) -0.5) (/ F B)) (/ x B))
(* -1.0 (/ (* F (+ (/ F (* F F)) (/ x F))) B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.0105) {
tmp = -1.0 / sin(B);
} else if (F <= 6.3e+38) {
tmp = (pow(fma(x, 2.0, 2.0), -0.5) * (F / B)) - (x / B);
} else {
tmp = -1.0 * ((F * ((F / (F * F)) + (x / F))) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.0105) tmp = Float64(-1.0 / sin(B)); elseif (F <= 6.3e+38) tmp = Float64(Float64((fma(x, 2.0, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(-1.0 * Float64(Float64(F * Float64(Float64(F / Float64(F * F)) + Float64(x / F))) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.0105], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.3e+38], N[(N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(F * N[(N[(F / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.0105:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6.3 \cdot 10^{+38}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{F \cdot \left(\frac{F}{F \cdot F} + \frac{x}{F}\right)}{B}\\
\end{array}
if F < -0.0105000000000000007Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.0%
Applied rewrites17.0%
if -0.0105000000000000007 < F < 6.30000000000000003e38Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6449.0%
Applied rewrites49.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.0%
Applied rewrites49.0%
Taylor expanded in F around 0
Applied rewrites35.3%
Taylor expanded in B around 0
lower-/.f6428.1%
Applied rewrites28.1%
if 6.30000000000000003e38 < F Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
lift-/.f64N/A
mult-flipN/A
rgt-mult-inverseN/A
mult-flip-revN/A
frac-timesN/A
*-commutativeN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f6423.2%
Applied rewrites23.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.00072)
(- (/ (+ 1.0 x) B))
(if (<= F 6.3e+38)
(- (* (pow (fma x 2.0 2.0) -0.5) (/ F B)) (/ x B))
(* -1.0 (/ (* F (+ (/ F (* F F)) (/ x F))) B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.00072) {
tmp = -((1.0 + x) / B);
} else if (F <= 6.3e+38) {
tmp = (pow(fma(x, 2.0, 2.0), -0.5) * (F / B)) - (x / B);
} else {
tmp = -1.0 * ((F * ((F / (F * F)) + (x / F))) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.00072) tmp = Float64(-Float64(Float64(1.0 + x) / B)); elseif (F <= 6.3e+38) tmp = Float64(Float64((fma(x, 2.0, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(-1.0 * Float64(Float64(F * Float64(Float64(F / Float64(F * F)) + Float64(x / F))) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.00072], (-N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 6.3e+38], N[(N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(F * N[(N[(F / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.00072:\\
\;\;\;\;-\frac{1 + x}{B}\\
\mathbf{elif}\;F \leq 6.3 \cdot 10^{+38}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{F \cdot \left(\frac{F}{F \cdot F} + \frac{x}{F}\right)}{B}\\
\end{array}
if F < -7.20000000000000045e-4Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6427.9%
Applied rewrites29.0%
if -7.20000000000000045e-4 < F < 6.30000000000000003e38Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6449.0%
Applied rewrites49.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.0%
Applied rewrites49.0%
Taylor expanded in F around 0
Applied rewrites35.3%
Taylor expanded in B around 0
lower-/.f6428.1%
Applied rewrites28.1%
if 6.30000000000000003e38 < F Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
lift-/.f64N/A
mult-flipN/A
rgt-mult-inverseN/A
mult-flip-revN/A
frac-timesN/A
*-commutativeN/A
*-lft-identityN/A
lower-/.f64N/A
lower-*.f6423.2%
Applied rewrites23.2%
(FPCore (F B x) :precision binary64 (- (/ (+ 1.0 x) B)))
double code(double F, double B, double x) {
return -((1.0 + x) / B);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -((1.0d0 + x) / b)
end function
public static double code(double F, double B, double x) {
return -((1.0 + x) / B);
}
def code(F, B, x): return -((1.0 + x) / B)
function code(F, B, x) return Float64(-Float64(Float64(1.0 + x) / B)) end
function tmp = code(F, B, x) tmp = -((1.0 + x) / B); end
code[F_, B_, x_] := (-N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision])
-\frac{1 + x}{B}
Initial program 76.3%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6427.9%
Applied rewrites27.9%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6427.9%
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\frac{-1}{B}
Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.0%
Applied rewrites17.0%
Taylor expanded in B around 0
Applied rewrites10.7%
herbie shell --seed 2025189
(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))))))