
(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
(let* ((t_0 (- (/ (* x 1.0) (tan B)))))
(if (<= F -1.32e+19)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 1.65e+66)
(+
t_0
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 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 <= -1.32e+19) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 1.65e+66) {
tmp = t_0 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = (1.0 - (cos(B) * x)) / 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 <= (-1.32d+19)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 1.65d+66) then
tmp = t_0 + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = (1.0d0 - (cos(b) * x)) / 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 <= -1.32e+19) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 1.65e+66) {
tmp = t_0 + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = -((x * 1.0) / math.tan(B)) tmp = 0 if F <= -1.32e+19: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 1.65e+66: tmp = t_0 + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = (1.0 - (math.cos(B) * x)) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(-Float64(Float64(x * 1.0) / tan(B))) tmp = 0.0 if (F <= -1.32e+19) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 1.65e+66) 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(Float64(1.0 - Float64(cos(B) * x)) / 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 <= -1.32e+19) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 1.65e+66) tmp = t_0 + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = (1.0 - (cos(B) * x)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -1.32e+19], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e+66], 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[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x \cdot 1}{\tan B}\\
\mathbf{if}\;F \leq -1.32 \cdot 10^{+19}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\
\;\;\;\;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}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.32e19Initial program 56.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
if -1.32e19 < F < 1.6500000000000001e66Initial program 98.9%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.0
Applied rewrites99.0%
if 1.6500000000000001e66 < F Initial program 49.4%
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.f6499.8
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.32e+19)
(+ (- (/ (* x 1.0) (tan B))) (/ -1.0 (sin B)))
(if (<= F 1.65e+66)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.32e+19) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B));
} else if (F <= 1.65e+66) {
tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = (1.0 - (cos(B) * x)) / 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 <= (-1.32d+19)) then
tmp = -((x * 1.0d0) / tan(b)) + ((-1.0d0) / sin(b))
else if (f <= 1.65d+66) then
tmp = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = (1.0d0 - (cos(b) * x)) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.32e+19) {
tmp = -((x * 1.0) / Math.tan(B)) + (-1.0 / Math.sin(B));
} else if (F <= 1.65e+66) {
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 = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.32e+19: tmp = -((x * 1.0) / math.tan(B)) + (-1.0 / math.sin(B)) elif F <= 1.65e+66: 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 = (1.0 - (math.cos(B) * x)) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.32e+19) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 1.65e+66) tmp = 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))))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.32e+19) tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B)); elseif (F <= 1.65e+66) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = (1.0 - (cos(B) * x)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.32e+19], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e+66], 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], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.32 \cdot 10^{+19}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.32e19Initial program 56.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
if -1.32e19 < F < 1.6500000000000001e66Initial program 98.9%
if 1.6500000000000001e66 < F Initial program 49.4%
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.f6499.8
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+35)
(+ (- (/ (* x 1.0) (tan B))) (/ -1.0 (sin B)))
(if (<= F 1.65e+66)
(+
(- (* x (/ 1.0 (tan B))))
(/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+35) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B));
} else if (F <= 1.65e+66) {
tmp = -(x * (1.0 / tan(B))) + (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+35) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 1.65e+66) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B)))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+35], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e+66], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $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}
\mathbf{if}\;F \leq -5 \cdot 10^{+35}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{+66}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -5.00000000000000021e35Initial program 55.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.8
Applied rewrites99.8%
if -5.00000000000000021e35 < F < 1.6500000000000001e66Initial program 98.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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.4%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.5
Applied rewrites99.5%
lift-/.f64N/A
lift-*.f64N/A
lift-/.f64N/A
*-rgt-identityN/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
if 1.6500000000000001e66 < F Initial program 49.4%
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.f6499.8
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma 2.0 x (fma F F 2.0))))
(if (<= F -200000.0)
(+ (- (/ (* x 1.0) (tan B))) (/ -1.0 (sin B)))
(if (<= F 1.6e-153)
(+ (- (* x (/ 1.0 (tan B)))) (/ (/ F (sqrt t_0)) B))
(if (<= F 38000000.0)
(+ (- (/ x B)) (/ (* F (pow t_0 -0.5)) (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -200000.0) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B));
} else if (F <= 1.6e-153) {
tmp = -(x * (1.0 / tan(B))) + ((F / sqrt(t_0)) / B);
} else if (F <= 38000000.0) {
tmp = -(x / B) + ((F * pow(t_0, -0.5)) / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -200000.0) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 1.6e-153) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sqrt(t_0)) / B)); elseif (F <= 38000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (t_0 ^ -0.5)) / sin(B))); 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[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -200000.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.6e-153], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 38000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[t$95$0, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -200000:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-153}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{F}{\sqrt{t\_0}}}{B}\\
\mathbf{elif}\;F \leq 38000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {t\_0}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2e5Initial program 58.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.7
Applied rewrites99.7%
if -2e5 < F < 1.6e-153Initial program 99.5%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites85.0%
if 1.6e-153 < F < 3.8e7Initial program 99.3%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6475.5
Applied rewrites75.5%
if 3.8e7 < F Initial program 56.9%
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.f6499.8
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma 2.0 x (fma F F 2.0))))
(if (<= F -200000.0)
(+ (- (/ (* x 1.0) (tan B))) (/ -1.0 (sin B)))
(if (<= F 3.4e-173)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (sqrt (/ 1.0 t_0))))
(if (<= F 38000000.0)
(+ (- (/ x B)) (/ (/ (* F 1.0) (sqrt t_0)) (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -200000.0) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / sin(B));
} else if (F <= 3.4e-173) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * sqrt((1.0 / t_0)));
} else if (F <= 38000000.0) {
tmp = -(x / B) + (((F * 1.0) / sqrt(t_0)) / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -200000.0) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 3.4e-173) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_0)))); elseif (F <= 38000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(F * 1.0) / sqrt(t_0)) / sin(B))); 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[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -200000.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e-173], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 38000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(F * 1.0), $MachinePrecision] / N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -200000:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-173}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\
\mathbf{elif}\;F \leq 38000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{F \cdot 1}{\sqrt{t\_0}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2e5Initial program 58.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.7
Applied rewrites99.7%
if -2e5 < F < 3.3999999999999999e-173Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6485.0
Applied rewrites85.0%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6485.0
Applied rewrites85.0%
if 3.3999999999999999e-173 < F < 3.8e7Initial program 99.3%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.3
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6474.2
Applied rewrites74.2%
if 3.8e7 < F Initial program 56.9%
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.f6499.8
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma 2.0 x (fma F F 2.0))))
(if (<= F -200000.0)
(/ (fma (cos B) x 1.0) (- (sin B)))
(if (<= F 3.4e-173)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (sqrt (/ 1.0 t_0))))
(if (<= F 38000000.0)
(+ (- (/ x B)) (/ (/ (* F 1.0) (sqrt t_0)) (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = fma(2.0, x, fma(F, F, 2.0));
double tmp;
if (F <= -200000.0) {
tmp = fma(cos(B), x, 1.0) / -sin(B);
} else if (F <= 3.4e-173) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * sqrt((1.0 / t_0)));
} else if (F <= 38000000.0) {
tmp = -(x / B) + (((F * 1.0) / sqrt(t_0)) / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) tmp = 0.0 if (F <= -200000.0) tmp = Float64(fma(cos(B), x, 1.0) / Float64(-sin(B))); elseif (F <= 3.4e-173) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_0)))); elseif (F <= 38000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(F * 1.0) / sqrt(t_0)) / sin(B))); 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[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -200000.0], N[(N[(N[Cos[B], $MachinePrecision] * x + 1.0), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 3.4e-173], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 38000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(F * 1.0), $MachinePrecision] / N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;F \leq -200000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, x, 1\right)}{-\sin B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-173}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\
\mathbf{elif}\;F \leq 38000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{F \cdot 1}{\sqrt{t\_0}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2e5Initial program 58.4%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites73.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-+.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
lift-neg.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
distribute-neg-frac2N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-cos.f64N/A
lower-neg.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -2e5 < F < 3.3999999999999999e-173Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6485.0
Applied rewrites85.0%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6485.0
Applied rewrites85.0%
if 3.3999999999999999e-173 < F < 3.8e7Initial program 99.3%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.3
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6474.2
Applied rewrites74.2%
if 3.8e7 < F Initial program 56.9%
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.f6499.8
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma 2.0 x (fma F F 2.0)))))
(if (<= F -8.5e+22)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 3.4e-173)
(+ (- (* x (/ 1.0 (tan B)))) (/ (/ F t_0) B))
(if (<= F 38000000.0)
(+ (- (/ x B)) (/ (/ (* F 1.0) t_0) (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -8.5e+22) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 3.4e-173) {
tmp = -(x * (1.0 / tan(B))) + ((F / t_0) / B);
} else if (F <= 38000000.0) {
tmp = -(x / B) + (((F * 1.0) / t_0) / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0))) tmp = 0.0 if (F <= -8.5e+22) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 3.4e-173) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / t_0) / B)); elseif (F <= 38000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(F * 1.0) / t_0) / sin(B))); 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[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -8.5e+22], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 3.4e-173], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / t$95$0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 38000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(F * 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[Sin[B], $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 := \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+22}:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-173}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{F}{t\_0}}{B}\\
\mathbf{elif}\;F \leq 38000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{F \cdot 1}{t\_0}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -8.49999999999999979e22Initial program 56.4%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites72.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-+.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites78.7%
if -8.49999999999999979e22 < F < 3.3999999999999999e-173Initial program 99.3%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites84.5%
if 3.3999999999999999e-173 < F < 3.8e7Initial program 99.3%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.3
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f6474.2
Applied rewrites74.2%
if 3.8e7 < F Initial program 56.9%
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.f6499.8
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma 2.0 x (fma F F 2.0)))))
(if (<= F -8.5e+22)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 3.4e-173)
(+ (- (* x (/ 1.0 (tan B)))) (/ (/ F t_0) B))
(if (<= F 6.4e+46)
(+ (- (/ x B)) (/ (/ (* F 1.0) t_0) (sin B)))
(/ (- 1.0 x) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0)));
double tmp;
if (F <= -8.5e+22) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 3.4e-173) {
tmp = -(x * (1.0 / tan(B))) + ((F / t_0) / B);
} else if (F <= 6.4e+46) {
tmp = -(x / B) + (((F * 1.0) / t_0) / sin(B));
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0))) tmp = 0.0 if (F <= -8.5e+22) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 3.4e-173) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / t_0) / B)); elseif (F <= 6.4e+46) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(F * 1.0) / t_0) / sin(B))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -8.5e+22], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 3.4e-173], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / t$95$0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.4e+46], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(F * 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+22}:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-173}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{F}{t\_0}}{B}\\
\mathbf{elif}\;F \leq 6.4 \cdot 10^{+46}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{F \cdot 1}{t\_0}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -8.49999999999999979e22Initial program 56.4%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites72.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-+.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites78.7%
if -8.49999999999999979e22 < F < 3.3999999999999999e-173Initial program 99.3%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites84.5%
if 3.3999999999999999e-173 < F < 6.3999999999999996e46Initial program 98.7%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.3%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites99.3%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6499.4
Applied rewrites99.4%
Taylor expanded in B around 0
lower-/.f6475.6
Applied rewrites75.6%
if 6.3999999999999996e46 < F Initial program 52.0%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites78.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ (* x 1.0) (tan B)))
(/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)))))
(if (<= x -7.2e-8)
t_0
(if (<= x 1.05e-8)
(+
(- (/ x B))
(/ (/ (* F 1.0) (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = -((x * 1.0) / tan(B)) + (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B));
double tmp;
if (x <= -7.2e-8) {
tmp = t_0;
} else if (x <= 1.05e-8) {
tmp = -(x / B) + (((F * 1.0) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B))) tmp = 0.0 if (x <= -7.2e-8) tmp = t_0; elseif (x <= 1.05e-8) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(F * 1.0) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.2e-8], t$95$0, If[LessEqual[x, 1.05e-8], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(F * 1.0), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-8}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\frac{F \cdot 1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -7.19999999999999962e-8 or 1.04999999999999997e-8 < x Initial program 82.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6495.6
Applied rewrites95.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.2
Applied rewrites96.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6496.3
Applied rewrites96.3%
if -7.19999999999999962e-8 < x < 1.04999999999999997e-8Initial program 72.9%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites75.9%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites75.8%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6475.9
Applied rewrites75.9%
Taylor expanded in B around 0
lower-/.f6463.4
Applied rewrites63.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ (* x 1.0) (tan B)))
(/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)))))
(if (<= x -7.2e-8)
t_0
(if (<= x 1.05e-8)
(+
(- (/ x B))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = -((x * 1.0) / tan(B)) + (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B));
double tmp;
if (x <= -7.2e-8) {
tmp = t_0;
} else if (x <= 1.05e-8) {
tmp = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B))) tmp = 0.0 if (x <= -7.2e-8) tmp = t_0; elseif (x <= 1.05e-8) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.2e-8], t$95$0, If[LessEqual[x, 1.05e-8], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{-8}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-8}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -7.19999999999999962e-8 or 1.04999999999999997e-8 < x Initial program 82.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6495.6
Applied rewrites95.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6496.2
Applied rewrites96.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6496.3
Applied rewrites96.3%
if -7.19999999999999962e-8 < x < 1.04999999999999997e-8Initial program 72.9%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites75.9%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites75.8%
Taylor expanded in B around 0
lower-/.f6463.3
Applied rewrites63.3%
(FPCore (F B x)
:precision binary64
(if (<= B 1.2e-11)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(+
(- (* x (/ 1.0 (tan B))))
(/ -1.0 (* (fma (* (* B B) 0.008333333333333333) (* B B) 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.2e-11) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / (fma(((B * B) * 0.008333333333333333), (B * B), 1.0) * B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 1.2e-11) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / Float64(fma(Float64(Float64(B * B) * 0.008333333333333333), Float64(B * B), 1.0) * B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 1.2e-11], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[(N[(N[(N[(B * B), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.008333333333333333, B \cdot B, 1\right) \cdot B}\\
\end{array}
\end{array}
if B < 1.2000000000000001e-11Initial program 74.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6457.6
Applied rewrites57.6%
if 1.2000000000000001e-11 < B Initial program 85.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.9
Applied rewrites55.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6455.5
Applied rewrites55.5%
Taylor expanded in B around inf
*-commutativeN/A
lower-*.f64N/A
pow2N/A
lift-*.f6455.4
Applied rewrites55.4%
(FPCore (F B x)
:precision binary64
(if (<= B 1.2e-11)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(+
(- (/ (* x 1.0) (tan B)))
(/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.2e-11) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 1.2e-11) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 1.2e-11], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\end{array}
\end{array}
if B < 1.2000000000000001e-11Initial program 74.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6457.6
Applied rewrites57.6%
if 1.2000000000000001e-11 < B Initial program 85.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.9
Applied rewrites55.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6454.8
Applied rewrites54.8%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6454.8
Applied rewrites54.8%
(FPCore (F B x)
:precision binary64
(if (<= B 6e-26)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(+
(- (* x (/ 1.0 (tan B))))
(/ -1.0 (* (* -0.16666666666666666 (* B B)) B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 6e-26) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / ((-0.16666666666666666 * (B * B)) * B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 6e-26) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / Float64(Float64(-0.16666666666666666 * Float64(B * B)) * B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 6e-26], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 6 \cdot 10^{-26}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{\left(-0.16666666666666666 \cdot \left(B \cdot B\right)\right) \cdot B}\\
\end{array}
\end{array}
if B < 6.00000000000000023e-26Initial program 73.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.2%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6457.2
Applied rewrites57.2%
if 6.00000000000000023e-26 < B Initial program 85.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.8
Applied rewrites55.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6454.6
Applied rewrites54.6%
Taylor expanded in B around inf
lower-*.f64N/A
pow2N/A
lift-*.f6453.5
Applied rewrites53.5%
(FPCore (F B x) :precision binary64 (if (<= B 1.2e-11) (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B) (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.2e-11) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 1.2e-11) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 1.2e-11], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.2 \cdot 10^{-11}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 1.2000000000000001e-11Initial program 74.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6457.6
Applied rewrites57.6%
if 1.2000000000000001e-11 < B Initial program 85.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6455.9
Applied rewrites55.9%
Taylor expanded in B around 0
Applied rewrites51.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+177)
(/ -1.0 (sin B))
(if (<= F 1.28e+123)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(if (<= F 4.2e+230)
(/ 1.0 (sin B))
(/
(- (fma (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))) (* B B) 1.0) x)
B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+177) {
tmp = -1.0 / sin(B);
} else if (F <= 1.28e+123) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else if (F <= 4.2e+230) {
tmp = 1.0 / sin(B);
} else {
tmp = (fma(fma(0.5, x, (0.16666666666666666 * (1.0 - x))), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+177) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.28e+123) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); elseif (F <= 4.2e+230) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(fma(fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+177], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.28e+123], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e+230], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+177}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.28 \cdot 10^{+123}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+230}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1e177Initial program 30.7%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites51.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-+.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6449.7
Applied rewrites49.7%
if -1e177 < F < 1.28000000000000005e123Initial program 94.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6451.4
Applied rewrites51.4%
if 1.28000000000000005e123 < F < 4.19999999999999986e230Initial program 43.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.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites53.1%
if 4.19999999999999986e230 < F Initial program 31.5%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites50.5%
(FPCore (F B x)
:precision binary64
(if (<= F -3e+97)
(+
(- (/ x B))
(/
-1.0
(*
(fma
(- (* 0.008333333333333333 (* B B)) 0.16666666666666666)
(* B B)
1.0)
B)))
(if (<= F 1.28e+123)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(if (<= F 4.2e+230)
(/ 1.0 (sin B))
(/
(- (fma (fma 0.5 x (* 0.16666666666666666 (- 1.0 x))) (* B B) 1.0) x)
B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3e+97) {
tmp = -(x / B) + (-1.0 / (fma(((0.008333333333333333 * (B * B)) - 0.16666666666666666), (B * B), 1.0) * B));
} else if (F <= 1.28e+123) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else if (F <= 4.2e+230) {
tmp = 1.0 / sin(B);
} else {
tmp = (fma(fma(0.5, x, (0.16666666666666666 * (1.0 - x))), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3e+97) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / Float64(fma(Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666), Float64(B * B), 1.0) * B))); elseif (F <= 1.28e+123) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); elseif (F <= 4.2e+230) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(fma(fma(0.5, x, Float64(0.16666666666666666 * Float64(1.0 - x))), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3e+97], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[(N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.28e+123], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e+230], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * N[(1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{+97}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{elif}\;F \leq 1.28 \cdot 10^{+123}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+230}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \left(1 - x\right)\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.9999999999999998e97Initial program 45.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6475.5
Applied rewrites75.5%
Taylor expanded in B around 0
lower-/.f6451.7
Applied rewrites51.7%
if -2.9999999999999998e97 < F < 1.28000000000000005e123Initial program 97.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6452.4
Applied rewrites52.4%
if 1.28000000000000005e123 < F < 4.19999999999999986e230Initial program 43.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.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites53.1%
if 4.19999999999999986e230 < F Initial program 31.5%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites50.5%
(FPCore (F B x)
:precision binary64
(if (<= F -200000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 38000000.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -200000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 38000000.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -200000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 38000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -200000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 38000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -200000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 38000000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -2e5Initial program 58.4%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites73.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-+.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites78.8%
if -2e5 < F < 3.8e7Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.2%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6452.2
Applied rewrites52.2%
if 3.8e7 < F Initial program 56.9%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites78.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+177)
(/ -1.0 (sin B))
(if (<= F 38000000.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+177) {
tmp = -1.0 / sin(B);
} else if (F <= 38000000.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+177) tmp = Float64(-1.0 / sin(B)); elseif (F <= 38000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+177], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 38000000.0], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+177}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 38000000:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1e177Initial program 30.7%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites51.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
*-commutativeN/A
lower-+.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6449.7
Applied rewrites49.7%
if -1e177 < F < 3.8e7Initial program 95.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.3%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6451.3
Applied rewrites51.3%
if 3.8e7 < F Initial program 56.9%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites78.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3e+97)
(+
(- (/ x B))
(/
-1.0
(*
(fma
(- (* 0.008333333333333333 (* B B)) 0.16666666666666666)
(* B B)
1.0)
B)))
(if (<= F 3.6e+141)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma (* (* B B) x) 0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3e+97) {
tmp = -(x / B) + (-1.0 / (fma(((0.008333333333333333 * (B * B)) - 0.16666666666666666), (B * B), 1.0) * B));
} else if (F <= 3.6e+141) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(((B * B) * x), 0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3e+97) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / Float64(fma(Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666), Float64(B * B), 1.0) * B))); elseif (F <= 3.6e+141) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(Float64(Float64(B * B) * x), 0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3e+97], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[(N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e+141], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{+97}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{+141}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.9999999999999998e97Initial program 45.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6475.5
Applied rewrites75.5%
Taylor expanded in B around 0
lower-/.f6451.7
Applied rewrites51.7%
if -2.9999999999999998e97 < F < 3.6000000000000001e141Initial program 97.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6452.4
Applied rewrites52.4%
if 3.6000000000000001e141 < F Initial program 34.2%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites49.7%
Taylor expanded in B around 0
Applied rewrites26.0%
Taylor expanded in B around 0
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
metadata-eval51.8
Applied rewrites51.8%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+98)
(/ (- (+ 1.0 x)) B)
(if (<= F 3.6e+141)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (- (fma (* (* B B) x) 0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+98) {
tmp = -(1.0 + x) / B;
} else if (F <= 3.6e+141) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (fma(((B * B) * x), 0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+98) tmp = Float64(Float64(-Float64(1.0 + x)) / B); elseif (F <= 3.6e+141) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(fma(Float64(Float64(B * B) * x), 0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+98], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3.6e+141], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+98}:\\
\;\;\;\;\frac{-\left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{+141}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -4.9999999999999998e98Initial program 45.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.7%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6451.6
Applied rewrites51.6%
if -4.9999999999999998e98 < F < 3.6000000000000001e141Initial program 97.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
unpow-1N/A
lower-/.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
lift-fma.f64N/A
lift-fma.f6452.4
Applied rewrites52.4%
if 3.6000000000000001e141 < F Initial program 34.2%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites49.7%
Taylor expanded in B around 0
Applied rewrites26.0%
Taylor expanded in B around 0
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
metadata-eval51.8
Applied rewrites51.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+188)
(/ (- (+ 1.0 x)) B)
(if (<= F 4e+141)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(/ (- (fma (* (* B B) x) 0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+188) {
tmp = -(1.0 + x) / B;
} else if (F <= 4e+141) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (fma(((B * B) * x), 0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+188) tmp = Float64(Float64(-Float64(1.0 + x)) / B); elseif (F <= 4e+141) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(fma(Float64(Float64(B * B) * x), 0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+188], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 4e+141], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+188}:\\
\;\;\;\;\frac{-\left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+141}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.35e188Initial program 29.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites28.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6452.8
Applied rewrites52.8%
if -1.35e188 < F < 4.00000000000000007e141Initial program 93.4%
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-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites97.2%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
pow2N/A
+-commutativeN/A
inv-powN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
Applied rewrites97.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f6497.2
Applied rewrites97.2%
Taylor expanded in B around 0
Applied rewrites51.0%
if 4.00000000000000007e141 < F Initial program 34.1%
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.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites49.8%
Taylor expanded in B around 0
Applied rewrites26.0%
Taylor expanded in B around 0
metadata-evalN/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
metadata-eval51.9
Applied rewrites51.9%
(FPCore (F B x) :precision binary64 (if (<= F -200.0) (/ (- (/ 1.0 (* F F)) (+ 1.0 x)) B) (if (<= F 2.75e-61) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -200.0) {
tmp = ((1.0 / (F * F)) - (1.0 + x)) / B;
} else if (F <= 2.75e-61) {
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 <= (-200.0d0)) then
tmp = ((1.0d0 / (f * f)) - (1.0d0 + x)) / b
else if (f <= 2.75d-61) 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 <= -200.0) {
tmp = ((1.0 / (F * F)) - (1.0 + x)) / B;
} else if (F <= 2.75e-61) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -200.0: tmp = ((1.0 / (F * F)) - (1.0 + x)) / B elif F <= 2.75e-61: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -200.0) tmp = Float64(Float64(Float64(1.0 / Float64(F * F)) - Float64(1.0 + x)) / B); elseif (F <= 2.75e-61) 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 <= -200.0) tmp = ((1.0 / (F * F)) - (1.0 + x)) / B; elseif (F <= 2.75e-61) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -200.0], N[(N[(N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.75e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -200:\\
\;\;\;\;\frac{\frac{1}{F \cdot F} - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 2.75 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -200Initial program 58.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.9%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6426.6
Applied rewrites26.6%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
lower-+.f6452.0
Applied rewrites52.0%
Taylor expanded in x around 0
Applied rewrites52.0%
if -200 < F < 2.7499999999999998e-61Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 2.7499999999999998e-61 < F Initial program 63.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.0%
Taylor expanded in F around inf
lower--.f6447.3
Applied rewrites47.3%
(FPCore (F B x) :precision binary64 (if (<= F -200.0) (/ (- (+ 1.0 x)) B) (if (<= F 2.75e-61) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -200.0) {
tmp = -(1.0 + x) / B;
} else if (F <= 2.75e-61) {
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 <= (-200.0d0)) then
tmp = -(1.0d0 + x) / b
else if (f <= 2.75d-61) 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 <= -200.0) {
tmp = -(1.0 + x) / B;
} else if (F <= 2.75e-61) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -200.0: tmp = -(1.0 + x) / B elif F <= 2.75e-61: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -200.0) tmp = Float64(Float64(-Float64(1.0 + x)) / B); elseif (F <= 2.75e-61) 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 <= -200.0) tmp = -(1.0 + x) / B; elseif (F <= 2.75e-61) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -200.0], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 2.75e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -200:\\
\;\;\;\;\frac{-\left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 2.75 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -200Initial program 58.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6451.9
Applied rewrites51.9%
if -200 < F < 2.7499999999999998e-61Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites52.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6436.0
Applied rewrites36.0%
if 2.7499999999999998e-61 < F Initial program 63.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.0%
Taylor expanded in F around inf
lower--.f6447.3
Applied rewrites47.3%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (- x) B))) (if (<= x -1.1e-155) t_0 (if (<= x 7.7e-118) (/ 1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.1e-155) {
tmp = t_0;
} else if (x <= 7.7e-118) {
tmp = 1.0 / B;
} else {
tmp = t_0;
}
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 / b
if (x <= (-1.1d-155)) then
tmp = t_0
else if (x <= 7.7d-118) then
tmp = 1.0d0 / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.1e-155) {
tmp = t_0;
} else if (x <= 7.7e-118) {
tmp = 1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if x <= -1.1e-155: tmp = t_0 elif x <= 7.7e-118: tmp = 1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (x <= -1.1e-155) tmp = t_0; elseif (x <= 7.7e-118) tmp = Float64(1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / B; tmp = 0.0; if (x <= -1.1e-155) tmp = t_0; elseif (x <= 7.7e-118) tmp = 1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -1.1e-155], t$95$0, If[LessEqual[x, 7.7e-118], N[(1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{-155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7.7 \cdot 10^{-118}:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.1e-155 or 7.6999999999999996e-118 < x Initial program 78.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites47.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6440.0
Applied rewrites40.0%
if -1.1e-155 < x < 7.6999999999999996e-118Initial program 72.9%
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.f6426.8
Applied rewrites26.8%
Taylor expanded in x around 0
Applied rewrites26.8%
Taylor expanded in B around 0
Applied rewrites16.0%
(FPCore (F B x) :precision binary64 (if (<= F 2.75e-61) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.75e-61) {
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.75d-61) 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.75e-61) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.75e-61: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.75e-61) 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.75e-61) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.75e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.75 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.7499999999999998e-61Initial program 83.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.9%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6432.2
Applied rewrites32.2%
if 2.7499999999999998e-61 < F Initial program 63.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.0%
Taylor expanded in F around inf
lower--.f6447.3
Applied rewrites47.3%
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
return 1.0 / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
return 1.0 / B;
}
def code(F, B, x): return 1.0 / B
function code(F, B, x) return Float64(1.0 / B) end
function tmp = code(F, B, x) tmp = 1.0 / B; end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{B}
\end{array}
Initial program 76.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.f6455.6
Applied rewrites55.6%
Taylor expanded in x around 0
Applied rewrites16.4%
Taylor expanded in B around 0
Applied rewrites9.8%
herbie shell --seed 2025089
(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))))))