
(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]
\begin{array}{l}
\\
\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)}
\end{array}
Herbie found 26 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]
\begin{array}{l}
\\
\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)}
\end{array}
(FPCore (F B x)
:precision binary64
(if (<= F -155000000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 2e-9)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(+ (- (* x (/ 1.0 (tan B)))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -155000000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 2e-9) {
tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = -(x * (1.0 / tan(B))) + (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 <= (-155000000000.0d0)) then
tmp = -((1.0d0 + (cos(b) * x)) / sin(b))
else if (f <= 2d-9) then
tmp = -((x * 1.0d0) / tan(b)) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = -(x * (1.0d0 / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -155000000000.0) {
tmp = -((1.0 + (Math.cos(B) * x)) / Math.sin(B));
} else if (F <= 2e-9) {
tmp = -((x * 1.0) / Math.tan(B)) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = -(x * (1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -155000000000.0: tmp = -((1.0 + (math.cos(B) * x)) / math.sin(B)) elif F <= 2e-9: tmp = -((x * 1.0) / math.tan(B)) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = -(x * (1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -155000000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 2e-9) tmp = Float64(Float64(-Float64(Float64(x * 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))))); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -155000000000.0) tmp = -((1.0 + (cos(B) * x)) / sin(B)); elseif (F <= 2e-9) tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = -(x * (1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -155000000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $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], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -155000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\left(-\frac{x \cdot 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)}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.55e11Initial program 59.1%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -1.55e11 < F < 2.00000000000000012e-9Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
if 2.00000000000000012e-9 < F Initial program 59.6%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6497.8
Applied rewrites97.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -100000000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 2e-9)
(+
t_0
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -100000000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 2e-9) {
tmp = t_0 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = -(x * (1.0d0 / tan(b)))
if (f <= (-100000000000.0d0)) then
tmp = -((1.0d0 + (cos(b) * x)) / sin(b))
else if (f <= 2d-9) then
tmp = t_0 + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / Math.tan(B)));
double tmp;
if (F <= -100000000000.0) {
tmp = -((1.0 + (Math.cos(B) * x)) / Math.sin(B));
} else if (F <= 2e-9) {
tmp = t_0 + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = -(x * (1.0 / math.tan(B))) tmp = 0 if F <= -100000000000.0: tmp = -((1.0 + (math.cos(B) * x)) / math.sin(B)) elif F <= 2e-9: tmp = t_0 + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -100000000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 2e-9) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x * (1.0 / tan(B))); tmp = 0.0; if (F <= -100000000000.0) tmp = -((1.0 + (cos(B) * x)) / sin(B)); elseif (F <= 2e-9) tmp = t_0 + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -100000000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -100000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1e11Initial program 59.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -1e11 < F < 2.00000000000000012e-9Initial program 99.5%
if 2.00000000000000012e-9 < F Initial program 59.6%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6497.8
Applied rewrites97.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -100000000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 2e-9)
(+ t_0 (* (/ F (sin B)) (/ 1.0 (sqrt (fma F F 2.0)))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -100000000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 2e-9) {
tmp = t_0 + ((F / sin(B)) * (1.0 / sqrt(fma(F, F, 2.0))));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -100000000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 2e-9) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(1.0 / sqrt(fma(F, F, 2.0))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -100000000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -100000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1e11Initial program 59.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -1e11 < F < 2.00000000000000012e-9Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f6499.4
Applied rewrites99.4%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lift-fma.f6499.4
Applied rewrites99.4%
if 2.00000000000000012e-9 < F Initial program 59.6%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6497.8
Applied rewrites97.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -100000000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 2e-9)
(+ t_0 (* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0)))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -100000000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 2e-9) {
tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0))));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -100000000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 2e-9) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -100000000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -100000000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1e11Initial program 59.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -1e11 < F < 2.00000000000000012e-9Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f6499.4
Applied rewrites99.4%
if 2.00000000000000012e-9 < F Initial program 59.6%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6497.8
Applied rewrites97.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -195.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 2e-9)
(+ t_0 (* (/ F (sin B)) (sqrt 0.5)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -195.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 2e-9) {
tmp = t_0 + ((F / sin(B)) * sqrt(0.5));
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = -(x * (1.0d0 / tan(b)))
if (f <= (-195.0d0)) then
tmp = -((1.0d0 + (cos(b) * x)) / sin(b))
else if (f <= 2d-9) then
tmp = t_0 + ((f / sin(b)) * sqrt(0.5d0))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / Math.tan(B)));
double tmp;
if (F <= -195.0) {
tmp = -((1.0 + (Math.cos(B) * x)) / Math.sin(B));
} else if (F <= 2e-9) {
tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt(0.5));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = -(x * (1.0 / math.tan(B))) tmp = 0 if F <= -195.0: tmp = -((1.0 + (math.cos(B) * x)) / math.sin(B)) elif F <= 2e-9: tmp = t_0 + ((F / math.sin(B)) * math.sqrt(0.5)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -195.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 2e-9) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(0.5))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x * (1.0 / tan(B))); tmp = 0.0; if (F <= -195.0) tmp = -((1.0 + (cos(B) * x)) / sin(B)); elseif (F <= 2e-9) tmp = t_0 + ((F / sin(B)) * sqrt(0.5)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -195.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 2e-9], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -195:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -195Initial program 60.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
if -195 < F < 2.00000000000000012e-9Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f6499.4
Applied rewrites99.4%
Taylor expanded in F around 0
Applied rewrites99.0%
if 2.00000000000000012e-9 < F Initial program 59.6%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6497.8
Applied rewrites97.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -230.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 1.46e-12)
(+ t_0 (* (/ F B) (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0))))))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -230.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 1.46e-12) {
tmp = t_0 + ((F / B) * (1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -230.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 1.46e-12) tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -230.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.46e-12], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -230:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 1.46 \cdot 10^{-12}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -230Initial program 60.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
if -230 < F < 1.46000000000000004e-12Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6483.2
Applied rewrites83.2%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6483.1
Applied rewrites83.1%
if 1.46000000000000004e-12 < F Initial program 59.8%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6497.3
Applied rewrites97.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -230.0)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 1.46e-12)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F B) (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0))))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -230.0) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 1.46e-12) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * (1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -230.0) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 1.46e-12) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -230.0], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.46e-12], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -230:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.46 \cdot 10^{-12}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -230Initial program 60.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
if -230 < F < 1.46000000000000004e-12Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6483.2
Applied rewrites83.2%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6483.1
Applied rewrites83.1%
if 1.46000000000000004e-12 < F Initial program 59.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6497.3
Applied rewrites97.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -3.5e+281)
(+ t_0 (/ -1.0 B))
(if (<= F -340.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.46e-12)
(+ t_0 (* (/ F B) (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0))))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -3.5e+281) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -340.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.46e-12) {
tmp = t_0 + ((F / B) * (1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -3.5e+281) tmp = Float64(t_0 + Float64(-1.0 / B)); elseif (F <= -340.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.46e-12) tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -3.5e+281], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -340.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.46e-12], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{+281}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -340:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.46 \cdot 10^{-12}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -3.4999999999999998e281Initial program 26.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6427.2
Applied rewrites27.2%
Taylor expanded in F around -inf
lower-/.f6473.8
Applied rewrites73.8%
if -3.4999999999999998e281 < F < -340Initial program 63.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites77.2%
if -340 < F < 1.46000000000000004e-12Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6483.1
Applied rewrites83.1%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6483.1
Applied rewrites83.1%
if 1.46000000000000004e-12 < F Initial program 59.8%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6497.3
Applied rewrites97.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -3.5e+281)
(+ t_0 (/ -1.0 B))
(if (<= F -340.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.2e-134)
(+ t_0 (* (/ F B) (sqrt (/ 1.0 (fma F F 2.0)))))
(if (<= F 2.15e+143)
(+
(- (/ x B))
(/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
(+ t_0 (/ 1.0 B))))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -3.5e+281) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -340.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.2e-134) {
tmp = t_0 + ((F / B) * sqrt((1.0 / fma(F, F, 2.0))));
} else if (F <= 2.15e+143) {
tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else {
tmp = t_0 + (1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -3.5e+281) tmp = Float64(t_0 + Float64(-1.0 / B)); elseif (F <= -340.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.2e-134) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, 2.0))))); elseif (F <= 2.15e+143) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); else tmp = Float64(t_0 + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -3.5e+281], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -340.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.2e-134], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.15e+143], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{+281}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -340:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-134}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{elif}\;F \leq 2.15 \cdot 10^{+143}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{B}\\
\end{array}
\end{array}
if F < -3.4999999999999998e281Initial program 26.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6427.2
Applied rewrites27.2%
Taylor expanded in F around -inf
lower-/.f6473.8
Applied rewrites73.8%
if -3.4999999999999998e281 < F < -340Initial program 63.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites77.2%
if -340 < F < 1.20000000000000005e-134Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f6499.4
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites84.6%
if 1.20000000000000005e-134 < F < 2.15000000000000001e143Initial program 93.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6475.7
Applied rewrites75.7%
if 2.15000000000000001e143 < F Initial program 33.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6431.2
Applied rewrites31.2%
Taylor expanded in F around inf
lower-/.f6474.4
Applied rewrites74.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -3.5e+281)
(+ t_0 (/ -1.0 B))
(if (<= F -340.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 5e+157)
(+ t_0 (* (/ F B) (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0))))))
(+
(/ (- (* 0.3333333333333333 (* (* B B) x)) x) B)
(/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -3.5e+281) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -340.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 5e+157) {
tmp = t_0 + ((F / B) * (1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -3.5e+281) tmp = Float64(t_0 + Float64(-1.0 / B)); elseif (F <= -340.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 5e+157) tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -3.5e+281], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -340.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 5e+157], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{+281}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -340:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+157}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.4999999999999998e281Initial program 26.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6427.2
Applied rewrites27.2%
Taylor expanded in F around -inf
lower-/.f6473.8
Applied rewrites73.8%
if -3.4999999999999998e281 < F < -340Initial program 63.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites77.2%
if -340 < F < 4.99999999999999976e157Initial program 96.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6477.1
Applied rewrites77.1%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6477.1
Applied rewrites77.1%
if 4.99999999999999976e157 < F Initial program 30.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6430.2
Applied rewrites30.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f647.0
Applied rewrites7.0%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6461.5
Applied rewrites61.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= F -3.5e+281)
(+ t_0 (/ -1.0 B))
(if (<= F -340.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 5e+157)
(+ t_0 (* (/ F B) (sqrt (/ 1.0 (fma F F 2.0)))))
(+
(/ (- (* 0.3333333333333333 (* (* B B) x)) x) B)
(/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -3.5e+281) {
tmp = t_0 + (-1.0 / B);
} else if (F <= -340.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 5e+157) {
tmp = t_0 + ((F / B) * sqrt((1.0 / fma(F, F, 2.0))));
} else {
tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -3.5e+281) tmp = Float64(t_0 + Float64(-1.0 / B)); elseif (F <= -340.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 5e+157) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, 2.0))))); else tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -3.5e+281], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -340.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 5e+157], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -3.5 \cdot 10^{+281}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -340:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+157}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.4999999999999998e281Initial program 26.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6427.2
Applied rewrites27.2%
Taylor expanded in F around -inf
lower-/.f6473.8
Applied rewrites73.8%
if -3.4999999999999998e281 < F < -340Initial program 63.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites77.2%
if -340 < F < 4.99999999999999976e157Initial program 96.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f6496.7
Applied rewrites96.7%
Taylor expanded in B around 0
Applied rewrites77.1%
if 4.99999999999999976e157 < F Initial program 30.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6430.2
Applied rewrites30.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f647.0
Applied rewrites7.0%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6461.5
Applied rewrites61.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= x -1.9e-82)
(+ t_0 (/ 1.0 B))
(if (<= x 2.15e-128)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
(+ t_0 (/ -1.0 B))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (x <= -1.9e-82) {
tmp = t_0 + (1.0 / B);
} else if (x <= 2.15e-128) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = t_0 + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (x <= -1.9e-82) tmp = Float64(t_0 + Float64(1.0 / B)); elseif (x <= 2.15e-128) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(t_0 + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -1.9e-82], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.15e-128], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{-82}:\\
\;\;\;\;t\_0 + \frac{1}{B}\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\end{array}
\end{array}
if x < -1.9000000000000001e-82Initial program 71.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6465.1
Applied rewrites65.1%
Taylor expanded in F around inf
lower-/.f6472.6
Applied rewrites72.6%
if -1.9000000000000001e-82 < x < 2.14999999999999997e-128Initial program 72.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6455.8
Applied rewrites55.8%
if 2.14999999999999997e-128 < x Initial program 83.9%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6478.6
Applied rewrites78.6%
Taylor expanded in F around -inf
lower-/.f6478.9
Applied rewrites78.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
(if (<= x -1.85e-76)
t_0
(if (<= x 2.15e-128)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + (-1.0 / B);
double tmp;
if (x <= -1.85e-76) {
tmp = t_0;
} else if (x <= 2.15e-128) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)) tmp = 0.0 if (x <= -1.85e-76) tmp = t_0; elseif (x <= 2.15e-128) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e-76], t$95$0, If[LessEqual[x, 2.15e-128], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{-76}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-128}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.85000000000000006e-76 or 2.14999999999999997e-128 < x Initial program 80.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6474.6
Applied rewrites74.6%
Taylor expanded in F around -inf
lower-/.f6477.0
Applied rewrites77.0%
if -1.85000000000000006e-76 < x < 2.14999999999999997e-128Initial program 72.4%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6455.5
Applied rewrites55.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B)))
(if (<= F -230.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.9e+28)
(+ t_0 (* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
(if (<= F 2e+86)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
(+ t_0 (/ 1.0 B)))))))
double code(double F, double B, double x) {
double t_0 = ((0.3333333333333333 * ((B * B) * x)) - x) / B;
double tmp;
if (F <= -230.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.9e+28) {
tmp = t_0 + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
} else if (F <= 2e+86) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = t_0 + (1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) tmp = 0.0 if (F <= -230.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.9e+28) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0))))); elseif (F <= 2e+86) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(t_0 + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -230.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.9e+28], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+86], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B}\\
\mathbf{if}\;F \leq -230:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+28}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+86}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{B}\\
\end{array}
\end{array}
if F < -230Initial program 60.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites77.3%
if -230 < F < 1.8999999999999999e28Initial program 99.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6482.0
Applied rewrites82.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.2
Applied rewrites50.2%
if 1.8999999999999999e28 < F < 2e86Initial program 91.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6455.6
Applied rewrites55.6%
if 2e86 < F Initial program 47.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6439.0
Applied rewrites39.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6415.5
Applied rewrites15.5%
Taylor expanded in F around inf
lower-/.f6450.7
Applied rewrites50.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B)))
(if (<= F -230.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.62e+78)
(+ t_0 (* (/ F B) (sqrt (/ 1.0 (+ (fma F F (+ x x)) 2.0)))))
(+ t_0 (/ 1.0 B))))))
double code(double F, double B, double x) {
double t_0 = ((0.3333333333333333 * ((B * B) * x)) - x) / B;
double tmp;
if (F <= -230.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.62e+78) {
tmp = t_0 + ((F / B) * sqrt((1.0 / (fma(F, F, (x + x)) + 2.0))));
} else {
tmp = t_0 + (1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) tmp = 0.0 if (F <= -230.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.62e+78) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(fma(F, F, Float64(x + x)) + 2.0))))); else tmp = Float64(t_0 + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -230.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.62e+78], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B}\\
\mathbf{if}\;F \leq -230:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.62 \cdot 10^{+78}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, x + x\right) + 2}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{B}\\
\end{array}
\end{array}
if F < -230Initial program 60.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites77.3%
if -230 < F < 1.6199999999999999e78Initial program 98.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6480.1
Applied rewrites80.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.5
Applied rewrites49.5%
if 1.6199999999999999e78 < F Initial program 48.8%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6439.8
Applied rewrites39.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6416.3
Applied rewrites16.3%
Taylor expanded in F around inf
lower-/.f6450.8
Applied rewrites50.8%
(FPCore (F B x)
:precision binary64
(if (<= F -230.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 1.15e+139)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(+ (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -230.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 1.15e+139) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + (1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -230.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 1.15e+139) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -230.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.15e+139], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -230:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -230Initial program 60.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites77.3%
if -230 < F < 1.15e139Initial program 97.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.3%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6450.3
Applied rewrites50.3%
if 1.15e139 < F Initial program 34.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6432.0
Applied rewrites32.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f649.2
Applied rewrites9.2%
Taylor expanded in F around inf
lower-/.f6451.6
Applied rewrites51.6%
(FPCore (F B x)
:precision binary64
(if (<= F -350000000000.0)
(/ -1.0 (sin B))
(if (<= F 1.15e+139)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(+ (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -350000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 1.15e+139) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + (1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -350000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.15e+139) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -350000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e+139], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -350000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -3.5e11Initial program 59.1%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6452.7
Applied rewrites52.7%
if -3.5e11 < F < 1.15e139Initial program 97.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.2%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6450.2
Applied rewrites50.2%
if 1.15e139 < F Initial program 34.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6432.0
Applied rewrites32.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f649.2
Applied rewrites9.2%
Taylor expanded in F around inf
lower-/.f6451.6
Applied rewrites51.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.12e+113)
(+ (/ (- (* 0.3333333333333333 (* B (* B x))) x) B) (/ -1.0 B))
(if (<= F 1.15e+139)
(/ (- (* (/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0)))) F) x) B)
(+ (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.12e+113) {
tmp = (((0.3333333333333333 * (B * (B * x))) - x) / B) + (-1.0 / B);
} else if (F <= 1.15e+139) {
tmp = (((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B;
} else {
tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + (1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.12e+113) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(B * Float64(B * x))) - x) / B) + Float64(-1.0 / B)); elseif (F <= 1.15e+139) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.12e+113], N[(N[(N[(N[(0.3333333333333333 * N[(B * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e+139], N[(N[(N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.12 \cdot 10^{+113}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(B \cdot \left(B \cdot x\right)\right) - x}{B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{+139}:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -1.1200000000000001e113Initial program 43.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6438.0
Applied rewrites38.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6413.4
Applied rewrites13.4%
Taylor expanded in F around -inf
lower-/.f6450.1
Applied rewrites50.1%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6450.3
Applied rewrites50.3%
if -1.1200000000000001e113 < F < 1.15e139Initial program 96.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.2%
lift-sqrt.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
pow2N/A
count-2-revN/A
associate-+l+N/A
pow2N/A
lower-fma.f64N/A
lower-fma.f6450.2
Applied rewrites50.2%
if 1.15e139 < F Initial program 34.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6432.0
Applied rewrites32.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f649.2
Applied rewrites9.2%
Taylor expanded in F around inf
lower-/.f6451.6
Applied rewrites51.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05)
(+ (/ (- (* 0.3333333333333333 (* B (* B x))) x) B) (/ -1.0 B))
(if (<= F 1850000000000.0)
(fma (sqrt (/ 1.0 (fma 2.0 x 2.0))) (/ F B) (/ (- x) B))
(+ (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05) {
tmp = (((0.3333333333333333 * (B * (B * x))) - x) / B) + (-1.0 / B);
} else if (F <= 1850000000000.0) {
tmp = fma(sqrt((1.0 / fma(2.0, x, 2.0))), (F / B), (-x / B));
} else {
tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + (1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.05) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(B * Float64(B * x))) - x) / B) + Float64(-1.0 / B)); elseif (F <= 1850000000000.0) tmp = fma(sqrt(Float64(1.0 / fma(2.0, x, 2.0))), Float64(F / B), Float64(Float64(-x) / B)); else tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.05], N[(N[(N[(N[(0.3333333333333333 * N[(B * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1850000000000.0], N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(B \cdot \left(B \cdot x\right)\right) - x}{B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1850000000000:\\
\;\;\;\;\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, \frac{F}{B}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -1.05000000000000004Initial program 60.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6446.8
Applied rewrites46.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6423.3
Applied rewrites23.3%
Taylor expanded in F around -inf
lower-/.f6449.7
Applied rewrites49.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
if -1.05000000000000004 < F < 1.85e12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in F around inf
Applied rewrites20.4%
Taylor expanded in F around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-/.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6449.7
Applied rewrites49.7%
if 1.85e12 < F Initial program 57.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6444.0
Applied rewrites44.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.6
Applied rewrites21.6%
Taylor expanded in F around inf
lower-/.f6450.6
Applied rewrites50.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05)
(+ (/ (- (* 0.3333333333333333 (* B (* B x))) x) B) (/ -1.0 B))
(if (<= F 1850000000000.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
(+ (/ (- (* 0.3333333333333333 (* (* B B) x)) x) B) (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05) {
tmp = (((0.3333333333333333 * (B * (B * x))) - x) / B) + (-1.0 / B);
} else if (F <= 1850000000000.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (((0.3333333333333333 * ((B * B) * x)) - x) / B) + (1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.05) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(B * Float64(B * x))) - x) / B) + Float64(-1.0 / B)); elseif (F <= 1850000000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(Float64(B * B) * x)) - x) / B) + Float64(1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.05], N[(N[(N[(N[(0.3333333333333333 * N[(B * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1850000000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(B \cdot \left(B \cdot x\right)\right) - x}{B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1850000000000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(\left(B \cdot B\right) \cdot x\right) - x}{B} + \frac{1}{B}\\
\end{array}
\end{array}
if F < -1.05000000000000004Initial program 60.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6446.8
Applied rewrites46.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6423.3
Applied rewrites23.3%
Taylor expanded in F around -inf
lower-/.f6449.7
Applied rewrites49.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
if -1.05000000000000004 < F < 1.85e12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in F around inf
Applied rewrites20.4%
Taylor expanded in F around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6449.7
Applied rewrites49.7%
if 1.85e12 < F Initial program 57.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6444.0
Applied rewrites44.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6421.6
Applied rewrites21.6%
Taylor expanded in F around inf
lower-/.f6450.6
Applied rewrites50.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05)
(+ (/ (- (* 0.3333333333333333 (* B (* B x))) x) B) (/ -1.0 B))
(if (<= F 1.46e-12)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
(- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05) {
tmp = (((0.3333333333333333 * (B * (B * x))) - x) / B) + (-1.0 / B);
} else if (F <= 1.46e-12) {
tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.05) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * Float64(B * Float64(B * x))) - x) / B) + Float64(-1.0 / B)); elseif (F <= 1.46e-12) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.05], N[(N[(N[(N[(0.3333333333333333 * N[(B * N[(B * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.46e-12], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05:\\
\;\;\;\;\frac{0.3333333333333333 \cdot \left(B \cdot \left(B \cdot x\right)\right) - x}{B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.46 \cdot 10^{-12}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.05000000000000004Initial program 60.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
count-2-revN/A
lower-+.f6446.8
Applied rewrites46.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6423.3
Applied rewrites23.3%
Taylor expanded in F around -inf
lower-/.f6449.7
Applied rewrites49.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6449.9
Applied rewrites49.9%
if -1.05000000000000004 < F < 1.46000000000000004e-12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in F around inf
Applied rewrites20.0%
Taylor expanded in F around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6450.5
Applied rewrites50.5%
if 1.46000000000000004e-12 < F Initial program 59.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
Applied rewrites49.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (F B x)
:precision binary64
(if (<= F -150000000000.0)
(/ (- -1.0 x) B)
(if (<= F 1.46e-12)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
(- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -150000000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.46e-12) {
tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -150000000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.46e-12) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -150000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.46e-12], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -150000000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.46 \cdot 10^{-12}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.5e11Initial program 59.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.8%
Taylor expanded in F around -inf
Applied rewrites50.2%
if -1.5e11 < F < 1.46000000000000004e-12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.5%
Taylor expanded in F around inf
Applied rewrites20.0%
Taylor expanded in F around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6450.0
Applied rewrites50.0%
if 1.46000000000000004e-12 < F Initial program 59.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
Applied rewrites49.4%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6449.4
Applied rewrites49.4%
(FPCore (F B x) :precision binary64 (if (<= F -2.5e-29) (/ (- -1.0 x) B) (if (<= F 3.4e-15) (/ (- x) B) (- (/ 1.0 B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-15) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (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 <= (-2.5d-29)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.4d-15) then
tmp = -x / b
else
tmp = (1.0d0 / b) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-15) {
tmp = -x / B;
} else {
tmp = (1.0 / B) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.5e-29: tmp = (-1.0 - x) / B elif F <= 3.4e-15: tmp = -x / B else: tmp = (1.0 / B) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-29) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.4e-15) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.5e-29) tmp = (-1.0 - x) / B; elseif (F <= 3.4e-15) tmp = -x / B; else tmp = (1.0 / B) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-15], N[((-x) / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -2.49999999999999993e-29Initial program 63.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.8%
Taylor expanded in F around -inf
Applied rewrites47.9%
if -2.49999999999999993e-29 < F < 3.4e-15Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.8%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6435.8
Applied rewrites35.8%
if 3.4e-15 < F Initial program 60.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
Applied rewrites49.2%
lift-/.f64N/A
lift--.f64N/A
div-subN/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6449.2
Applied rewrites49.2%
(FPCore (F B x) :precision binary64 (if (<= F -2.5e-29) (/ (- -1.0 x) B) (if (<= F 3.4e-15) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-15) {
tmp = -x / 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 <= (-2.5d-29)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.4d-15) then
tmp = -x / 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 <= -2.5e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-15) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.5e-29: tmp = (-1.0 - x) / B elif F <= 3.4e-15: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-29) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.4e-15) tmp = Float64(Float64(-x) / 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 <= -2.5e-29) tmp = (-1.0 - x) / B; elseif (F <= 3.4e-15) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-15], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-15}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.49999999999999993e-29Initial program 63.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.8%
Taylor expanded in F around -inf
Applied rewrites47.9%
if -2.49999999999999993e-29 < F < 3.4e-15Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.8%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6435.8
Applied rewrites35.8%
if 3.4e-15 < F Initial program 60.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
Applied rewrites49.2%
(FPCore (F B x) :precision binary64 (if (<= F -2.5e-29) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-29) {
tmp = (-1.0 - x) / B;
} else {
tmp = -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 <= (-2.5d-29)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-29) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.5e-29: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-29) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.5e-29) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.49999999999999993e-29Initial program 63.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.8%
Taylor expanded in F around -inf
Applied rewrites47.9%
if -2.49999999999999993e-29 < F Initial program 83.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites45.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6430.9
Applied rewrites30.9%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 77.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.0%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.9
Applied rewrites28.9%
herbie shell --seed 2025115
(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))))))