
(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 32 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 (* F (sin B))) (t_1 (/ 1.0 t_0)) (t_2 (/ (- x) (tan B))))
(if (<= F -1.2e+154)
(* -1.0 (* F (+ t_1 (/ (* x (cos B)) t_0))))
(if (<= F 7000.0)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_2)
(fma F t_1 t_2)))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = 1.0 / t_0;
double t_2 = -x / tan(B);
double tmp;
if (F <= -1.2e+154) {
tmp = -1.0 * (F * (t_1 + ((x * cos(B)) / t_0)));
} else if (F <= 7000.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_2);
} else {
tmp = fma(F, t_1, t_2);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(1.0 / t_0) t_2 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.2e+154) tmp = Float64(-1.0 * Float64(F * Float64(t_1 + Float64(Float64(x * cos(B)) / t_0)))); elseif (F <= 7000.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_2); else tmp = fma(F, t_1, t_2); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e+154], N[(-1.0 * N[(F * N[(t$95$1 + N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7000.0], 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$2), $MachinePrecision], N[(F * t$95$1 + t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := \frac{1}{t\_0}\\
t_2 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{+154}:\\
\;\;\;\;-1 \cdot \left(F \cdot \left(t\_1 + \frac{x \cdot \cos B}{t\_0}\right)\right)\\
\mathbf{elif}\;F \leq 7000:\\
\;\;\;\;\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\_2\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, t\_1, t\_2\right)\\
\end{array}
if F < -1.20000000000000007e154Initial 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.f6450.3
Applied rewrites50.3%
if -1.20000000000000007e154 < F < 7e3Initial 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%
if 7e3 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (* F (sin B))))
(if (<= F -2.9e+157)
(- (* F (/ -1.0 t_1)) (/ x B))
(if (<= F 7000.0)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_0)
(fma F (/ 1.0 t_1) t_0)))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = F * sin(B);
double tmp;
if (F <= -2.9e+157) {
tmp = (F * (-1.0 / t_1)) - (x / B);
} else if (F <= 7000.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_0);
} else {
tmp = fma(F, (1.0 / t_1), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(F * sin(B)) tmp = 0.0 if (F <= -2.9e+157) tmp = Float64(Float64(F * Float64(-1.0 / t_1)) - Float64(x / B)); elseif (F <= 7000.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_0); else tmp = fma(F, Float64(1.0 / t_1), 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[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.9e+157], N[(N[(F * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7000.0], 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], N[(F * N[(1.0 / t$95$1), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := F \cdot \sin B\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{+157}:\\
\;\;\;\;F \cdot \frac{-1}{t\_1} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7000:\\
\;\;\;\;\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{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_1}, t\_0\right)\\
\end{array}
if F < -2.89999999999999988e157Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -2.89999999999999988e157 < F < 7e3Initial 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%
if 7e3 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))))
(if (<= F -2.9e+157)
(- (* F (/ -1.0 t_0)) (/ x B))
(if (<= F 1.2e+20)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F (cos B))) x) (tan B))
(fma F (/ 1.0 t_0) (/ (- x) (tan B)))))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double tmp;
if (F <= -2.9e+157) {
tmp = (F * (-1.0 / t_0)) - (x / B);
} else if (F <= 1.2e+20) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / cos(B))) - x) / tan(B);
} else {
tmp = fma(F, (1.0 / t_0), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) tmp = 0.0 if (F <= -2.9e+157) tmp = Float64(Float64(F * Float64(-1.0 / t_0)) - Float64(x / B)); elseif (F <= 1.2e+20) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / cos(B))) - x) / tan(B)); else tmp = fma(F, Float64(1.0 / t_0), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.9e+157], N[(N[(F * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e+20], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / t$95$0), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{+157}:\\
\;\;\;\;F \cdot \frac{-1}{t\_0} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+20}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\cos B} - x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_0}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -2.89999999999999988e157Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -2.89999999999999988e157 < F < 1.2e20Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites84.7%
if 1.2e20 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2e+129)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F 7000.0)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(fma F (/ 1.0 (* F (sin B))) (/ (- x) (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e+129) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= 7000.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 / (F * sin(B))), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.2e+129) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= 7000.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(1.0 / Float64(F * sin(B))), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.2e+129], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7000.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[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{+129}:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7000:\\
\;\;\;\;{\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{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -1.1999999999999999e129Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -1.1999999999999999e129 < F < 7e3Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.3
Applied rewrites76.4%
if 7e3 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -4.1)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F 1.8e-7)
(fma F (/ (pow (fma 2.0 x 2.0) -0.5) (sin B)) t_0)
(fma F (/ 1.0 (* F (sin B))) t_0)))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -4.1) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= 1.8e-7) {
tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / sin(B)), t_0);
} else {
tmp = fma(F, (1.0 / (F * sin(B))), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -4.1) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= 1.8e-7) tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / sin(B)), t_0); else tmp = fma(F, Float64(1.0 / Float64(F * 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, -4.1], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-7], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -4.1:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, t\_0\right)\\
\end{array}
if F < -4.0999999999999996Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -4.0999999999999996 < F < 1.79999999999999997e-7Initial 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 F around 0
Applied rewrites55.9%
if 1.79999999999999997e-7 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(if (<= F -4.1)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F 1.8e-7)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow 2.0 -0.5)))
(fma F (/ 1.0 (* F (sin B))) (/ (- x) (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -4.1) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= 1.8e-7) {
tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow(2.0, -0.5));
} else {
tmp = fma(F, (1.0 / (F * sin(B))), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.1) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= 1.8e-7) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (2.0 ^ -0.5))); else tmp = fma(F, Float64(1.0 / Float64(F * sin(B))), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.1], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-7], 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[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -4.1:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {2}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -4.0999999999999996Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -4.0999999999999996 < F < 1.79999999999999997e-7Initial 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.6
Applied rewrites54.6%
Taylor expanded in x around 0
lower-pow.f6456.8
Applied rewrites56.8%
if 1.79999999999999997e-7 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))))
(if (<= F -9e+151)
(- (* F (/ -1.0 t_0)) (/ x B))
(if (<= F -6e-73)
(fma
F
(/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B))
(/ (- x) (* B (+ 1.0 (* 0.3333333333333333 (pow B 2.0))))))
(if (<= F 1.7e-140)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F 5e+19)
(- (/ (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) (sin B)) (/ x B))
(fma F (/ 1.0 t_0) (/ (- x) (tan B)))))))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double tmp;
if (F <= -9e+151) {
tmp = (F * (-1.0 / t_0)) - (x / B);
} else if (F <= -6e-73) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / (B * (1.0 + (0.3333333333333333 * pow(B, 2.0))))));
} else if (F <= 1.7e-140) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 5e+19) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
} else {
tmp = fma(F, (1.0 / t_0), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) tmp = 0.0 if (F <= -9e+151) tmp = Float64(Float64(F * Float64(-1.0 / t_0)) - Float64(x / B)); elseif (F <= -6e-73) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / Float64(B * Float64(1.0 + Float64(0.3333333333333333 * (B ^ 2.0)))))); elseif (F <= 1.7e-140) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); elseif (F <= 5e+19) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B)); else tmp = fma(F, Float64(1.0 / t_0), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9e+151], N[(N[(F * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-73], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[(B * N[(1.0 + N[(0.3333333333333333 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-140], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $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], If[LessEqual[F, 5e+19], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / t$95$0), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
\mathbf{if}\;F \leq -9 \cdot 10^{+151}:\\
\;\;\;\;F \cdot \frac{-1}{t\_0} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B \cdot \left(1 + 0.3333333333333333 \cdot {B}^{2}\right)}\right)\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-140}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+19}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_0}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -8.9999999999999997e151Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -8.9999999999999997e151 < F < -6e-73Initial 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
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6457.8
Applied rewrites57.8%
if -6e-73 < F < 1.70000000000000004e-140Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6461.8
Applied rewrites61.8%
if 1.70000000000000004e-140 < F < 5e19Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
Applied rewrites57.8%
if 5e19 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (t_1 (* F (sin B))))
(if (<= F -4e+154)
(- (* F (/ -1.0 t_1)) (/ x B))
(if (<= F -6e-73)
(- (* F (/ t_0 (sin B))) (/ x B))
(if (<= F 1.7e-140)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F 5e+19)
(- (/ (* t_0 F) (sin B)) (/ x B))
(fma F (/ 1.0 t_1) (/ (- x) (tan B)))))))))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 = F * sin(B);
double tmp;
if (F <= -4e+154) {
tmp = (F * (-1.0 / t_1)) - (x / B);
} else if (F <= -6e-73) {
tmp = (F * (t_0 / sin(B))) - (x / B);
} else if (F <= 1.7e-140) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 5e+19) {
tmp = ((t_0 * F) / sin(B)) - (x / B);
} else {
tmp = fma(F, (1.0 / t_1), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(F * sin(B)) tmp = 0.0 if (F <= -4e+154) tmp = Float64(Float64(F * Float64(-1.0 / t_1)) - Float64(x / B)); elseif (F <= -6e-73) tmp = Float64(Float64(F * Float64(t_0 / sin(B))) - Float64(x / B)); elseif (F <= 1.7e-140) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); elseif (F <= 5e+19) tmp = Float64(Float64(Float64(t_0 * F) / sin(B)) - Float64(x / B)); else tmp = fma(F, Float64(1.0 / t_1), Float64(Float64(-x) / tan(B))); 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[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+154], N[(N[(F * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-73], N[(N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-140], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $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], If[LessEqual[F, 5e+19], N[(N[(N[(t$95$0 * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / t$95$1), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $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 := F \cdot \sin B\\
\mathbf{if}\;F \leq -4 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{t\_1} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-73}:\\
\;\;\;\;F \cdot \frac{t\_0}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-140}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+19}:\\
\;\;\;\;\frac{t\_0 \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_1}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -4.00000000000000015e154Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -4.00000000000000015e154 < F < -6e-73Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
if -6e-73 < F < 1.70000000000000004e-140Initial program 76.3%
Taylor expanded in B around 0
lower-/.f6461.8
Applied rewrites61.8%
if 1.70000000000000004e-140 < F < 5e19Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
Applied rewrites57.8%
if 5e19 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (t_1 (* F (sin B))))
(if (<= F -4e+154)
(- (* F (/ -1.0 t_1)) (/ x B))
(if (<= F -6e-73)
(- (* F (/ t_0 (sin B))) (/ x B))
(if (<= F 1.7e-140)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (pow (+ 2.0 (* 2.0 x)) -0.5)))
(if (<= F 5e+19)
(- (/ (* t_0 F) (sin B)) (/ x B))
(fma F (/ 1.0 t_1) (/ (- x) (tan B)))))))))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 = F * sin(B);
double tmp;
if (F <= -4e+154) {
tmp = (F * (-1.0 / t_1)) - (x / B);
} else if (F <= -6e-73) {
tmp = (F * (t_0 / sin(B))) - (x / B);
} else if (F <= 1.7e-140) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((2.0 + (2.0 * x)), -0.5));
} else if (F <= 5e+19) {
tmp = ((t_0 * F) / sin(B)) - (x / B);
} else {
tmp = fma(F, (1.0 / t_1), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(F * sin(B)) tmp = 0.0 if (F <= -4e+154) tmp = Float64(Float64(F * Float64(-1.0 / t_1)) - Float64(x / B)); elseif (F <= -6e-73) tmp = Float64(Float64(F * Float64(t_0 / sin(B))) - Float64(x / B)); elseif (F <= 1.7e-140) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))); elseif (F <= 5e+19) tmp = Float64(Float64(Float64(t_0 * F) / sin(B)) - Float64(x / B)); else tmp = fma(F, Float64(1.0 / t_1), Float64(Float64(-x) / tan(B))); 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[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+154], N[(N[(F * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-73], N[(N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-140], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e+19], N[(N[(N[(t$95$0 * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / t$95$1), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $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 := F \cdot \sin B\\
\mathbf{if}\;F \leq -4 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{t\_1} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-73}:\\
\;\;\;\;F \cdot \frac{t\_0}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-140}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+19}:\\
\;\;\;\;\frac{t\_0 \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_1}, \frac{-x}{\tan B}\right)\\
\end{array}
if F < -4.00000000000000015e154Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -4.00000000000000015e154 < F < -6e-73Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
if -6e-73 < F < 1.70000000000000004e-140Initial 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.6
Applied rewrites54.6%
Taylor expanded in B around 0
lower-/.f6448.4
Applied rewrites48.4%
if 1.70000000000000004e-140 < F < 5e19Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
Applied rewrites57.8%
if 5e19 < 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 F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6451.9
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (t_1 (* F (sin B))))
(if (<= F -4e+154)
(- (* F (/ -1.0 t_1)) (/ x B))
(if (<= F -6e-73)
(- (* F (/ t_0 (sin B))) (/ x B))
(if (<= F 1.7e-140)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (pow (+ 2.0 (* 2.0 x)) -0.5)))
(if (<= F 1e+94)
(- (/ (* t_0 F) (sin B)) (/ x B))
(- (* F (/ 1.0 t_1)) (/ x B))))))))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 = F * sin(B);
double tmp;
if (F <= -4e+154) {
tmp = (F * (-1.0 / t_1)) - (x / B);
} else if (F <= -6e-73) {
tmp = (F * (t_0 / sin(B))) - (x / B);
} else if (F <= 1.7e-140) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((2.0 + (2.0 * x)), -0.5));
} else if (F <= 1e+94) {
tmp = ((t_0 * F) / sin(B)) - (x / B);
} else {
tmp = (F * (1.0 / t_1)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(F * sin(B)) tmp = 0.0 if (F <= -4e+154) tmp = Float64(Float64(F * Float64(-1.0 / t_1)) - Float64(x / B)); elseif (F <= -6e-73) tmp = Float64(Float64(F * Float64(t_0 / sin(B))) - Float64(x / B)); elseif (F <= 1.7e-140) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))); elseif (F <= 1e+94) tmp = Float64(Float64(Float64(t_0 * F) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(1.0 / t_1)) - Float64(x / B)); 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[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+154], N[(N[(F * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -6e-73], N[(N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-140], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+94], N[(N[(N[(t$95$0 * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $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 := F \cdot \sin B\\
\mathbf{if}\;F \leq -4 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{t\_1} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-73}:\\
\;\;\;\;F \cdot \frac{t\_0}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-140}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{elif}\;F \leq 10^{+94}:\\
\;\;\;\;\frac{t\_0 \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{t\_1} - \frac{x}{B}\\
\end{array}
if F < -4.00000000000000015e154Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -4.00000000000000015e154 < F < -6e-73Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
if -6e-73 < F < 1.70000000000000004e-140Initial 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.6
Applied rewrites54.6%
Taylor expanded in B around 0
lower-/.f6448.4
Applied rewrites48.4%
if 1.70000000000000004e-140 < F < 1e94Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
Applied rewrites57.8%
if 1e94 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (t_1 (* F (sin B))))
(if (<= F -4e+154)
(- (* F (/ -1.0 t_1)) (/ x B))
(if (<= F -7.4e-178)
(fma F (/ t_0 (sin B)) (/ (- x) B))
(if (<= F 8.1e-143)
(/ (* -1.0 x) (tan B))
(if (<= F 1e+94)
(- (/ (* t_0 F) (sin B)) (/ x B))
(- (* F (/ 1.0 t_1)) (/ x B))))))))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 = F * sin(B);
double tmp;
if (F <= -4e+154) {
tmp = (F * (-1.0 / t_1)) - (x / B);
} else if (F <= -7.4e-178) {
tmp = fma(F, (t_0 / sin(B)), (-x / B));
} else if (F <= 8.1e-143) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= 1e+94) {
tmp = ((t_0 * F) / sin(B)) - (x / B);
} else {
tmp = (F * (1.0 / t_1)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(F * sin(B)) tmp = 0.0 if (F <= -4e+154) tmp = Float64(Float64(F * Float64(-1.0 / t_1)) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = fma(F, Float64(t_0 / sin(B)), Float64(Float64(-x) / B)); elseif (F <= 8.1e-143) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= 1e+94) tmp = Float64(Float64(Float64(t_0 * F) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(1.0 / t_1)) - Float64(x / B)); 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[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+154], N[(N[(F * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.1e-143], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+94], N[(N[(N[(t$95$0 * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $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 := F \cdot \sin B\\
\mathbf{if}\;F \leq -4 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{t\_1} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{t\_0}{\sin B}, \frac{-x}{B}\right)\\
\mathbf{elif}\;F \leq 8.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq 10^{+94}:\\
\;\;\;\;\frac{t\_0 \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{t\_1} - \frac{x}{B}\\
\end{array}
if F < -4.00000000000000015e154Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -4.00000000000000015e154 < F < -7.40000000000000008e-178Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites57.7%
if -7.40000000000000008e-178 < F < 8.0999999999999998e-143Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 8.0999999999999998e-143 < F < 1e94Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
Applied rewrites57.8%
if 1e94 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (t_1 (* F (sin B))))
(if (<= F -4e+154)
(- (* F (/ -1.0 t_1)) (/ x B))
(if (<= F -7.4e-178)
(- (* F (/ t_0 (sin B))) (/ x B))
(if (<= F 8.1e-143)
(/ (* -1.0 x) (tan B))
(if (<= F 1e+94)
(- (/ (* t_0 F) (sin B)) (/ x B))
(- (* F (/ 1.0 t_1)) (/ x B))))))))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 = F * sin(B);
double tmp;
if (F <= -4e+154) {
tmp = (F * (-1.0 / t_1)) - (x / B);
} else if (F <= -7.4e-178) {
tmp = (F * (t_0 / sin(B))) - (x / B);
} else if (F <= 8.1e-143) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= 1e+94) {
tmp = ((t_0 * F) / sin(B)) - (x / B);
} else {
tmp = (F * (1.0 / t_1)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_1 = Float64(F * sin(B)) tmp = 0.0 if (F <= -4e+154) tmp = Float64(Float64(F * Float64(-1.0 / t_1)) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = Float64(Float64(F * Float64(t_0 / sin(B))) - Float64(x / B)); elseif (F <= 8.1e-143) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= 1e+94) tmp = Float64(Float64(Float64(t_0 * F) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(1.0 / t_1)) - Float64(x / B)); 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[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+154], N[(N[(F * N[(-1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], N[(N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.1e-143], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+94], N[(N[(N[(t$95$0 * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $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 := F \cdot \sin B\\
\mathbf{if}\;F \leq -4 \cdot 10^{+154}:\\
\;\;\;\;F \cdot \frac{-1}{t\_1} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;F \cdot \frac{t\_0}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq 10^{+94}:\\
\;\;\;\;\frac{t\_0 \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{t\_1} - \frac{x}{B}\\
\end{array}
if F < -4.00000000000000015e154Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -4.00000000000000015e154 < F < -7.40000000000000008e-178Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
if -7.40000000000000008e-178 < F < 8.0999999999999998e-143Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 8.0999999999999998e-143 < F < 1e94Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
Applied rewrites57.8%
if 1e94 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(- (/ (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) (sin B)) (/ x B))))
(if (<= F -2e+118)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F -7.4e-178)
t_0
(if (<= F 8.1e-143)
(/ (* -1.0 x) (tan B))
(if (<= F 1e+94) t_0 (- (* F (/ 1.0 (* F (sin B)))) (/ x B))))))))double code(double F, double B, double x) {
double t_0 = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
double tmp;
if (F <= -2e+118) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = t_0;
} else if (F <= 8.1e-143) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= 1e+94) {
tmp = t_0;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B)) tmp = 0.0 if (F <= -2e+118) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = t_0; elseif (F <= 8.1e-143) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= 1e+94) tmp = t_0; else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+118], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], t$95$0, If[LessEqual[F, 8.1e-143], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+94], t$95$0, N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+118}:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 8.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq 10^{+94}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
if F < -1.99999999999999993e118Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -1.99999999999999993e118 < F < -7.40000000000000008e-178 or 8.0999999999999998e-143 < F < 1e94Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
Applied rewrites57.8%
if -7.40000000000000008e-178 < F < 8.0999999999999998e-143Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 1e94 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(- (* (/ F (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x B))))
(if (<= F -6800000000.0)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F -7.4e-178)
t_0
(if (<= F 8.1e-143)
(/ (* -1.0 x) (tan B))
(if (<= F 7000.0) t_0 (- (* F (/ 1.0 (* F (sin B)))) (/ x B))))))))double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / B);
double tmp;
if (F <= -6800000000.0) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = t_0;
} else if (F <= 8.1e-143) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= 7000.0) {
tmp = t_0;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)) tmp = 0.0 if (F <= -6800000000.0) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = t_0; elseif (F <= 8.1e-143) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= 7000.0) tmp = t_0; else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6800000000.0], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], t$95$0, If[LessEqual[F, 8.1e-143], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7000.0], t$95$0, N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{if}\;F \leq -6800000000:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 8.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq 7000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
if F < -6.8e9Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -6.8e9 < F < -7.40000000000000008e-178 or 8.0999999999999998e-143 < F < 7e3Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
if -7.40000000000000008e-178 < F < 8.0999999999999998e-143Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 7e3 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.58)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F -7.4e-178)
(- (* (/ F (sin B)) (pow (fma x 2.0 2.0) -0.5)) (/ x B))
(if (<= F 8.1e-143)
(/ (* -1.0 x) (tan B))
(if (<= F 1.8e-7)
(- (/ (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) (sin B)) (/ x B))
(- (* F (/ 1.0 (* F (sin B)))) (/ x B)))))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.58) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = ((F / sin(B)) * pow(fma(x, 2.0, 2.0), -0.5)) - (x / B);
} else if (F <= 8.1e-143) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= 1.8e-7) {
tmp = ((F * pow((2.0 + (2.0 * x)), -0.5)) / sin(B)) - (x / B);
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.58) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = Float64(Float64(Float64(F / sin(B)) * (fma(x, 2.0, 2.0) ^ -0.5)) - Float64(x / B)); elseif (F <= 8.1e-143) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= 1.8e-7) tmp = Float64(Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.58], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.1e-143], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-7], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.58:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
if F < -0.57999999999999996Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -0.57999999999999996 < F < -7.40000000000000008e-178Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
Taylor expanded in F around 0
Applied rewrites36.0%
if -7.40000000000000008e-178 < F < 8.0999999999999998e-143Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 8.0999999999999998e-143 < F < 1.79999999999999997e-7Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
Taylor expanded in F around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-sin.f6436.7
Applied rewrites36.7%
if 1.79999999999999997e-7 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (/ F (sin B)) (pow (fma x 2.0 2.0) -0.5)) (/ x B))))
(if (<= F -0.58)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F -7.4e-178)
t_0
(if (<= F 8.1e-143)
(/ (* -1.0 x) (tan B))
(if (<= F 1.8e-7) t_0 (- (* F (/ 1.0 (* F (sin B)))) (/ x B))))))))double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(fma(x, 2.0, 2.0), -0.5)) - (x / B);
double tmp;
if (F <= -0.58) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = t_0;
} else if (F <= 8.1e-143) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= 1.8e-7) {
tmp = t_0;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (fma(x, 2.0, 2.0) ^ -0.5)) - Float64(x / B)) tmp = 0.0 if (F <= -0.58) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = t_0; elseif (F <= 8.1e-143) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= 1.8e-7) tmp = t_0; else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.58], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], t$95$0, If[LessEqual[F, 8.1e-143], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-7], t$95$0, N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.58:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 8.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
if F < -0.57999999999999996Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -0.57999999999999996 < F < -7.40000000000000008e-178 or 8.0999999999999998e-143 < F < 1.79999999999999997e-7Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
Taylor expanded in F around 0
Applied rewrites36.0%
if -7.40000000000000008e-178 < F < 8.0999999999999998e-143Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 1.79999999999999997e-7 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* F (/ (pow (fma x 2.0 2.0) -0.5) (sin B))) (/ x B))))
(if (<= F -0.58)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F -7.4e-178)
t_0
(if (<= F 8.1e-143)
(/ (* -1.0 x) (tan B))
(if (<= F 1.8e-7) t_0 (- (* F (/ 1.0 (* F (sin B)))) (/ x B))))))))double code(double F, double B, double x) {
double t_0 = (F * (pow(fma(x, 2.0, 2.0), -0.5) / sin(B))) - (x / B);
double tmp;
if (F <= -0.58) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = t_0;
} else if (F <= 8.1e-143) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= 1.8e-7) {
tmp = t_0;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F * Float64((fma(x, 2.0, 2.0) ^ -0.5) / sin(B))) - Float64(x / B)) tmp = 0.0 if (F <= -0.58) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = t_0; elseif (F <= 8.1e-143) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= 1.8e-7) tmp = t_0; else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F * N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.58], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], t$95$0, If[LessEqual[F, 8.1e-143], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-7], t$95$0, N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.58:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 8.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
if F < -0.57999999999999996Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -0.57999999999999996 < F < -7.40000000000000008e-178 or 8.0999999999999998e-143 < F < 1.79999999999999997e-7Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around 0
Applied rewrites36.7%
if -7.40000000000000008e-178 < F < 8.0999999999999998e-143Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 1.79999999999999997e-7 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(if (<= F -11.0)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F -7.4e-178)
(*
(+ 1.0 (* -1.0 (/ (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x)))
(/ (- x) B))
(if (<= F 5.6e-18)
(/ (* -1.0 x) (tan B))
(- (* F (/ 1.0 (* F (sin B)))) (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -11.0) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = (1.0 + (-1.0 * ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) / x))) * (-x / B);
} else if (F <= 5.6e-18) {
tmp = (-1.0 * x) / tan(B);
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -11.0) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = Float64(Float64(1.0 + Float64(-1.0 * Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) / x))) * Float64(Float64(-x) / B)); elseif (F <= 5.6e-18) tmp = Float64(Float64(-1.0 * x) / tan(B)); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -11.0], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], N[(N[(1.0 + N[(-1.0 * 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]), $MachinePrecision]), $MachinePrecision] * N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-18], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -11:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;\left(1 + -1 \cdot \frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5}}{x}\right) \cdot \frac{-x}{B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
if F < -11Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -11 < F < -7.40000000000000008e-178Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites40.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.0
Applied rewrites44.0%
if -7.40000000000000008e-178 < F < 5.60000000000000025e-18Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 5.60000000000000025e-18 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(if (<= F -11.0)
(- (* F (/ (/ -1.0 F) (sin B))) (/ x B))
(if (<= F -7.4e-178)
(- (* (/ F B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x B))
(if (<= F 5.6e-18)
(/ (* -1.0 x) (tan B))
(- (* F (/ 1.0 (* F (sin B)))) (/ x B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -11.0) {
tmp = (F * ((-1.0 / F) / sin(B))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = ((F / B) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / B);
} else if (F <= 5.6e-18) {
tmp = (-1.0 * x) / tan(B);
} else {
tmp = (F * (1.0 / (F * sin(B)))) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -11.0) tmp = Float64(Float64(F * Float64(Float64(-1.0 / F) / sin(B))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = Float64(Float64(Float64(F / B) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 5.6e-18) tmp = Float64(Float64(-1.0 * x) / tan(B)); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * sin(B)))) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -11.0], N[(N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], 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 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-18], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -11:\\
\;\;\;\;F \cdot \frac{\frac{-1}{F}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - \frac{x}{B}\\
\end{array}
if F < -11Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f6435.4
Applied rewrites35.4%
if -11 < F < -7.40000000000000008e-178Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
Taylor expanded in B around 0
lower-/.f6435.7
Applied rewrites35.7%
if -7.40000000000000008e-178 < F < 5.60000000000000025e-18Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 5.60000000000000025e-18 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))))
(if (<= F -11.0)
(- (* F (/ -1.0 t_0)) (/ x B))
(if (<= F -7.4e-178)
(- (* (/ F B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x B))
(if (<= F 5.6e-18)
(/ (* -1.0 x) (tan B))
(- (* F (/ 1.0 t_0)) (/ x B)))))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double tmp;
if (F <= -11.0) {
tmp = (F * (-1.0 / t_0)) - (x / B);
} else if (F <= -7.4e-178) {
tmp = ((F / B) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / B);
} else if (F <= 5.6e-18) {
tmp = (-1.0 * x) / tan(B);
} else {
tmp = (F * (1.0 / t_0)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) tmp = 0.0 if (F <= -11.0) tmp = Float64(Float64(F * Float64(-1.0 / t_0)) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = Float64(Float64(Float64(F / B) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 5.6e-18) tmp = Float64(Float64(-1.0 * x) / tan(B)); else tmp = Float64(Float64(F * Float64(1.0 / t_0)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -11.0], N[(N[(F * N[(-1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], 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 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.6e-18], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
\mathbf{if}\;F \leq -11:\\
\;\;\;\;F \cdot \frac{-1}{t\_0} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{t\_0} - \frac{x}{B}\\
\end{array}
if F < -11Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -11 < F < -7.40000000000000008e-178Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
Taylor expanded in B around 0
lower-/.f6435.7
Applied rewrites35.7%
if -7.40000000000000008e-178 < F < 5.60000000000000025e-18Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 5.60000000000000025e-18 < F Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.3
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(if (<= F -11.0)
(- (* F (/ -1.0 (* F (sin B)))) (/ x B))
(if (<= F -7.4e-178)
(- (* (/ F B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x B))
(if (<= F 5.2e-17) (/ (* -1.0 x) (tan B)) (/ 1.0 (sin B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -11.0) {
tmp = (F * (-1.0 / (F * sin(B)))) - (x / B);
} else if (F <= -7.4e-178) {
tmp = ((F / B) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / B);
} else if (F <= 5.2e-17) {
tmp = (-1.0 * x) / tan(B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -11.0) tmp = Float64(Float64(F * Float64(-1.0 / Float64(F * sin(B)))) - Float64(x / B)); elseif (F <= -7.4e-178) tmp = Float64(Float64(Float64(F / B) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 5.2e-17) tmp = Float64(Float64(-1.0 * x) / tan(B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -11.0], N[(N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.4e-178], 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 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e-17], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -11:\\
\;\;\;\;F \cdot \frac{-1}{F \cdot \sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -7.4 \cdot 10^{-178}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{-17}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -11Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
add-flipN/A
+-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites57.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -11 < F < -7.40000000000000008e-178Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
Taylor expanded in B around 0
lower-/.f6435.7
Applied rewrites35.7%
if -7.40000000000000008e-178 < F < 5.20000000000000006e-17Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
if 5.20000000000000006e-17 < F Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.9e-9)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (fabs B))
(/ (* -1.0 x) (tan (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 1.9e-9) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / fabs(B);
} else {
tmp = (-1.0 * x) / tan(fabs(B));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 1.9e-9) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / abs(B)); else tmp = Float64(Float64(-1.0 * 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], 1.9e-9], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 1.9 \cdot 10^{-9}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan \left(\left|B\right|\right)}\\
\end{array}
if B < 1.90000000000000006e-9Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+r+N/A
*-commutativeN/A
lift-pow.f64N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.1
Applied rewrites44.1%
if 1.90000000000000006e-9 < B Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in F around 0
lower-*.f6455.6
Applied rewrites55.6%
(FPCore (F B x)
:precision binary64
(if (<= F -11.0)
(/ -1.0 (sin B))
(if (<= F 1e+19)
(- (* (/ F B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -11.0) {
tmp = -1.0 / sin(B);
} else if (F <= 1e+19) {
tmp = ((F / B) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -11.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1e+19) tmp = Float64(Float64(Float64(F / B) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -11.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+19], 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 / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -11:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+19}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -11Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7
Applied rewrites17.7%
if -11 < F < 1e19Initial program 76.3%
Taylor expanded in B around 0
Applied rewrites49.3%
Applied rewrites49.4%
Taylor expanded in B around 0
lower-/.f6435.7
Applied rewrites35.7%
if 1e19 < F Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(if (<= F -11.0)
(/ -1.0 (sin B))
(if (<= F 1e+19)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -11.0) {
tmp = -1.0 / sin(B);
} else if (F <= 1e+19) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -11.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1e+19) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -11.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+19], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -11:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+19}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -11Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7
Applied rewrites17.7%
if -11 < F < 1e19Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+r+N/A
*-commutativeN/A
lift-pow.f64N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.1
Applied rewrites44.1%
if 1e19 < F Initial program 76.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(if (<= F -11.0)
(/ -1.0 (sin B))
(if (<= F 10000.0)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
(/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -11.0) {
tmp = -1.0 / sin(B);
} else if (F <= 10000.0) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -11.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 10000.0) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -11.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 10000.0], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -11:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
if F < -11Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7
Applied rewrites17.7%
if -11 < F < 1e4Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+r+N/A
*-commutativeN/A
lift-pow.f64N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.1
Applied rewrites44.1%
if 1e4 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.4
Applied rewrites28.4%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+151)
(/ (* -1.0 (* F (+ (/ 1.0 F) (/ x F)))) B)
(if (<= F 10000.0)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
(/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -5e+151) {
tmp = (-1.0 * (F * ((1.0 / F) + (x / F)))) / B;
} else if (F <= 10000.0) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+151) tmp = Float64(Float64(-1.0 * Float64(F * Float64(Float64(1.0 / F) + Float64(x / F)))) / B); elseif (F <= 10000.0) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+151], N[(N[(-1.0 * N[(F * N[(N[(1.0 / F), $MachinePrecision] + N[(x / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 10000.0], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+151}:\\
\;\;\;\;\frac{-1 \cdot \left(F \cdot \left(\frac{1}{F} + \frac{x}{F}\right)\right)}{B}\\
\mathbf{elif}\;F \leq 10000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
if F < -5.0000000000000002e151Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.2
Applied rewrites28.2%
if -5.0000000000000002e151 < F < 1e4Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+r+N/A
*-commutativeN/A
lift-pow.f64N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.1
Applied rewrites44.1%
if 1e4 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.4
Applied rewrites28.4%
(FPCore (F B x)
:precision binary64
(if (<= F -0.58)
(/ (* -1.0 (* F (+ (/ 1.0 F) (/ x F)))) B)
(if (<= F 0.00165)
(/ (- (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) x) B)
(/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.58) {
tmp = (-1.0 * (F * ((1.0 / F) + (x / F)))) / B;
} else if (F <= 0.00165) {
tmp = ((F * pow((2.0 + (2.0 * x)), -0.5)) - x) / B;
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.58) tmp = Float64(Float64(-1.0 * Float64(F * Float64(Float64(1.0 / F) + Float64(x / F)))) / B); elseif (F <= 0.00165) tmp = Float64(Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) - x) / B); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.58], N[(N[(-1.0 * N[(F * N[(N[(1.0 / F), $MachinePrecision] + N[(x / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.00165], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.58:\\
\;\;\;\;\frac{-1 \cdot \left(F \cdot \left(\frac{1}{F} + \frac{x}{F}\right)\right)}{B}\\
\mathbf{elif}\;F \leq 0.00165:\\
\;\;\;\;\frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
if F < -0.57999999999999996Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.2
Applied rewrites28.2%
if -0.57999999999999996 < F < 0.00165Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around 0
lower-*.f6429.9
Applied rewrites29.9%
if 0.00165 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.4
Applied rewrites28.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e-15)
(/ (* -1.0 (* F (+ (/ 1.0 F) (/ x F)))) B)
(if (<= F 1.45e-18)
(* -1.0 (/ x B))
(/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e-15) {
tmp = (-1.0 * (F * ((1.0 / F) + (x / F)))) / B;
} else if (F <= 1.45e-18) {
tmp = -1.0 * (x / B);
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e-15) tmp = Float64(Float64(-1.0 * Float64(F * Float64(Float64(1.0 / F) + Float64(x / F)))) / B); elseif (F <= 1.45e-18) tmp = Float64(-1.0 * Float64(x / B)); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e-15], N[(N[(-1.0 * N[(F * N[(N[(1.0 / F), $MachinePrecision] + N[(x / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45e-18], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 \cdot \left(F \cdot \left(\frac{1}{F} + \frac{x}{F}\right)\right)}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
if F < -1.30000000000000002e-15Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f6428.2
Applied rewrites28.2%
if -1.30000000000000002e-15 < F < 1.45e-18Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f6429.4
Applied rewrites29.4%
if 1.45e-18 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.4
Applied rewrites28.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45e-9)
(/ -1.0 B)
(if (<= F 1.45e-18)
(* -1.0 (/ x B))
(/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-9) {
tmp = -1.0 / B;
} else if (F <= 1.45e-18) {
tmp = -1.0 * (x / B);
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-9) tmp = Float64(-1.0 / B); elseif (F <= 1.45e-18) tmp = Float64(-1.0 * Float64(x / B)); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-9], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 1.45e-18], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-18}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
if F < -1.44999999999999996e-9Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
Applied rewrites10.6%
if -1.44999999999999996e-9 < F < 1.45e-18Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f6429.4
Applied rewrites29.4%
if 1.45e-18 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.4
Applied rewrites28.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-9) (/ -1.0 B) (* -1.0 (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-9) {
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.45d-9)) 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.45e-9) {
tmp = -1.0 / B;
} else {
tmp = -1.0 * (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-9: tmp = -1.0 / B else: tmp = -1.0 * (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-9) 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.45e-9) tmp = -1.0 / B; else tmp = -1.0 * (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-9], N[(-1.0 / B), $MachinePrecision], N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{x}{B}\\
\end{array}
if F < -1.44999999999999996e-9Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
Applied rewrites10.6%
if -1.44999999999999996e-9 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f6429.4
Applied rewrites29.4%
(FPCore (F B x) :precision binary64 (if (<= F 2e-134) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2e-134) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / 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 <= 2d-134) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2e-134) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2e-134: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2e-134) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2e-134) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2e-134], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq 2 \cdot 10^{-134}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
if F < 2.00000000000000008e-134Initial program 76.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
Applied rewrites10.6%
if 2.00000000000000008e-134 < F Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
sub-to-fractionN/A
lower-/.f64N/A
Applied rewrites76.4%
Taylor expanded in B around inf
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-cos.f6484.7
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6444.1
Applied rewrites44.1%
Taylor expanded in F around inf
lower-/.f6410.1
Applied rewrites10.1%
(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.7
Applied rewrites17.7%
Taylor expanded in B around 0
Applied rewrites10.6%
herbie shell --seed 2025174
(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))))))