
(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 29 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -4e+67)
(fma t_0 -1.0 t_1)
(if (<= F 6800000.0)
(fma
(/ (* F (/ 1.0 F)) (sin B))
(* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)
t_1)
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -4e+67) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 6800000.0) {
tmp = fma(((F * (1.0 / F)) / sin(B)), (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -4e+67) tmp = fma(t_0, -1.0, t_1); elseif (F <= 6800000.0) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+67], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 6800000.0], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 6800000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -3.99999999999999993e67Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -3.99999999999999993e67 < F < 6.8e6Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
if 6.8e6 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -4e+67)
(fma t_0 -1.0 t_1)
(if (<= F 6800000.0)
(fma t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) t_1)
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -4e+67) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 6800000.0) {
tmp = fma(t_0, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -4e+67) tmp = fma(t_0, -1.0, t_1); elseif (F <= 6800000.0) tmp = fma(t_0, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+67], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 6800000.0], N[(t$95$0 * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 6800000:\\
\;\;\;\;\mathsf{fma}\left(t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -3.99999999999999993e67Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -3.99999999999999993e67 < F < 6.8e6Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
if 6.8e6 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.25e+93)
(fma t_0 -1.0 t_1)
(if (<= F 6800000.0)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_1)
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.25e+93) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 6800000.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.25e+93) tmp = fma(t_0, -1.0, t_1); elseif (F <= 6800000.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.25e+93], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 6800000.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$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.25 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 6800000:\\
\;\;\;\;\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\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.25e93Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -1.25e93 < F < 6.8e6Initial program 75.7%
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 6.8e6 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1e+15)
(fma t_0 -1.0 t_1)
(if (<= F 6800000.0)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1e+15) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 6800000.0) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1e+15) tmp = fma(t_0, -1.0, t_1); elseif (F <= 6800000.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(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+15], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 6800000.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[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 6800000:\\
\;\;\;\;{\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(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1e15Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -1e15 < F < 6.8e6Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6475.7%
Applied rewrites75.8%
if 6.8e6 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -0.5)
(fma t_0 -1.0 t_1)
(if (<= F 6.5e-5)
(fma t_0 (* (pow (fma 2.0 x 2.0) -0.5) F) t_1)
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -0.5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 6.5e-5) {
tmp = fma(t_0, (pow(fma(2.0, x, 2.0), -0.5) * F), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 6.5e-5) tmp = fma(t_0, Float64((fma(2.0, x, 2.0) ^ -0.5) * F), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 6.5e-5], N[(t$95$0 * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.5:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -0.5Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -0.5 < F < 6.49999999999999943e-5Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around 0
Applied rewrites55.6%
if 6.49999999999999943e-5 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -0.5)
(fma t_0 -1.0 t_1)
(if (<= F 6.5e-5)
(fma F (/ (pow (fma x 2.0 2.0) -0.5) (sin B)) t_1)
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -0.5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 6.5e-5) {
tmp = fma(F, (pow(fma(x, 2.0, 2.0), -0.5) / sin(B)), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 6.5e-5) tmp = fma(F, Float64((fma(x, 2.0, 2.0) ^ -0.5) / sin(B)), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 6.5e-5], N[(F * N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.5:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}}{\sin B}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -0.5Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -0.5 < F < 6.49999999999999943e-5Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Applied rewrites84.7%
Taylor expanded in F around 0
Applied rewrites55.6%
if 6.49999999999999943e-5 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B)))
(t_1 (* -1.0 (/ x B)))
(t_2 (/ 1.0 (sin B)))
(t_3 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)))
(if (<= F -5.2e+66)
(fma t_2 -1.0 t_0)
(if (<= F -1.3e-161)
(fma (/ (* F (/ 1.0 F)) (sin B)) t_3 t_1)
(if (<= F 3.8e-98)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 6800000.0)
(fma
(/ (* F (* (/ 1.0 (* F F)) (/ 1.0 (/ 1.0 F)))) (sin B))
t_3
t_1)
(fma t_2 1.0 t_0)))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = -1.0 * (x / B);
double t_2 = 1.0 / sin(B);
double t_3 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F;
double tmp;
if (F <= -5.2e+66) {
tmp = fma(t_2, -1.0, t_0);
} else if (F <= -1.3e-161) {
tmp = fma(((F * (1.0 / F)) / sin(B)), t_3, t_1);
} else if (F <= 3.8e-98) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 6800000.0) {
tmp = fma(((F * ((1.0 / (F * F)) * (1.0 / (1.0 / F)))) / sin(B)), t_3, t_1);
} else {
tmp = fma(t_2, 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(-1.0 * Float64(x / B)) t_2 = Float64(1.0 / sin(B)) t_3 = Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) tmp = 0.0 if (F <= -5.2e+66) tmp = fma(t_2, -1.0, t_0); elseif (F <= -1.3e-161) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), t_3, t_1); elseif (F <= 3.8e-98) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 6800000.0) tmp = fma(Float64(Float64(F * Float64(Float64(1.0 / Float64(F * F)) * Float64(1.0 / Float64(1.0 / F)))) / sin(B)), t_3, t_1); else tmp = fma(t_2, 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]}, If[LessEqual[F, -5.2e+66], N[(t$95$2 * -1.0 + t$95$0), $MachinePrecision], If[LessEqual[F, -1.3e-161], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$3 + t$95$1), $MachinePrecision], If[LessEqual[F, 3.8e-98], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6800000.0], N[(N[(N[(F * N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$3 + t$95$1), $MachinePrecision], N[(t$95$2 * 1.0 + t$95$0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := -1 \cdot \frac{x}{B}\\
t_2 := \frac{1}{\sin B}\\
t_3 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, -1, t\_0\right)\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-161}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, t\_3, t\_1\right)\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-98}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 6800000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \left(\frac{1}{F \cdot F} \cdot \frac{1}{\frac{1}{F}}\right)}{\sin B}, t\_3, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, 1, t\_0\right)\\
\end{array}
if F < -5.20000000000000024e66Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -5.20000000000000024e66 < F < -1.29999999999999998e-161Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
if -1.29999999999999998e-161 < F < 3.8000000000000003e-98Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6461.4%
Applied rewrites61.4%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
lift-neg.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites61.5%
if 3.8000000000000003e-98 < F < 6.8e6Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
lift-/.f64N/A
metadata-evalN/A
*-rgt-identityN/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-*r*N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6445.6%
Applied rewrites45.6%
if 6.8e6 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B)))
(t_1 (/ 1.0 (sin B)))
(t_2 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)))
(if (<= F -5.2e+66)
(fma t_1 -1.0 t_0)
(if (<= F -1.3e-161)
(fma (/ (* F (/ 1.0 F)) (sin B)) t_2 (* -1.0 (/ x B)))
(if (<= F 3.8e-98)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 6800000.0)
(- (/ 1.0 (/ (sin B) t_2)) (/ x B))
(fma t_1 1.0 t_0)))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = 1.0 / sin(B);
double t_2 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F;
double tmp;
if (F <= -5.2e+66) {
tmp = fma(t_1, -1.0, t_0);
} else if (F <= -1.3e-161) {
tmp = fma(((F * (1.0 / F)) / sin(B)), t_2, (-1.0 * (x / B)));
} else if (F <= 3.8e-98) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 6800000.0) {
tmp = (1.0 / (sin(B) / t_2)) - (x / B);
} else {
tmp = fma(t_1, 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(1.0 / sin(B)) t_2 = Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) tmp = 0.0 if (F <= -5.2e+66) tmp = fma(t_1, -1.0, t_0); elseif (F <= -1.3e-161) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), t_2, Float64(-1.0 * Float64(x / B))); elseif (F <= 3.8e-98) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 6800000.0) tmp = Float64(Float64(1.0 / Float64(sin(B) / t_2)) - Float64(x / B)); else tmp = fma(t_1, 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]}, If[LessEqual[F, -5.2e+66], N[(t$95$1 * -1.0 + t$95$0), $MachinePrecision], If[LessEqual[F, -1.3e-161], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$2 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-98], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6800000.0], N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 1.0 + t$95$0), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
t_2 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -1, t\_0\right)\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-161}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, t\_2, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-98}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 6800000:\\
\;\;\;\;\frac{1}{\frac{\sin B}{t\_2}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, 1, t\_0\right)\\
\end{array}
if F < -5.20000000000000024e66Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -5.20000000000000024e66 < F < -1.29999999999999998e-161Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
if -1.29999999999999998e-161 < F < 3.8000000000000003e-98Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6461.4%
Applied rewrites61.4%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
lift-neg.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites61.5%
if 3.8000000000000003e-98 < F < 6.8e6Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
if 6.8e6 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F))
(t_1 (/ 1.0 (sin B)))
(t_2 (/ (- x) (tan B))))
(if (<= F -5.2e+66)
(fma t_1 -1.0 t_2)
(if (<= F -1.3e-161)
(- (* t_1 t_0) (/ x B))
(if (<= F 3.8e-98)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 6800000.0)
(- (/ 1.0 (/ (sin B) t_0)) (/ x B))
(fma t_1 1.0 t_2)))))))double code(double F, double B, double x) {
double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F;
double t_1 = 1.0 / sin(B);
double t_2 = -x / tan(B);
double tmp;
if (F <= -5.2e+66) {
tmp = fma(t_1, -1.0, t_2);
} else if (F <= -1.3e-161) {
tmp = (t_1 * t_0) - (x / B);
} else if (F <= 3.8e-98) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 6800000.0) {
tmp = (1.0 / (sin(B) / t_0)) - (x / B);
} else {
tmp = fma(t_1, 1.0, t_2);
}
return tmp;
}
function code(F, B, x) t_0 = Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) t_1 = Float64(1.0 / sin(B)) t_2 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -5.2e+66) tmp = fma(t_1, -1.0, t_2); elseif (F <= -1.3e-161) tmp = Float64(Float64(t_1 * t_0) - Float64(x / B)); elseif (F <= 3.8e-98) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 6800000.0) tmp = Float64(Float64(1.0 / Float64(sin(B) / t_0)) - Float64(x / B)); else tmp = fma(t_1, 1.0, t_2); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.2e+66], N[(t$95$1 * -1.0 + t$95$2), $MachinePrecision], If[LessEqual[F, -1.3e-161], N[(N[(t$95$1 * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-98], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6800000.0], N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * 1.0 + t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F\\
t_1 := \frac{1}{\sin B}\\
t_2 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -1, t\_2\right)\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-161}:\\
\;\;\;\;t\_1 \cdot t\_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-98}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 6800000:\\
\;\;\;\;\frac{1}{\frac{\sin B}{t\_0}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, 1, t\_2\right)\\
\end{array}
if F < -5.20000000000000024e66Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -5.20000000000000024e66 < F < -1.29999999999999998e-161Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
if -1.29999999999999998e-161 < F < 3.8000000000000003e-98Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6461.4%
Applied rewrites61.4%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
lift-neg.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites61.5%
if 3.8000000000000003e-98 < F < 6.8e6Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
if 6.8e6 < F Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)) (t_1 (/ 1.0 (sin B))))
(if (<= F -5.2e+66)
(fma t_1 -1.0 (/ (- x) (tan B)))
(if (<= F -1.3e-161)
(- (* t_1 t_0) (/ x B))
(if (<= F 3.8e-98)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 7e+181) (- (/ t_0 (sin B)) (/ x B)) t_1))))))double code(double F, double B, double x) {
double t_0 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F;
double t_1 = 1.0 / sin(B);
double tmp;
if (F <= -5.2e+66) {
tmp = fma(t_1, -1.0, (-x / tan(B)));
} else if (F <= -1.3e-161) {
tmp = (t_1 * t_0) - (x / B);
} else if (F <= 3.8e-98) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 7e+181) {
tmp = (t_0 / sin(B)) - (x / B);
} else {
tmp = t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) t_1 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -5.2e+66) tmp = fma(t_1, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= -1.3e-161) tmp = Float64(Float64(t_1 * t_0) - Float64(x / B)); elseif (F <= 3.8e-98) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 7e+181) tmp = Float64(Float64(t_0 / sin(B)) - Float64(x / B)); else tmp = t_1; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.2e+66], N[(t$95$1 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-161], N[(N[(t$95$1 * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-98], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e+181], N[(N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+66}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-161}:\\
\;\;\;\;t\_1 \cdot t\_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-98}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+181}:\\
\;\;\;\;\frac{t\_0}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if F < -5.20000000000000024e66Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites55.7%
if -5.20000000000000024e66 < F < -1.29999999999999998e-161Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
if -1.29999999999999998e-161 < F < 3.8000000000000003e-98Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6461.4%
Applied rewrites61.4%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-outN/A
lift-neg.f64N/A
lift-/.f64N/A
associate-/r/N/A
lift-/.f64N/A
lift-/.f64N/A
Applied rewrites61.5%
if 3.8000000000000003e-98 < F < 7.00000000000000016e181Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
if 7.00000000000000016e181 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ (* x (cos B)) (sin B)))))
(if (<= x -1.4e-152)
t_0
(if (<= x 465000000000.0)
(-
(* (/ 1.0 (sin B)) (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F))
(/ x B))
t_0))))double code(double F, double B, double x) {
double t_0 = -1.0 * ((x * cos(B)) / sin(B));
double tmp;
if (x <= -1.4e-152) {
tmp = t_0;
} else if (x <= 465000000000.0) {
tmp = ((1.0 / sin(B)) * (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) tmp = 0.0 if (x <= -1.4e-152) tmp = t_0; elseif (x <= 465000000000.0) tmp = Float64(Float64(Float64(1.0 / sin(B)) * Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F)) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e-152], t$95$0, If[LessEqual[x, 465000000000.0], N[(N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{-152}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 465000000000:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F\right) - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1.39999999999999992e-152 or 4.65e11 < x Initial program 75.7%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.7%
Applied rewrites55.7%
if -1.39999999999999992e-152 < x < 4.65e11Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -4e+111)
(fma (/ (* F (/ 1.0 F)) (sin B)) -1.0 (* -1.0 (/ x B)))
(if (<= F 7e+181)
(- (* t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)) (/ x B))
t_0))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -4e+111) {
tmp = fma(((F * (1.0 / F)) / sin(B)), -1.0, (-1.0 * (x / B)));
} else if (F <= 7e+181) {
tmp = (t_0 * (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -4e+111) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), -1.0, Float64(-1.0 * Float64(x / B))); elseif (F <= 7e+181) tmp = Float64(Float64(t_0 * Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F)) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+111], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e+181], N[(N[(t$95$0 * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+181}:\\
\;\;\;\;t\_0 \cdot \left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F\right) - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -3.99999999999999983e111Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in F around -inf
Applied rewrites36.1%
if -3.99999999999999983e111 < F < 7.00000000000000016e181Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
if 7.00000000000000016e181 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.25e+93)
(fma (/ (* F (/ 1.0 F)) (sin B)) -1.0 (* -1.0 (/ x B)))
(if (<= F 7e+181)
(fma F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) (- (/ x B)))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e+93) {
tmp = fma(((F * (1.0 / F)) / sin(B)), -1.0, (-1.0 * (x / B)));
} else if (F <= 7e+181) {
tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), -(x / B));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.25e+93) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), -1.0, Float64(-1.0 * Float64(x / B))); elseif (F <= 7e+181) tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(-Float64(x / B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.25e+93], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e+181], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+181}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, -\frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -1.25e93Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in F around -inf
Applied rewrites36.1%
if -1.25e93 < F < 7.00000000000000016e181Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites57.3%
if 7.00000000000000016e181 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -4e+111)
(fma (/ (* F (/ 1.0 F)) (sin B)) -1.0 (* -1.0 (/ x B)))
(if (<= F 7e+181)
(- (/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B)) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -4e+111) {
tmp = fma(((F * (1.0 / F)) / sin(B)), -1.0, (-1.0 * (x / B)));
} else if (F <= 7e+181) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e+111) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), -1.0, Float64(-1.0 * Float64(x / B))); elseif (F <= 7e+181) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e+111], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e+181], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+181}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -3.99999999999999983e111Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in F around -inf
Applied rewrites36.1%
if -3.99999999999999983e111 < F < 7.00000000000000016e181Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
lift-*.f64N/A
Applied rewrites57.3%
if 7.00000000000000016e181 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -950000.0)
(fma (/ (* F (/ 1.0 F)) (sin B)) -1.0 (* -1.0 (/ x B)))
(if (<= F 5.2e+144)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -950000.0) {
tmp = fma(((F * (1.0 / F)) / sin(B)), -1.0, (-1.0 * (x / B)));
} else if (F <= 5.2e+144) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -950000.0) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), -1.0, Float64(-1.0 * Float64(x / B))); elseif (F <= 5.2e+144) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -950000.0], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e+144], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -950000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+144}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -9.5e5Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in F around -inf
Applied rewrites36.1%
if -9.5e5 < F < 5.1999999999999998e144Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
if 5.1999999999999998e144 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.5)
(fma (/ (* F (/ 1.0 F)) (sin B)) -1.0 (* -1.0 (/ x B)))
(if (<= F 0.2)
(- (* (pow (fma x 2.0 2.0) -0.5) (/ F (sin B))) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.5) {
tmp = fma(((F * (1.0 / F)) / sin(B)), -1.0, (-1.0 * (x / B)));
} else if (F <= 0.2) {
tmp = (pow(fma(x, 2.0, 2.0), -0.5) * (F / sin(B))) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.5) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), -1.0, Float64(-1.0 * Float64(x / B))); elseif (F <= 0.2) tmp = Float64(Float64((fma(x, 2.0, 2.0) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.5], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.2], N[(N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.5:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 0.2:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -0.5Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in F around -inf
Applied rewrites36.1%
if -0.5 < F < 0.20000000000000001Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
Taylor expanded in F around 0
Applied rewrites34.6%
if 0.20000000000000001 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -20.0)
(fma (/ (* F (/ 1.0 F)) (sin B)) -1.0 (* -1.0 (/ x B)))
(if (<= F 53000000.0)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -20.0) {
tmp = fma(((F * (1.0 / F)) / sin(B)), -1.0, (-1.0 * (x / B)));
} else if (F <= 53000000.0) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -20.0) tmp = fma(Float64(Float64(F * Float64(1.0 / F)) / sin(B)), -1.0, Float64(-1.0 * Float64(x / B))); elseif (F <= 53000000.0) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -20.0], N[(N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 53000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -20:\\
\;\;\;\;\mathsf{fma}\left(\frac{F \cdot \frac{1}{F}}{\sin B}, -1, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 53000000:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -20Initial program 75.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites84.7%
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-plusN/A
inv-powN/A
associate-*l/N/A
associate-/r*N/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6484.7%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6457.3%
Applied rewrites57.3%
Taylor expanded in F around -inf
Applied rewrites36.1%
if -20 < F < 5.3e7Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
Taylor expanded in B around 0
lower-/.f6435.0%
Applied rewrites35.0%
if 5.3e7 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -5.8e+53)
(- (* (/ -1.0 F) (/ F (sin B))) (/ x B))
(if (<= F 53000000.0)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -5.8e+53) {
tmp = ((-1.0 / F) * (F / sin(B))) - (x / B);
} else if (F <= 53000000.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(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 <= -5.8e+53) tmp = Float64(Float64(Float64(-1.0 / F) * Float64(F / sin(B))) - Float64(x / B)); elseif (F <= 53000000.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.8e+53], N[(N[(N[(-1.0 / F), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 53000000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -5.8 \cdot 10^{+53}:\\
\;\;\;\;\frac{-1}{F} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 53000000:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -5.8000000000000004e53Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
Taylor expanded in F around -inf
lower-/.f6427.7%
Applied rewrites27.7%
if -5.8000000000000004e53 < F < 5.3e7Initial program 75.7%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.8%
if 5.3e7 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -20.0)
(- (* (/ -1.0 F) (/ F (sin B))) (/ x B))
(if (<= F 53000000.0)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -20.0) {
tmp = ((-1.0 / F) * (F / sin(B))) - (x / B);
} else if (F <= 53000000.0) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -20.0) tmp = Float64(Float64(Float64(-1.0 / F) * Float64(F / sin(B))) - Float64(x / B)); elseif (F <= 53000000.0) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -20.0], N[(N[(N[(-1.0 / F), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 53000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -20:\\
\;\;\;\;\frac{-1}{F} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 53000000:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -20Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
Taylor expanded in F around -inf
lower-/.f6427.7%
Applied rewrites27.7%
if -20 < F < 5.3e7Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
Taylor expanded in B around 0
lower-/.f6435.0%
Applied rewrites35.0%
if 5.3e7 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= F -9.8e+58)
(/ -1.0 (sin B))
(if (<= F 53000000.0)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -9.8e+58) {
tmp = -1.0 / sin(B);
} else if (F <= 53000000.0) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9.8e+58) tmp = Float64(-1.0 / sin(B)); elseif (F <= 53000000.0) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9.8e+58], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 53000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -9.8 \cdot 10^{+58}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 53000000:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -9.80000000000000037e58Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
if -9.80000000000000037e58 < F < 5.3e7Initial program 75.7%
Taylor expanded in B around 0
lower-/.f6448.5%
Applied rewrites48.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6448.5%
Applied rewrites48.5%
Taylor expanded in B around 0
lower-/.f6435.0%
Applied rewrites35.0%
if 5.3e7 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x) :precision binary64 (if (<= F -4.5e-45) (/ -1.0 (sin B)) (if (<= F 2.1e-90) (* (/ -1.0 (* B F)) F) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-45) {
tmp = -1.0 / sin(B);
} else if (F <= 2.1e-90) {
tmp = (-1.0 / (B * F)) * F;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.5d-45)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 2.1d-90) then
tmp = ((-1.0d0) / (b * f)) * f
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-45) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 2.1e-90) {
tmp = (-1.0 / (B * F)) * F;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.5e-45: tmp = -1.0 / math.sin(B) elif F <= 2.1e-90: tmp = (-1.0 / (B * F)) * F else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.5e-45) tmp = Float64(-1.0 / sin(B)); elseif (F <= 2.1e-90) tmp = Float64(Float64(-1.0 / Float64(B * F)) * F); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.5e-45) tmp = -1.0 / sin(B); elseif (F <= 2.1e-90) tmp = (-1.0 / (B * F)) * F; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.5e-45], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e-90], N[(N[(-1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -4.5 \cdot 10^{-45}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-90}:\\
\;\;\;\;\frac{-1}{B \cdot F} \cdot F\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -4.4999999999999999e-45Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
if -4.4999999999999999e-45 < F < 2.0999999999999999e-90Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
Applied rewrites10.5%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
*-inversesN/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-neg.f6412.4%
Applied rewrites12.4%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites12.5%
if 2.0999999999999999e-90 < F Initial program 75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.3%
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(if (<= x 7.2e+75)
(/ -1.0 (sin B))
(-
(*
(fma
(fma (* B B) -0.00205026455026455 -0.019444444444444445)
(* B B)
-0.16666666666666666)
B)
(/ B (* B B)))))double code(double F, double B, double x) {
double tmp;
if (x <= 7.2e+75) {
tmp = -1.0 / sin(B);
} else {
tmp = (fma(fma((B * B), -0.00205026455026455, -0.019444444444444445), (B * B), -0.16666666666666666) * B) - (B / (B * B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= 7.2e+75) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(Float64(fma(fma(Float64(B * B), -0.00205026455026455, -0.019444444444444445), Float64(B * B), -0.16666666666666666) * B) - Float64(B / Float64(B * B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, 7.2e+75], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * -0.00205026455026455 + -0.019444444444444445), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * B), $MachinePrecision] - N[(B / N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 7.2 \cdot 10^{+75}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(B \cdot B, -0.00205026455026455, -0.019444444444444445\right), B \cdot B, -0.16666666666666666\right) \cdot B - \frac{B}{B \cdot B}\\
\end{array}
if x < 7.2e75Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
if 7.2e75 < x Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f649.9%
Applied rewrites9.9%
lift-/.f64N/A
lift--.f64N/A
sub-flipN/A
metadata-evalN/A
div-add-revN/A
frac-addN/A
unpow2N/A
lift-pow.f64N/A
lower-/.f64N/A
Applied rewrites10.9%
Applied rewrites11.4%
(FPCore (F B x)
:precision binary64
(if (<= x 8.5e+78)
(/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
(-
(*
(fma
(fma (* B B) -0.00205026455026455 -0.019444444444444445)
(* B B)
-0.16666666666666666)
B)
(/ B (* B B)))))double code(double F, double B, double x) {
double tmp;
if (x <= 8.5e+78) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))));
} else {
tmp = (fma(fma((B * B), -0.00205026455026455, -0.019444444444444445), (B * B), -0.16666666666666666) * B) - (B / (B * B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= 8.5e+78) tmp = Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))); else tmp = Float64(Float64(fma(fma(Float64(B * B), -0.00205026455026455, -0.019444444444444445), Float64(B * B), -0.16666666666666666) * B) - Float64(B / Float64(B * B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, 8.5e+78], N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * -0.00205026455026455 + -0.019444444444444445), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * B), $MachinePrecision] - N[(B / N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 8.5 \cdot 10^{+78}:\\
\;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(B \cdot B, -0.00205026455026455, -0.019444444444444445\right), B \cdot B, -0.16666666666666666\right) \cdot B - \frac{B}{B \cdot B}\\
\end{array}
if x < 8.50000000000000079e78Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6410.3%
Applied rewrites10.3%
if 8.50000000000000079e78 < x Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f649.9%
Applied rewrites9.9%
lift-/.f64N/A
lift--.f64N/A
sub-flipN/A
metadata-evalN/A
div-add-revN/A
frac-addN/A
unpow2N/A
lift-pow.f64N/A
lower-/.f64N/A
Applied rewrites10.9%
Applied rewrites11.4%
(FPCore (F B x)
:precision binary64
(if (<= x 7.5e+78)
(/ -1.0 B)
(-
(*
(fma
(fma (* B B) -0.00205026455026455 -0.019444444444444445)
(* B B)
-0.16666666666666666)
B)
(/ B (* B B)))))double code(double F, double B, double x) {
double tmp;
if (x <= 7.5e+78) {
tmp = -1.0 / B;
} else {
tmp = (fma(fma((B * B), -0.00205026455026455, -0.019444444444444445), (B * B), -0.16666666666666666) * B) - (B / (B * B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= 7.5e+78) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(fma(fma(Float64(B * B), -0.00205026455026455, -0.019444444444444445), Float64(B * B), -0.16666666666666666) * B) - Float64(B / Float64(B * B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, 7.5e+78], N[(-1.0 / B), $MachinePrecision], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * -0.00205026455026455 + -0.019444444444444445), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * B), $MachinePrecision] - N[(B / N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 7.5 \cdot 10^{+78}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(B \cdot B, -0.00205026455026455, -0.019444444444444445\right), B \cdot B, -0.16666666666666666\right) \cdot B - \frac{B}{B \cdot B}\\
\end{array}
if x < 7.49999999999999934e78Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
Applied rewrites10.5%
if 7.49999999999999934e78 < x Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f649.9%
Applied rewrites9.9%
lift-/.f64N/A
lift--.f64N/A
sub-flipN/A
metadata-evalN/A
div-add-revN/A
frac-addN/A
unpow2N/A
lift-pow.f64N/A
lower-/.f64N/A
Applied rewrites10.9%
Applied rewrites11.4%
(FPCore (F B x) :precision binary64 (if (<= x 2.4e+33) (/ -1.0 B) (/ (fma (* (* -0.16666666666666666 B) B) B (* B -1.0)) (* B B))))
double code(double F, double B, double x) {
double tmp;
if (x <= 2.4e+33) {
tmp = -1.0 / B;
} else {
tmp = fma(((-0.16666666666666666 * B) * B), B, (B * -1.0)) / (B * B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= 2.4e+33) tmp = Float64(-1.0 / B); else tmp = Float64(fma(Float64(Float64(-0.16666666666666666 * B) * B), B, Float64(B * -1.0)) / Float64(B * B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, 2.4e+33], N[(-1.0 / B), $MachinePrecision], N[(N[(N[(N[(-0.16666666666666666 * B), $MachinePrecision] * B), $MachinePrecision] * B + N[(B * -1.0), $MachinePrecision]), $MachinePrecision] / N[(B * B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq 2.4 \cdot 10^{+33}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(-0.16666666666666666 \cdot B\right) \cdot B, B, B \cdot -1\right)}{B \cdot B}\\
\end{array}
if x < 2.4e33Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
Applied rewrites10.5%
if 2.4e33 < x Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f649.9%
Applied rewrites9.9%
lift-/.f64N/A
lift--.f64N/A
sub-flipN/A
metadata-evalN/A
div-add-revN/A
frac-addN/A
unpow2N/A
lift-pow.f64N/A
lower-/.f64N/A
Applied rewrites10.9%
Taylor expanded in B around 0
Applied rewrites11.1%
(FPCore (F B x) :precision binary64 (* F (/ (/ -1.0 F) B)))
double code(double F, double B, double x) {
return F * ((-1.0 / F) / 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 = f * (((-1.0d0) / f) / b)
end function
public static double code(double F, double B, double x) {
return F * ((-1.0 / F) / B);
}
def code(F, B, x): return F * ((-1.0 / F) / B)
function code(F, B, x) return Float64(F * Float64(Float64(-1.0 / F) / B)) end
function tmp = code(F, B, x) tmp = F * ((-1.0 / F) / B); end
code[F_, B_, x_] := N[(F * N[(N[(-1.0 / F), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]
F \cdot \frac{\frac{-1}{F}}{B}
Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
Applied rewrites10.5%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
rgt-mult-inverseN/A
lift-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-/.f64N/A
frac-2negN/A
distribute-frac-negN/A
frac-2neg-revN/A
lower-/.f64N/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f6412.5%
Applied rewrites12.5%
(FPCore (F B x) :precision binary64 (* (/ -1.0 (* B F)) F))
double code(double F, double B, double x) {
return (-1.0 / (B * F)) * F;
}
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 * f)) * f
end function
public static double code(double F, double B, double x) {
return (-1.0 / (B * F)) * F;
}
def code(F, B, x): return (-1.0 / (B * F)) * F
function code(F, B, x) return Float64(Float64(-1.0 / Float64(B * F)) * F) end
function tmp = code(F, B, x) tmp = (-1.0 / (B * F)) * F; end
code[F_, B_, x_] := N[(N[(-1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]
\frac{-1}{B \cdot F} \cdot F
Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
Applied rewrites10.5%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
*-inversesN/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-neg.f6412.4%
Applied rewrites12.4%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
associate-/r*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites12.5%
(FPCore (F B x) :precision binary64 (/ F (* F (- B))))
double code(double F, double B, double x) {
return F / (F * -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 = f / (f * -b)
end function
public static double code(double F, double B, double x) {
return F / (F * -B);
}
def code(F, B, x): return F / (F * -B)
function code(F, B, x) return Float64(F / Float64(F * Float64(-B))) end
function tmp = code(F, B, x) tmp = F / (F * -B); end
code[F_, B_, x_] := N[(F / N[(F * (-B)), $MachinePrecision]), $MachinePrecision]
\frac{F}{F \cdot \left(-B\right)}
Initial program 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
Applied rewrites10.5%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
*-inversesN/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-neg.f6412.4%
Applied rewrites12.4%
(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 75.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6416.9%
Applied rewrites16.9%
Taylor expanded in B around 0
Applied rewrites10.5%
herbie shell --seed 2025185
(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))))))