
(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 22 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
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -2.7e+155)
(* (/ (fma (cos B) x 1.0) (* (sin B) F)) (- F))
(if (<= F 0.0009)
(fma F (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) t_0) (/ (- x) (tan B)))
(- t_0 (/ x (tan B)))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -2.7e+155) {
tmp = (fma(cos(B), x, 1.0) / (sin(B) * F)) * -F;
} else if (F <= 0.0009) {
tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * t_0), (-x / tan(B)));
} else {
tmp = t_0 - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -2.7e+155) tmp = Float64(Float64(fma(cos(B), x, 1.0) / Float64(sin(B) * F)) * Float64(-F)); elseif (F <= 0.0009) tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * t_0), Float64(Float64(-x) / tan(B))); else tmp = Float64(t_0 - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.7e+155], N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, 0.0009], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * t$95$0), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+155}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B \cdot F} \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\mathsf{fma}\left(F, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot t\_0, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \frac{x}{\tan B}\\
\end{array}
if F < -2.6999999999999999e155Initial program 76.9%
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.8%
Applied rewrites49.8%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites49.9%
if -2.6999999999999999e155 < F < 8.9999999999999998e-4Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6485.0%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.0%
Applied rewrites85.0%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-lft-identityN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
frac-2negN/A
lower-/.f6455.2%
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.7e+155)
(* (/ (fma (cos B) x 1.0) (* (sin B) F)) (- F))
(if (<= F 0.0009)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) 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 <= -2.7e+155) {
tmp = (fma(cos(B), x, 1.0) / (sin(B) * F)) * -F;
} else if (F <= 0.0009) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - 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 <= -2.7e+155) tmp = Float64(Float64(fma(cos(B), x, 1.0) / Float64(sin(B) * F)) * Float64(-F)); elseif (F <= 0.0009) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - 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, -2.7e+155], N[(N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+155}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B \cdot F} \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -2.6999999999999999e155Initial program 76.9%
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.8%
Applied rewrites49.8%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites49.9%
if -2.6999999999999999e155 < F < 8.9999999999999998e-4Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f6485.0%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.0%
Applied rewrites85.0%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites85.0%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-lft-identityN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
frac-2negN/A
lower-/.f6455.2%
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B)))
(t_1 (pow (fma x 2.0 (fma F F 2.0)) -0.5))
(t_2 (/ 1.0 (sin B))))
(if (<= F -44000.0)
(* (/ (fma (cos B) x 1.0) (* (sin B) F)) (- F))
(if (<= F -2.7e-46)
(fma F (* t_1 t_2) (* -1.0 (/ x B)))
(if (<= F 3.9e-79)
(- (* (/ F B) t_1) t_0)
(if (<= F 0.0009)
(+
(- (/ x B))
(*
(/ F (sin B))
(pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(- t_2 t_0)))))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5);
double t_2 = 1.0 / sin(B);
double tmp;
if (F <= -44000.0) {
tmp = (fma(cos(B), x, 1.0) / (sin(B) * F)) * -F;
} else if (F <= -2.7e-46) {
tmp = fma(F, (t_1 * t_2), (-1.0 * (x / B)));
} else if (F <= 3.9e-79) {
tmp = ((F / B) * t_1) - t_0;
} else if (F <= 0.0009) {
tmp = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_2 - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_2 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -44000.0) tmp = Float64(Float64(fma(cos(B), x, 1.0) / Float64(sin(B) * F)) * Float64(-F)); elseif (F <= -2.7e-46) tmp = fma(F, Float64(t_1 * t_2), Float64(-1.0 * Float64(x / B))); elseif (F <= 3.9e-79) tmp = Float64(Float64(Float64(F / B) * t_1) - t_0); elseif (F <= 0.0009) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(t_2 - 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[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -44000.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, -2.7e-46], N[(F * N[(t$95$1 * t$95$2), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e-79], N[(N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0009], N[((-N[(x / B), $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], N[(t$95$2 - t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_2 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -44000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{\sin B \cdot F} \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq -2.7 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_1 \cdot t\_2, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-79}:\\
\;\;\;\;\frac{F}{B} \cdot t\_1 - t\_0\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_0\\
\end{array}
if F < -44000Initial program 76.9%
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.8%
Applied rewrites49.8%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites49.9%
if -44000 < F < -2.7e-46Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6485.0%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.0%
Applied rewrites85.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.6%
Applied rewrites57.6%
if -2.7e-46 < F < 3.9000000000000001e-79Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.4%
if 3.9000000000000001e-79 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6449.7%
Applied rewrites49.7%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-lft-identityN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
frac-2negN/A
lower-/.f6455.2%
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B)))
(t_1 (pow (fma x 2.0 (fma F F 2.0)) -0.5))
(t_2 (/ 1.0 (sin B))))
(if (<= F -44000.0)
(* (+ (/ x (* B F)) (/ t_2 F)) (- F))
(if (<= F -2.7e-46)
(fma F (* t_1 t_2) (* -1.0 (/ x B)))
(if (<= F 3.9e-79)
(- (* (/ F B) t_1) t_0)
(if (<= F 0.0009)
(+
(- (/ x B))
(*
(/ F (sin B))
(pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(- t_2 t_0)))))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5);
double t_2 = 1.0 / sin(B);
double tmp;
if (F <= -44000.0) {
tmp = ((x / (B * F)) + (t_2 / F)) * -F;
} else if (F <= -2.7e-46) {
tmp = fma(F, (t_1 * t_2), (-1.0 * (x / B)));
} else if (F <= 3.9e-79) {
tmp = ((F / B) * t_1) - t_0;
} else if (F <= 0.0009) {
tmp = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_2 - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_2 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -44000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_2 / F)) * Float64(-F)); elseif (F <= -2.7e-46) tmp = fma(F, Float64(t_1 * t_2), Float64(-1.0 * Float64(x / B))); elseif (F <= 3.9e-79) tmp = Float64(Float64(Float64(F / B) * t_1) - t_0); elseif (F <= 0.0009) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(t_2 - 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[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -44000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, -2.7e-46], N[(F * N[(t$95$1 * t$95$2), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e-79], N[(N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0009], N[((-N[(x / B), $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], N[(t$95$2 - t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_2 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -44000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_2}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq -2.7 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_1 \cdot t\_2, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-79}:\\
\;\;\;\;\frac{F}{B} \cdot t\_1 - t\_0\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_0\\
\end{array}
if F < -44000Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -44000 < F < -2.7e-46Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6485.0%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.0%
Applied rewrites85.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.6%
Applied rewrites57.6%
if -2.7e-46 < F < 3.9000000000000001e-79Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.4%
if 3.9000000000000001e-79 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6449.7%
Applied rewrites49.7%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-lft-identityN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
frac-2negN/A
lower-/.f6455.2%
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B)))
(t_1 (pow (fma x 2.0 (fma F F 2.0)) -0.5))
(t_2 (/ 1.0 (sin B))))
(if (<= F -44000.0)
(* (+ (/ x (* B F)) (/ t_2 F)) (- F))
(if (<= F -2.7e-46)
(fma F (* t_1 t_2) (* -1.0 (/ x B)))
(if (<= F 6.8e-78)
(- (* (/ F B) t_1) t_0)
(if (<= F 0.0009)
(/ (* F (pow (+ 2.0 (pow F 2.0)) -0.5)) (sin B))
(- t_2 t_0)))))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5);
double t_2 = 1.0 / sin(B);
double tmp;
if (F <= -44000.0) {
tmp = ((x / (B * F)) + (t_2 / F)) * -F;
} else if (F <= -2.7e-46) {
tmp = fma(F, (t_1 * t_2), (-1.0 * (x / B)));
} else if (F <= 6.8e-78) {
tmp = ((F / B) * t_1) - t_0;
} else if (F <= 0.0009) {
tmp = (F * pow((2.0 + pow(F, 2.0)), -0.5)) / sin(B);
} else {
tmp = t_2 - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_2 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -44000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_2 / F)) * Float64(-F)); elseif (F <= -2.7e-46) tmp = fma(F, Float64(t_1 * t_2), Float64(-1.0 * Float64(x / B))); elseif (F <= 6.8e-78) tmp = Float64(Float64(Float64(F / B) * t_1) - t_0); elseif (F <= 0.0009) tmp = Float64(Float64(F * (Float64(2.0 + (F ^ 2.0)) ^ -0.5)) / sin(B)); else tmp = Float64(t_2 - 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[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -44000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, -2.7e-46], N[(F * N[(t$95$1 * t$95$2), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.8e-78], N[(N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(F * N[Power[N[(2.0 + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(t$95$2 - t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_2 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -44000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_2}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq -2.7 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_1 \cdot t\_2, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 6.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{F}{B} \cdot t\_1 - t\_0\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_0\\
\end{array}
if F < -44000Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -44000 < F < -2.7e-46Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6485.0%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.0%
Applied rewrites85.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.6%
Applied rewrites57.6%
if -2.7e-46 < F < 6.8000000000000002e-78Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.4%
if 6.8000000000000002e-78 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6431.0%
Applied rewrites31.0%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
*-lft-identityN/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift-neg.f64N/A
frac-2negN/A
lower-/.f6455.2%
Applied rewrites55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma x 2.0 (fma F F 2.0)) -0.5))
(t_1 (* -1.0 (/ x B)))
(t_2 (/ 1.0 (sin B))))
(if (<= F -44000.0)
(* (+ (/ x (* B F)) (/ t_2 F)) (- F))
(if (<= F -2.7e-46)
(fma F (* t_0 t_2) t_1)
(if (<= F 6.8e-78)
(- (* (/ F B) t_0) (/ x (tan B)))
(if (<= F 0.0009)
(/ (* F (pow (+ 2.0 (pow F 2.0)) -0.5)) (sin B))
(fma t_2 1.0 t_1)))))))double code(double F, double B, double x) {
double t_0 = pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5);
double t_1 = -1.0 * (x / B);
double t_2 = 1.0 / sin(B);
double tmp;
if (F <= -44000.0) {
tmp = ((x / (B * F)) + (t_2 / F)) * -F;
} else if (F <= -2.7e-46) {
tmp = fma(F, (t_0 * t_2), t_1);
} else if (F <= 6.8e-78) {
tmp = ((F / B) * t_0) - (x / tan(B));
} else if (F <= 0.0009) {
tmp = (F * pow((2.0 + pow(F, 2.0)), -0.5)) / sin(B);
} else {
tmp = fma(t_2, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(-1.0 * Float64(x / B)) t_2 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -44000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_2 / F)) * Float64(-F)); elseif (F <= -2.7e-46) tmp = fma(F, Float64(t_0 * t_2), t_1); elseif (F <= 6.8e-78) tmp = Float64(Float64(Float64(F / B) * t_0) - Float64(x / tan(B))); elseif (F <= 0.0009) tmp = Float64(Float64(F * (Float64(2.0 + (F ^ 2.0)) ^ -0.5)) / sin(B)); else tmp = fma(t_2, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -44000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, -2.7e-46], N[(F * N[(t$95$0 * t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 6.8e-78], N[(N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(F * N[Power[N[(2.0 + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(t$95$2 * 1.0 + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_1 := -1 \cdot \frac{x}{B}\\
t_2 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -44000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_2}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq -2.7 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_0 \cdot t\_2, t\_1\right)\\
\mathbf{elif}\;F \leq 6.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{F}{B} \cdot t\_0 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 1, t\_1\right)\\
\end{array}
if F < -44000Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -44000 < F < -2.7e-46Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower-*.f6485.0%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.0%
Applied rewrites85.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.6%
Applied rewrites57.6%
if -2.7e-46 < F < 6.8000000000000002e-78Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.4%
if 6.8000000000000002e-78 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6431.0%
Applied rewrites31.0%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ x B))) (t_1 (/ 1.0 (sin B))))
(if (<= F -44000.0)
(* (+ (/ x (* B F)) (/ t_1 F)) (- F))
(if (<= F -2.7e-46)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_0)
(if (<= F 6.8e-78)
(- (* (/ F B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x (tan B)))
(if (<= F 0.0009)
(/ (* F (pow (+ 2.0 (pow F 2.0)) -0.5)) (sin B))
(fma t_1 1.0 t_0)))))))double code(double F, double B, double x) {
double t_0 = -1.0 * (x / B);
double t_1 = 1.0 / sin(B);
double tmp;
if (F <= -44000.0) {
tmp = ((x / (B * F)) + (t_1 / F)) * -F;
} else if (F <= -2.7e-46) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_0);
} else if (F <= 6.8e-78) {
tmp = ((F / B) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / tan(B));
} else if (F <= 0.0009) {
tmp = (F * pow((2.0 + pow(F, 2.0)), -0.5)) / sin(B);
} else {
tmp = fma(t_1, 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 * Float64(x / B)) t_1 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -44000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_1 / F)) * Float64(-F)); elseif (F <= -2.7e-46) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_0); elseif (F <= 6.8e-78) tmp = Float64(Float64(Float64(F / B) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / tan(B))); elseif (F <= 0.0009) tmp = Float64(Float64(F * (Float64(2.0 + (F ^ 2.0)) ^ -0.5)) / sin(B)); else tmp = fma(t_1, 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -44000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, -2.7e-46], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 6.8e-78], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(F * N[Power[N[(2.0 + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 1.0 + t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := -1 \cdot \frac{x}{B}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -44000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_1}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq -2.7 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 6.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, 1, t\_0\right)\\
\end{array}
if F < -44000Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -44000 < F < -2.7e-46Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.6%
Applied rewrites57.6%
if -2.7e-46 < F < 6.8000000000000002e-78Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.4%
if 6.8000000000000002e-78 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6431.0%
Applied rewrites31.0%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ x B))) (t_1 (/ 1.0 (sin B))))
(if (<= F -44000.0)
(* (+ (/ x (* B F)) (/ t_1 F)) (- F))
(if (<= F -1.72e-46)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_0)
(if (<= F 6.8e-78)
(fma (/ -1.0 (tan B)) x (* (/ F B) (pow (fma x 2.0 2.0) -0.5)))
(if (<= F 0.0009)
(/ (* F (pow (+ 2.0 (pow F 2.0)) -0.5)) (sin B))
(fma t_1 1.0 t_0)))))))double code(double F, double B, double x) {
double t_0 = -1.0 * (x / B);
double t_1 = 1.0 / sin(B);
double tmp;
if (F <= -44000.0) {
tmp = ((x / (B * F)) + (t_1 / F)) * -F;
} else if (F <= -1.72e-46) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_0);
} else if (F <= 6.8e-78) {
tmp = fma((-1.0 / tan(B)), x, ((F / B) * pow(fma(x, 2.0, 2.0), -0.5)));
} else if (F <= 0.0009) {
tmp = (F * pow((2.0 + pow(F, 2.0)), -0.5)) / sin(B);
} else {
tmp = fma(t_1, 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 * Float64(x / B)) t_1 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -44000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_1 / F)) * Float64(-F)); elseif (F <= -1.72e-46) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_0); elseif (F <= 6.8e-78) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(Float64(F / B) * (fma(x, 2.0, 2.0) ^ -0.5))); elseif (F <= 0.0009) tmp = Float64(Float64(F * (Float64(2.0 + (F ^ 2.0)) ^ -0.5)) / sin(B)); else tmp = fma(t_1, 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -44000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, -1.72e-46], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 6.8e-78], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(N[(F / B), $MachinePrecision] * N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(F * N[Power[N[(2.0 + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 1.0 + t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := -1 \cdot \frac{x}{B}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -44000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_1}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq -1.72 \cdot 10^{-46}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 6.8 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}\right)\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + {F}^{2}\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, 1, t\_0\right)\\
\end{array}
if F < -44000Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -44000 < F < -1.7199999999999999e-46Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.6%
Applied rewrites57.6%
if -1.7199999999999999e-46 < F < 6.8000000000000002e-78Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6462.3%
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval62.3%
Applied rewrites62.3%
Taylor expanded in F around 0
Applied rewrites48.9%
if 6.8000000000000002e-78 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6431.0%
Applied rewrites31.0%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ x B)))
(t_1 (fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_0))
(t_2 (/ 1.0 (sin B))))
(if (<= F -44000.0)
(* (+ (/ x (* B F)) (/ t_2 F)) (- F))
(if (<= F -1.72e-46)
t_1
(if (<= F 3.9e-79)
(fma (/ -1.0 (tan B)) x (* (/ F B) (pow (fma x 2.0 2.0) -0.5)))
(if (<= F 0.0009) t_1 (fma t_2 1.0 t_0)))))))double code(double F, double B, double x) {
double t_0 = -1.0 * (x / B);
double t_1 = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_0);
double t_2 = 1.0 / sin(B);
double tmp;
if (F <= -44000.0) {
tmp = ((x / (B * F)) + (t_2 / F)) * -F;
} else if (F <= -1.72e-46) {
tmp = t_1;
} else if (F <= 3.9e-79) {
tmp = fma((-1.0 / tan(B)), x, ((F / B) * pow(fma(x, 2.0, 2.0), -0.5)));
} else if (F <= 0.0009) {
tmp = t_1;
} else {
tmp = fma(t_2, 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 * Float64(x / B)) t_1 = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_0) t_2 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -44000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_2 / F)) * Float64(-F)); elseif (F <= -1.72e-46) tmp = t_1; elseif (F <= 3.9e-79) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(Float64(F / B) * (fma(x, 2.0, 2.0) ^ -0.5))); elseif (F <= 0.0009) tmp = t_1; else tmp = fma(t_2, 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -44000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$2 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, -1.72e-46], t$95$1, If[LessEqual[F, 3.9e-79], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(N[(F / B), $MachinePrecision] * N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0009], t$95$1, N[(t$95$2 * 1.0 + t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := -1 \cdot \frac{x}{B}\\
t_1 := \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
t_2 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -44000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_2}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq -1.72 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}\right)\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 1, t\_0\right)\\
\end{array}
if F < -44000Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -44000 < F < -1.7199999999999999e-46 or 3.9000000000000001e-79 < F < 8.9999999999999998e-4Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.6%
Applied rewrites57.6%
if -1.7199999999999999e-46 < F < 3.9000000000000001e-79Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6462.3%
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval62.3%
Applied rewrites62.3%
Taylor expanded in F around 0
Applied rewrites48.9%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -580000000.0)
(* (+ (/ x (* B F)) (/ t_0 F)) (- F))
(if (<= F 0.0076)
(fma (/ -1.0 (tan B)) x (* (/ F B) (pow (fma x 2.0 2.0) -0.5)))
(fma t_0 1.0 (* -1.0 (/ x B)))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -580000000.0) {
tmp = ((x / (B * F)) + (t_0 / F)) * -F;
} else if (F <= 0.0076) {
tmp = fma((-1.0 / tan(B)), x, ((F / B) * pow(fma(x, 2.0, 2.0), -0.5)));
} else {
tmp = fma(t_0, 1.0, (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -580000000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_0 / F)) * Float64(-F)); elseif (F <= 0.0076) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(Float64(F / B) * (fma(x, 2.0, 2.0) ^ -0.5))); else tmp = fma(t_0, 1.0, Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -580000000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, 0.0076], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(N[(F / B), $MachinePrecision] * N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -580000000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_0}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq 0.0076:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -5.8e8Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -5.8e8 < F < 0.0076Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6462.3%
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval62.3%
Applied rewrites62.3%
Taylor expanded in F around 0
Applied rewrites48.9%
if 0.0076 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -185000000.0)
(* (+ (/ x (* B F)) (/ t_0 F)) (- F))
(if (<= F 0.0009)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma t_0 1.0 (* -1.0 (/ x B)))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -185000000.0) {
tmp = ((x / (B * F)) + (t_0 / F)) * -F;
} else if (F <= 0.0009) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma(t_0, 1.0, (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -185000000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(t_0 / F)) * Float64(-F)); elseif (F <= 0.0009) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(t_0, 1.0, Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -185000000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 / F), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(t$95$0 * 1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -185000000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{t\_0}{F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -1.85e8Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.8%
Applied rewrites33.8%
if -1.85e8 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.7%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(if (<= F -185000000.0)
(* (+ (/ x (* B F)) (/ (/ 1.0 F) (sin B))) (- F))
(if (<= F 0.0009)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma (/ 1.0 (sin B)) 1.0 (* -1.0 (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -185000000.0) {
tmp = ((x / (B * F)) + ((1.0 / F) / sin(B))) * -F;
} else if (F <= 0.0009) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma((1.0 / sin(B)), 1.0, (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -185000000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) + Float64(Float64(1.0 / F) / sin(B))) * Float64(-F)); elseif (F <= 0.0009) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -185000000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -185000000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} + \frac{\frac{1}{F}}{\sin B}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -1.85e8Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift-/.f64N/A
lower-/.f6433.7%
Applied rewrites33.7%
if -1.85e8 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.7%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(if (<= F -185000000.0)
(* (- (/ x (* B F)) (/ -1.0 (* (sin B) F))) (- F))
(if (<= F 0.0009)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma (/ 1.0 (sin B)) 1.0 (* -1.0 (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -185000000.0) {
tmp = ((x / (B * F)) - (-1.0 / (sin(B) * F))) * -F;
} else if (F <= 0.0009) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma((1.0 / sin(B)), 1.0, (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -185000000.0) tmp = Float64(Float64(Float64(x / Float64(B * F)) - Float64(-1.0 / Float64(sin(B) * F))) * Float64(-F)); elseif (F <= 0.0009) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -185000000.0], N[(N[(N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] - N[(-1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-F)), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -185000000:\\
\;\;\;\;\left(\frac{x}{B \cdot F} - \frac{-1}{\sin B \cdot F}\right) \cdot \left(-F\right)\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -1.85e8Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6433.7%
Applied rewrites33.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites33.7%
lift-+.f64N/A
add-flipN/A
lower--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-sin.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lift-sin.f64N/A
*-commutativeN/A
lift-*.f6433.7%
Applied rewrites33.7%
if -1.85e8 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.7%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1360000.0)
(/ -1.0 (sin B))
(if (<= F 0.0009)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma (/ 1.0 (sin B)) 1.0 (* -1.0 (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -1360000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 0.0009) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma((1.0 / sin(B)), 1.0, (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1360000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 0.0009) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1360000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0009], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1360000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -1.36e6Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if -1.36e6 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.7%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1360000.0)
(/ -1.0 (sin B))
(if (<= F 0.0009)
(+
(- (/ x B))
(* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(fma (/ 1.0 (sin B)) 1.0 (* -1.0 (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -1360000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 0.0009) {
tmp = -(x / B) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = fma((1.0 / sin(B)), 1.0, (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1360000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 0.0009) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1360000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0009], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $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], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1360000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.0009:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -1.36e6Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if -1.36e6 < F < 8.9999999999999998e-4Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
Taylor expanded in B around 0
lower-/.f6435.7%
Applied rewrites35.7%
if 8.9999999999999998e-4 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites55.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6435.8%
Applied rewrites35.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1360000.0)
(/ -1.0 (sin B))
(if (<= F 2.4e+25)
(+
(- (/ x B))
(* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -1360000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 2.4e+25) {
tmp = -(x / B) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
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
real(8) :: tmp
if (f <= (-1360000.0d0)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 2.4d+25) then
tmp = -(x / b) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1360000.0) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 2.4e+25) {
tmp = -(x / B) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1360000.0: tmp = -1.0 / math.sin(B) elif F <= 2.4e+25: tmp = -(x / B) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1360000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 2.4e+25) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1360000.0) tmp = -1.0 / sin(B); elseif (F <= 2.4e+25) tmp = -(x / B) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1360000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e+25], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $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], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1360000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{+25}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -1.36e6Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if -1.36e6 < F < 2.4e25Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
Taylor expanded in B around 0
lower-/.f6435.7%
Applied rewrites35.7%
if 2.4e25 < F Initial program 76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.7%
Applied rewrites16.7%
(FPCore (F B x)
:precision binary64
(if (<= F -920000000.0)
(/ -1.0 (sin B))
(if (<= F 2.4e+25)
(fma
(/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))
(/ F B)
(/ (- (* (* (* B B) x) 0.3333333333333333) x) B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -920000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 2.4e+25) {
tmp = fma((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))), (F / B), (((((B * B) * x) * 0.3333333333333333) - x) / B));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -920000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 2.4e+25) tmp = fma(Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))), Float64(F / B), Float64(Float64(Float64(Float64(Float64(B * B) * x) * 0.3333333333333333) - x) / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -920000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.4e+25], N[(N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / B), $MachinePrecision] + N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -920000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}, \frac{F}{B}, \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -9.2e8Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if -9.2e8 < F < 2.4e25Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.3%
Applied rewrites62.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6435.6%
Applied rewrites35.6%
Applied rewrites35.6%
if 2.4e25 < F Initial program 76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.7%
Applied rewrites16.7%
(FPCore (F B x) :precision binary64 (if (<= F -370.0) (/ -1.0 (sin B)) (if (<= F 9.4e+26) (* -1.0 (/ x B)) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -370.0) {
tmp = -1.0 / sin(B);
} else if (F <= 9.4e+26) {
tmp = -1.0 * (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
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
real(8) :: tmp
if (f <= (-370.0d0)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 9.4d+26) then
tmp = (-1.0d0) * (x / b)
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -370.0) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 9.4e+26) {
tmp = -1.0 * (x / B);
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -370.0: tmp = -1.0 / math.sin(B) elif F <= 9.4e+26: tmp = -1.0 * (x / B) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -370.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 9.4e+26) tmp = Float64(-1.0 * Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -370.0) tmp = -1.0 / sin(B); elseif (F <= 9.4e+26) tmp = -1.0 * (x / B); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -370.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.4e+26], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -370:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 9.4 \cdot 10^{+26}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -370Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if -370 < F < 9.3999999999999995e26Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.4%
Applied rewrites28.4%
Taylor expanded in x around inf
lower-/.f6428.8%
Applied rewrites28.8%
if 9.3999999999999995e26 < F Initial program 76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.7%
Applied rewrites16.7%
(FPCore (F B x) :precision binary64 (if (<= F -370.0) (/ -1.0 (sin B)) (* -1.0 (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -370.0) {
tmp = -1.0 / sin(B);
} else {
tmp = -1.0 * (x / B);
}
return tmp;
}
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
real(8) :: tmp
if (f <= (-370.0d0)) then
tmp = (-1.0d0) / sin(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 <= -370.0) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = -1.0 * (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -370.0: tmp = -1.0 / math.sin(B) else: tmp = -1.0 * (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -370.0) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(-1.0 * Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -370.0) tmp = -1.0 / sin(B); else tmp = -1.0 * (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -370.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -370:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\end{array}
if F < -370Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
if -370 < F Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.4%
Applied rewrites28.4%
Taylor expanded in x around inf
lower-/.f6428.8%
Applied rewrites28.8%
(FPCore (F B x) :precision binary64 (if (<= F -5.2e-56) (- (/ (+ x 1.0) B)) (* -1.0 (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e-56) {
tmp = -((x + 1.0) / B);
} else {
tmp = -1.0 * (x / B);
}
return tmp;
}
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
real(8) :: tmp
if (f <= (-5.2d-56)) then
tmp = -((x + 1.0d0) / 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 <= -5.2e-56) {
tmp = -((x + 1.0) / B);
} else {
tmp = -1.0 * (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.2e-56: tmp = -((x + 1.0) / B) else: tmp = -1.0 * (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.2e-56) tmp = Float64(-Float64(Float64(x + 1.0) / B)); else tmp = Float64(-1.0 * Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.2e-56) tmp = -((x + 1.0) / B); else tmp = -1.0 * (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.2e-56], (-N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]), N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{-56}:\\
\;\;\;\;-\frac{x + 1}{B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\end{array}
if F < -5.1999999999999999e-56Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.4%
Applied rewrites28.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6428.4%
Applied rewrites29.5%
if -5.1999999999999999e-56 < F Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.4%
Applied rewrites28.4%
Taylor expanded in x around inf
lower-/.f6428.8%
Applied rewrites28.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.26e+32) (/ -1.0 B) (* -1.0 (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+32) {
tmp = -1.0 / B;
} else {
tmp = -1.0 * (x / B);
}
return tmp;
}
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
real(8) :: tmp
if (f <= (-1.26d+32)) then
tmp = (-1.0d0) / b
else
tmp = (-1.0d0) * (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+32) {
tmp = -1.0 / B;
} else {
tmp = -1.0 * (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.26e+32: tmp = -1.0 / B else: tmp = -1.0 * (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.26e+32) tmp = Float64(-1.0 / B); else tmp = Float64(-1.0 * Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.26e+32) tmp = -1.0 / B; else tmp = -1.0 * (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.26e+32], N[(-1.0 / B), $MachinePrecision], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.26 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\end{array}
if F < -1.26e32Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
Taylor expanded in B around 0
Applied rewrites10.8%
if -1.26e32 < F Initial program 76.9%
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.8%
Applied rewrites49.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.4%
Applied rewrites28.4%
Taylor expanded in x around inf
lower-/.f6428.8%
Applied rewrites28.8%
(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.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.5%
Applied rewrites17.5%
Taylor expanded in B around 0
Applied rewrites10.8%
herbie shell --seed 2025193
(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))))))