
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
(FPCore (F B x)
:precision binary64
(if (<= F -36.0)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 0.00018)
(/
(-
(*
(pow (fma x 2.0 (fma F F 2.0)) -0.5)
(* (/ F (sin B)) (tan B)))
x)
(tan B))
(- (/ 1.0 (sin B)) (/ x (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -36.0) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 0.00018) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * ((F / sin(B)) * tan(B))) - x) / tan(B);
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -36.0) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 0.00018) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(Float64(F / sin(B)) * tan(B))) - x) / tan(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -36.0], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00018], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -36:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.00018:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \left(\frac{F}{\sin B} \cdot \tan B\right) - x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
if F < -36Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -36 < F < 1.8000000000000001e-4Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites76.2%
if 1.8000000000000001e-4 < F Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45e+56)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 2800000000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.45e+56) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 2800000000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.45e+56) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 2800000000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45e+56], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800000000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.45 \cdot 10^{+56}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2800000000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -1.45e56Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -1.45e56 < F < 2.8e12Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.6%
Applied rewrites84.6%
if 2.8e12 < F Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+113)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 0.00018)
(- (/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+113) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 0.00018) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+113) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 0.00018) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+113], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00018], 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] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+113}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.00018:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -2e113Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -2e113 < F < 1.8000000000000001e-4Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
if 1.8000000000000001e-4 < F Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+116)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 0.00018)
(/
(fma (pow (fma x 2.0 (fma F F 2.0)) -0.5) F (* (- x) (cos B)))
(sin B))
(- (/ 1.0 (sin B)) (/ x (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -1e+116) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 0.00018) {
tmp = fma(pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), F, (-x * cos(B))) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+116) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 0.00018) tmp = Float64(fma((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), F, Float64(Float64(-x) * cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+116], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00018], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+116}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.00018:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, \left(-x\right) \cdot \cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
if F < -1e116Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -1e116 < F < 1.8000000000000001e-4Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites84.6%
if 1.8000000000000001e-4 < F Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -36.0)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 0.00018)
(- (* F (/ (pow (fma x 2.0 2.0) -0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -36.0) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 0.00018) {
tmp = (F * (pow(fma(x, 2.0, 2.0), -0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -36.0) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 0.00018) tmp = Float64(Float64(F * Float64((fma(x, 2.0, 2.0) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36.0], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00018], N[(N[(F * N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.00018:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -36Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -36 < F < 1.8000000000000001e-4Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.6%
Applied rewrites84.6%
Taylor expanded in F around 0
Applied rewrites55.8%
if 1.8000000000000001e-4 < F Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.5%
(FPCore (F B x)
:precision binary64
(if (<= F -36.0)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 0.00018)
(/ (fma (pow (+ 2.0 (* 2.0 x)) -0.5) F (* (- x) (cos B))) (sin B))
(- (/ 1.0 (sin B)) (/ x (tan B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -36.0) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 0.00018) {
tmp = fma(pow((2.0 + (2.0 * x)), -0.5), F, (-x * cos(B))) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -36.0) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 0.00018) tmp = Float64(fma((Float64(2.0 + Float64(2.0 * x)) ^ -0.5), F, Float64(Float64(-x) * cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -36.0], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00018], N[(N[(N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -36:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.00018:\\
\;\;\;\;\frac{\mathsf{fma}\left({\left(2 + 2 \cdot x\right)}^{-0.5}, F, \left(-x\right) \cdot \cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
if F < -36Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -36 < F < 1.8000000000000001e-4Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites84.6%
Taylor expanded in F around 0
lower-+.f64N/A
lower-*.f6456.2%
Applied rewrites56.2%
if 1.8000000000000001e-4 < F Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -36.0)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 0.00018)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -36.0) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 0.00018) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -36.0) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 0.00018) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -36.0], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00018], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -36:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 0.00018:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
if F < -36Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -36 < F < 1.8000000000000001e-4Initial program 76.1%
Taylor expanded in B around 0
lower-/.f6462.2%
Applied rewrites62.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
mult-flip-revN/A
lift-/.f64N/A
sub-flip-reverseN/A
lower--.f6462.3%
Applied rewrites62.3%
if 1.8000000000000001e-4 < F Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around inf
Applied rewrites56.5%
(FPCore (F B x)
:precision binary64
(if (<= F -36.0)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 5.2e-39)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(if (<= F 1.75e+154)
(-
(/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B))
(/ x B))
(/ (* (- 1.0 (/ x 1.0)) 1.0) B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -36.0) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 5.2e-39) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else if (F <= 1.75e+154) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -36.0) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 5.2e-39) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 1.75e+154) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -36.0], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.2e-39], 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, 1.75e+154], 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[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -36:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{-39}:\\
\;\;\;\;{\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 1.75 \cdot 10^{+154}:\\
\;\;\;\;\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{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -36Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -36 < F < 5.2e-39Initial program 76.1%
Taylor expanded in B around 0
lower-/.f6462.2%
Applied rewrites62.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-tan.f64N/A
mult-flip-revN/A
lift-/.f64N/A
sub-flip-reverseN/A
lower--.f6462.3%
Applied rewrites62.3%
if 5.2e-39 < F < 1.7500000000000001e154Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f6457.9%
Applied rewrites57.9%
if 1.7500000000000001e154 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e-83)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F -4.1e-107)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) (/ x B))
(if (<= F 1.45e-202)
(* -1.0 (/ (* x (cos B)) (sin B)))
(if (<= F 1.75e+154)
(-
(/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B))
(/ x B))
(/ (* (- 1.0 (/ x 1.0)) 1.0) B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e-83) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= -4.1e-107) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - (x / B);
} else if (F <= 1.45e-202) {
tmp = -1.0 * ((x * cos(B)) / sin(B));
} else if (F <= 1.75e+154) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.2e-83) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= -4.1e-107) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - Float64(x / B)); elseif (F <= 1.45e-202) tmp = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))); elseif (F <= 1.75e+154) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.2e-83], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.1e-107], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e-202], N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.75e+154], 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[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-107}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-202}:\\
\;\;\;\;-1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{+154}:\\
\;\;\;\;\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{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -5.2000000000000002e-83Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
lift--.f64N/A
sub-flipN/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
+-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
lift-/.f64N/A
Applied rewrites56.6%
if -5.2000000000000002e-83 < F < -4.0999999999999999e-107Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.6%
Applied rewrites84.6%
Taylor expanded in B around 0
lower-/.f6457.9%
Applied rewrites57.9%
if -4.0999999999999999e-107 < F < 1.4499999999999999e-202Initial program 76.1%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6456.2%
Applied rewrites56.2%
if 1.4499999999999999e-202 < F < 1.7500000000000001e154Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f6457.9%
Applied rewrites57.9%
if 1.7500000000000001e154 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e-83)
(-
(/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
(/ x (tan B)))
(if (<= F -4.1e-107)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) (/ x B))
(if (<= F 1.45e-202)
(* -1.0 (/ (* x (cos B)) (sin B)))
(if (<= F 1.75e+154)
(-
(/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B))
(/ x B))
(/ (* (- 1.0 (/ x 1.0)) 1.0) B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e-83) {
tmp = (-1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))))) - (x / tan(B));
} else if (F <= -4.1e-107) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - (x / B);
} else if (F <= 1.45e-202) {
tmp = -1.0 * ((x * cos(B)) / sin(B));
} else if (F <= 1.75e+154) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.2e-83) tmp = Float64(Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))) - Float64(x / tan(B))); elseif (F <= -4.1e-107) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - Float64(x / B)); elseif (F <= 1.45e-202) tmp = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))); elseif (F <= 1.75e+154) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.2e-83], N[(N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.1e-107], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.45e-202], N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.75e+154], 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[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{-83}:\\
\;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-107}:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-202}:\\
\;\;\;\;-1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{+154}:\\
\;\;\;\;\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{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -5.2000000000000002e-83Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6455.6%
Applied rewrites55.6%
if -5.2000000000000002e-83 < F < -4.0999999999999999e-107Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.6%
Applied rewrites84.6%
Taylor expanded in B around 0
lower-/.f6457.9%
Applied rewrites57.9%
if -4.0999999999999999e-107 < F < 1.4499999999999999e-202Initial program 76.1%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6456.2%
Applied rewrites56.2%
if 1.4499999999999999e-202 < F < 1.7500000000000001e154Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f6457.9%
Applied rewrites57.9%
if 1.7500000000000001e154 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
(/ x (tan B)))))
(if (<= x -340000000000.0)
t_0
(if (<= x 1.85e-7)
(-
(/ (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) (sin B))
(/ x B))
t_0))))double code(double F, double B, double x) {
double t_0 = (-1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))))) - (x / tan(B));
double tmp;
if (x <= -340000000000.0) {
tmp = t_0;
} else if (x <= 1.85e-7) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) / sin(B)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))) - Float64(x / tan(B))) tmp = 0.0 if (x <= -340000000000.0) tmp = t_0; elseif (x <= 1.85e-7) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B)) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -340000000000.0], t$95$0, If[LessEqual[x, 1.85e-7], 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], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -340000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{-7}:\\
\;\;\;\;\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}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -3.4e11 or 1.85e-7 < x Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6455.6%
Applied rewrites55.6%
if -3.4e11 < x < 1.85e-7Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-/.f6457.9%
Applied rewrites57.9%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 0.0115)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (fabs B))
(-
(/
-1.0
(* (fabs B) (+ 1.0 (* -0.16666666666666666 (pow (fabs B) 2.0)))))
(/ x (tan (fabs B)))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 0.0115) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / fabs(B);
} else {
tmp = (-1.0 / (fabs(B) * (1.0 + (-0.16666666666666666 * pow(fabs(B), 2.0))))) - (x / tan(fabs(B)));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 0.0115) 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 / Float64(abs(B) * Float64(1.0 + Float64(-0.16666666666666666 * (abs(B) ^ 2.0))))) - Float64(x / tan(abs(B)))); end return Float64(copysign(1.0, B) * tmp) end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 0.0115], 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 / N[(N[Abs[B], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Power[N[Abs[B], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 0.0115:\\
\;\;\;\;\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}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)} - \frac{x}{\tan \left(\left|B\right|\right)}\\
\end{array}
if B < 0.0115Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.7%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6444.7%
Applied rewrites44.7%
if 0.0115 < B Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6455.6%
Applied rewrites55.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.3e+23)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 45000.0)
(+
(/ (- (* 0.3333333333333333 (* (pow B 2.0) x)) x) B)
(* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F 1.22e+168)
(/ 1.0 (sin B))
(/ (* (- 1.0 (/ x 1.0)) 1.0) B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+23) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 45000.0) {
tmp = (((0.3333333333333333 * (pow(B, 2.0) * x)) - x) / B) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 1.22e+168) {
tmp = 1.0 / sin(B);
} else {
tmp = ((1.0 - (x / 1.0)) * 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 <= (-2.3d+23)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 45000.0d0) then
tmp = (((0.3333333333333333d0 * ((b ** 2.0d0) * x)) - x) / b) + ((f / b) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else if (f <= 1.22d+168) then
tmp = 1.0d0 / sin(b)
else
tmp = ((1.0d0 - (x / 1.0d0)) * 1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+23) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 45000.0) {
tmp = (((0.3333333333333333 * (Math.pow(B, 2.0) * x)) - x) / B) + ((F / B) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 1.22e+168) {
tmp = 1.0 / Math.sin(B);
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e+23: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 45000.0: tmp = (((0.3333333333333333 * (math.pow(B, 2.0) * x)) - x) / B) + ((F / B) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) elif F <= 1.22e+168: tmp = 1.0 / math.sin(B) else: tmp = ((1.0 - (x / 1.0)) * 1.0) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e+23) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 45000.0) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64((B ^ 2.0) * x)) - x) / B) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); elseif (F <= 1.22e+168) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.3e+23) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 45000.0) tmp = (((0.3333333333333333 * ((B ^ 2.0) * x)) - x) / B) + ((F / B) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); elseif (F <= 1.22e+168) tmp = 1.0 / sin(B); else tmp = ((1.0 - (x / 1.0)) * 1.0) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e+23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 45000.0], N[(N[(N[(N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.22e+168], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 45000:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left({B}^{2} \cdot x\right) - x}{B} + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{+168}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -2.3e23Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
Taylor expanded in B around 0
lower-/.f6437.0%
Applied rewrites37.0%
if -2.3e23 < F < 45000Initial program 76.1%
Taylor expanded in B around 0
lower-/.f6462.2%
Applied rewrites62.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6436.2%
Applied rewrites36.2%
if 45000 < F < 1.2199999999999999e168Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites84.6%
Taylor expanded in F around inf
Applied rewrites16.7%
if 1.2199999999999999e168 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -2.3e+23)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 30000000000.0)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
(if (<= F 1.22e+168)
(/ 1.0 (sin B))
(/ (* (- 1.0 (/ x 1.0)) 1.0) B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+23) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 30000000000.0) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else if (F <= 1.22e+168) {
tmp = 1.0 / sin(B);
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.3e+23) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 30000000000.0) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); elseif (F <= 1.22e+168) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.3e+23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 30000000000.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], If[LessEqual[F, 1.22e+168], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{+23}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 30000000000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{+168}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -2.3e23Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Taylor expanded in F around -inf
Applied rewrites56.6%
Taylor expanded in B around 0
lower-/.f6437.0%
Applied rewrites37.0%
if -2.3e23 < F < 3e10Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.7%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6444.7%
Applied rewrites44.7%
if 3e10 < F < 1.2199999999999999e168Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites84.6%
Taylor expanded in F around inf
Applied rewrites16.7%
if 1.2199999999999999e168 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.55e+143)
(/ (* (- 1.0 (/ x -1.0)) -1.0) B)
(if (<= F -4.5e+21)
(/ -1.0 (sin B))
(if (<= F 30000000000.0)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
(if (<= F 1.22e+168)
(/ 1.0 (sin B))
(/ (* (- 1.0 (/ x 1.0)) 1.0) B))))))double code(double F, double B, double x) {
double tmp;
if (F <= -1.55e+143) {
tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
} else if (F <= -4.5e+21) {
tmp = -1.0 / sin(B);
} else if (F <= 30000000000.0) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else if (F <= 1.22e+168) {
tmp = 1.0 / sin(B);
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.55e+143) tmp = Float64(Float64(Float64(1.0 - Float64(x / -1.0)) * -1.0) / B); elseif (F <= -4.5e+21) tmp = Float64(-1.0 / sin(B)); elseif (F <= 30000000000.0) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); elseif (F <= 1.22e+168) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.55e+143], N[(N[(N[(1.0 - N[(x / -1.0), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.5e+21], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 30000000000.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], If[LessEqual[F, 1.22e+168], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{+143}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\
\mathbf{elif}\;F \leq -4.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 30000000000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{+168}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -1.55e143Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites19.3%
Taylor expanded in F around -inf
Applied rewrites30.5%
if -1.55e143 < F < -4.5e21Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites84.6%
Taylor expanded in F around -inf
Applied rewrites17.3%
if -4.5e21 < F < 3e10Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.7%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6444.7%
Applied rewrites44.7%
if 3e10 < F < 1.2199999999999999e168Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites84.6%
Taylor expanded in F around inf
Applied rewrites16.7%
if 1.2199999999999999e168 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.55e+143)
(/ (* (- 1.0 (/ x -1.0)) -1.0) B)
(if (<= F -4.5e+21)
(/ -1.0 (sin B))
(if (<= F 430000000.0)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
(/ (* (- 1.0 (/ x 1.0)) 1.0) B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -1.55e+143) {
tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
} else if (F <= -4.5e+21) {
tmp = -1.0 / sin(B);
} else if (F <= 430000000.0) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.55e+143) tmp = Float64(Float64(Float64(1.0 - Float64(x / -1.0)) * -1.0) / B); elseif (F <= -4.5e+21) tmp = Float64(-1.0 / sin(B)); elseif (F <= 430000000.0) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.55e+143], N[(N[(N[(1.0 - N[(x / -1.0), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.5e+21], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 430000000.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[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{+143}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\
\mathbf{elif}\;F \leq -4.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 430000000:\\
\;\;\;\;\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{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -1.55e143Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites19.3%
Taylor expanded in F around -inf
Applied rewrites30.5%
if -1.55e143 < F < -4.5e21Initial program 76.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.1%
Applied rewrites84.7%
Applied rewrites84.6%
Taylor expanded in F around -inf
Applied rewrites17.3%
if -4.5e21 < F < 4.3e8Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.7%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6444.7%
Applied rewrites44.7%
if 4.3e8 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+116)
(/ (* (- 1.0 (/ x -1.0)) -1.0) B)
(if (<= F 430000000.0)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) B)
(/ (* (- 1.0 (/ x 1.0)) 1.0) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -1e+116) {
tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
} else if (F <= 430000000.0) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+116) tmp = Float64(Float64(Float64(1.0 - Float64(x / -1.0)) * -1.0) / B); elseif (F <= 430000000.0) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+116], N[(N[(N[(1.0 - N[(x / -1.0), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 430000000.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[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+116}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\
\mathbf{elif}\;F \leq 430000000:\\
\;\;\;\;\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{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -1e116Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites19.3%
Taylor expanded in F around -inf
Applied rewrites30.5%
if -1e116 < F < 4.3e8Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-*.f6444.7%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6444.7%
Applied rewrites44.7%
if 4.3e8 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -36.0)
(/ (* (- 1.0 (/ x -1.0)) -1.0) B)
(if (<= F 2700000000000.0)
(/ (- (* (pow (fma 2.0 x 2.0) -0.5) F) x) B)
(/ (* (- 1.0 (/ x 1.0)) 1.0) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -36.0) {
tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
} else if (F <= 2700000000000.0) {
tmp = ((pow(fma(2.0, x, 2.0), -0.5) * F) - x) / B;
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -36.0) tmp = Float64(Float64(Float64(1.0 - Float64(x / -1.0)) * -1.0) / B); elseif (F <= 2700000000000.0) tmp = Float64(Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -36.0], N[(N[(N[(1.0 - N[(x / -1.0), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2700000000000.0], N[(N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -36:\\
\;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\
\mathbf{elif}\;F \leq 2700000000000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -36Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites19.3%
Taylor expanded in F around -inf
Applied rewrites30.5%
if -36 < F < 2.7e12Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around 0
Applied rewrites30.4%
Taylor expanded in F around 0
Applied rewrites27.1%
lift-*.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-mult-revN/A
lower--.f6430.1%
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6430.1%
Applied rewrites30.1%
if 2.7e12 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-107)
(/ (* (- 1.0 (/ x -1.0)) -1.0) B)
(if (<= F 5.2e-111)
(/ (* -1.0 x) B)
(/ (* (- 1.0 (/ x 1.0)) 1.0) B))))double code(double F, double B, double x) {
double tmp;
if (F <= -7e-107) {
tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
} else if (F <= 5.2e-111) {
tmp = (-1.0 * x) / B;
} else {
tmp = ((1.0 - (x / 1.0)) * 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 <= (-7d-107)) then
tmp = ((1.0d0 - (x / (-1.0d0))) * (-1.0d0)) / b
else if (f <= 5.2d-111) then
tmp = ((-1.0d0) * x) / b
else
tmp = ((1.0d0 - (x / 1.0d0)) * 1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7e-107) {
tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
} else if (F <= 5.2e-111) {
tmp = (-1.0 * x) / B;
} else {
tmp = ((1.0 - (x / 1.0)) * 1.0) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7e-107: tmp = ((1.0 - (x / -1.0)) * -1.0) / B elif F <= 5.2e-111: tmp = (-1.0 * x) / B else: tmp = ((1.0 - (x / 1.0)) * 1.0) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7e-107) tmp = Float64(Float64(Float64(1.0 - Float64(x / -1.0)) * -1.0) / B); elseif (F <= 5.2e-111) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x / 1.0)) * 1.0) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7e-107) tmp = ((1.0 - (x / -1.0)) * -1.0) / B; elseif (F <= 5.2e-111) tmp = (-1.0 * x) / B; else tmp = ((1.0 - (x / 1.0)) * 1.0) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7e-107], N[(N[(N[(1.0 - N[(x / -1.0), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.2e-111], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x / 1.0), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-107}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{-111}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{1}\right) \cdot 1}{B}\\
\end{array}
if F < -6.9999999999999997e-107Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites19.3%
Taylor expanded in F around -inf
Applied rewrites30.5%
if -6.9999999999999997e-107 < F < 5.1999999999999996e-111Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around 0
lower-*.f6430.2%
Applied rewrites30.2%
if 5.1999999999999996e-111 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around inf
Applied rewrites19.3%
Taylor expanded in F around inf
Applied rewrites30.1%
(FPCore (F B x) :precision binary64 (if (<= F -7e-107) (/ (* (- 1.0 (/ x -1.0)) -1.0) B) (/ (* -1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-107) {
tmp = ((1.0 - (x / -1.0)) * -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 <= (-7d-107)) then
tmp = ((1.0d0 - (x / (-1.0d0))) * (-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 <= -7e-107) {
tmp = ((1.0 - (x / -1.0)) * -1.0) / B;
} else {
tmp = (-1.0 * x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7e-107: tmp = ((1.0 - (x / -1.0)) * -1.0) / B else: tmp = (-1.0 * x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7e-107) tmp = Float64(Float64(Float64(1.0 - Float64(x / -1.0)) * -1.0) / B); else tmp = Float64(Float64(-1.0 * x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7e-107) tmp = ((1.0 - (x / -1.0)) * -1.0) / B; else tmp = (-1.0 * x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7e-107], N[(N[(N[(1.0 - N[(x / -1.0), $MachinePrecision]), $MachinePrecision] * -1.0), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-107}:\\
\;\;\;\;\frac{\left(1 - \frac{x}{-1}\right) \cdot -1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\end{array}
if F < -6.9999999999999997e-107Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
lift--.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites19.3%
Taylor expanded in F around -inf
Applied rewrites30.5%
if -6.9999999999999997e-107 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around 0
lower-*.f6430.2%
Applied rewrites30.2%
(FPCore (F B x) :precision binary64 (if (<= F -410000000000.0) (/ -1.0 B) (/ (* -1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -410000000000.0) {
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 <= (-410000000000.0d0)) 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 <= -410000000000.0) {
tmp = -1.0 / B;
} else {
tmp = (-1.0 * x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -410000000000.0: tmp = -1.0 / B else: tmp = (-1.0 * x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -410000000000.0) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(-1.0 * x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -410000000000.0) tmp = -1.0 / B; else tmp = (-1.0 * x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -410000000000.0], N[(-1.0 / B), $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -410000000000:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\end{array}
if F < -4.1e11Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around -inf
lower-/.f6410.7%
Applied rewrites10.7%
if -4.1e11 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around 0
lower-*.f6430.2%
Applied rewrites30.2%
(FPCore (F B x) :precision binary64 (if (<= F 1.2e-180) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.2e-180) {
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 <= 1.2d-180) 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 <= 1.2e-180) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.2e-180: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.2e-180) 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 <= 1.2e-180) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.2e-180], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{-180}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
if F < 1.1999999999999999e-180Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around -inf
lower-/.f6410.7%
Applied rewrites10.7%
if 1.1999999999999999e-180 < F Initial program 76.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around inf
lower-/.f649.9%
Applied rewrites9.9%
(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.1%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around -inf
lower-/.f6410.7%
Applied rewrites10.7%
herbie shell --seed 2025212
(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))))))