
(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 25 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 (pow (fma x 2.0 (fma F F 2.0)) -0.25)) (t_1 (* (cos B) x)))
(if (<= F -1.7e+39)
(- (/ (+ 1.0 t_1) (sin B)))
(if (<= F 114000000.0)
(fma F (/ (* t_0 t_0) (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 t_1) (sin B))))))
double code(double F, double B, double x) {
double t_0 = pow(fma(x, 2.0, fma(F, F, 2.0)), -0.25);
double t_1 = cos(B) * x;
double tmp;
if (F <= -1.7e+39) {
tmp = -((1.0 + t_1) / sin(B));
} else if (F <= 114000000.0) {
tmp = fma(F, ((t_0 * t_0) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_1) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.25 t_1 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1.7e+39) tmp = Float64(-Float64(Float64(1.0 + t_1) / sin(B))); elseif (F <= 114000000.0) tmp = fma(F, Float64(Float64(t_0 * t_0) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_1) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.25], $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.7e+39], (-N[(N[(1.0 + t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 114000000.0], N[(F * N[(N[(t$95$0 * t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.25}\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.7 \cdot 10^{+39}:\\
\;\;\;\;-\frac{1 + t\_1}{\sin B}\\
\mathbf{elif}\;F \leq 114000000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{t\_0 \cdot t\_0}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_1}{\sin B}\\
\end{array}
\end{array}
if F < -1.6999999999999999e39Initial program 77.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if -1.6999999999999999e39 < F < 1.14e8Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
sqr-powN/A
lower-*.f64N/A
lower-pow.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
lower-pow.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f64N/A
metadata-eval85.1
Applied rewrites85.1%
if 1.14e8 < F Initial program 77.3%
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.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.3e+39)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 1850000000.0)
(fma
F
(/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B))
(/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.3e+39) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 1850000000.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.3e+39) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 1850000000.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.3e+39], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1850000000.0], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1850000000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.30000000000000012e39Initial program 77.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if -2.30000000000000012e39 < F < 1.85e9Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
if 1.85e9 < F Initial program 77.3%
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.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.3e+39)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 1850000000.0)
(fma F (/ (sqrt (/ 1.0 (+ 2.0 (* F F)))) (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.3e+39) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 1850000000.0) {
tmp = fma(F, (sqrt((1.0 / (2.0 + (F * F)))) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.3e+39) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 1850000000.0) tmp = fma(F, Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(F * F)))) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.3e+39], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1850000000.0], N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1850000000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{\frac{1}{2 + F \cdot F}}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.30000000000000012e39Initial program 77.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if -2.30000000000000012e39 < F < 1.85e9Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
pow2N/A
lower-*.f6485.1
Applied rewrites85.1%
if 1.85e9 < F Initial program 77.3%
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.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1.5)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 1.45)
(fma F (/ (sqrt (/ 1.0 (+ 2.0 (+ x x)))) (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1.5) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 1.45) {
tmp = fma(F, (sqrt((1.0 / (2.0 + (x + x)))) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1.5) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 1.45) tmp = fma(F, Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x + x)))) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.5], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.45], N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.5:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{\frac{1}{2 + \left(x + x\right)}}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1.5Initial program 77.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if -1.5 < F < 1.44999999999999996Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in F around 0
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
count-2-revN/A
lower-+.f6456.3
Applied rewrites56.3%
if 1.44999999999999996 < F Initial program 77.3%
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.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1260000.0)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F -2.3e-55)
(fma
F
(/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B))
(/ (- x) (* (- 1.0 (* -0.3333333333333333 (* B B))) B)))
(if (<= F 2020.0)
(fma
F
(* (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (/ 1.0 B))
(/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1260000.0) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= -2.3e-55) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / ((1.0 - (-0.3333333333333333 * (B * B))) * B)));
} else if (F <= 2020.0) {
tmp = fma(F, (sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))) * (1.0 / B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1260000.0) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= -2.3e-55) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / Float64(Float64(1.0 - Float64(-0.3333333333333333 * Float64(B * B))) * B))); elseif (F <= 2020.0) tmp = fma(F, Float64(sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))) * Float64(1.0 / B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1260000.0], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -2.3e-55], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[(N[(1.0 - N[(-0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2020.0], N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1260000:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq -2.3 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\left(1 - -0.3333333333333333 \cdot \left(B \cdot B\right)\right) \cdot B}\right)\\
\mathbf{elif}\;F \leq 2020:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1.26e6Initial program 77.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if -1.26e6 < F < -2.30000000000000011e-55Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f64N/A
pow2N/A
lift-*.f6457.5
Applied rewrites57.5%
if -2.30000000000000011e-55 < F < 2020Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
if 2020 < F Initial program 77.3%
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.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1260000.0)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F -2.3e-55)
(+ (- (/ x B)) (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
(if (<= F 2020.0)
(fma
F
(* (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (/ 1.0 B))
(/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1260000.0) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= -2.3e-55) {
tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else if (F <= 2020.0) {
tmp = fma(F, (sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))) * (1.0 / B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1260000.0) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= -2.3e-55) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); elseif (F <= 2020.0) tmp = fma(F, Float64(sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))) * Float64(1.0 / B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1260000.0], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -2.3e-55], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2020.0], N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1260000:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq -2.3 \cdot 10^{-55}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 2020:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1.26e6Initial program 77.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if -1.26e6 < F < -2.30000000000000011e-55Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
if -2.30000000000000011e-55 < F < 2020Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
if 2020 < F Initial program 77.3%
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.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.12e+39)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F 2020.0)
(fma
F
(* (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (/ 1.0 B))
(/ (- x) (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.12e+39) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= 2020.0) {
tmp = fma(F, (sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))) * (1.0 / B)), (-x / tan(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.12e+39) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= 2020.0) tmp = fma(F, Float64(sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))) * Float64(1.0 / B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.12e+39], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2020.0], N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[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}
\mathbf{if}\;F \leq -1.12 \cdot 10^{+39}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2020:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.12e39Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6435.8
Applied rewrites35.8%
if -1.12e39 < F < 2020Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
if 2020 < F Initial program 77.3%
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.7
Applied rewrites55.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(fma
F
(* (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (/ 1.0 B))
(/ (- x) (tan B)))))
(if (<= x -4.4e-103)
t_0
(if (<= x 3.3e-149)
(+ (- (/ x B)) (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (sin B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = fma(F, (sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))) * (1.0 / B)), (-x / tan(B)));
double tmp;
if (x <= -4.4e-103) {
tmp = t_0;
} else if (x <= 3.3e-149) {
tmp = -(x / B) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / sin(B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = fma(F, Float64(sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))) * Float64(1.0 / B)), Float64(Float64(-x) / tan(B))) tmp = 0.0 if (x <= -4.4e-103) tmp = t_0; elseif (x <= 3.3e-149) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / sin(B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e-103], t$95$0, If[LessEqual[x, 3.3e-149], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-103}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-149}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.3999999999999999e-103 or 3.30000000000000017e-149 < x Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
if -4.3999999999999999e-103 < x < 3.30000000000000017e-149Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.12e+39)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F 1.1e+39)
(fma
F
(* (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (/ 1.0 B))
(/ (- x) (tan B)))
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.12e+39) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= 1.1e+39) {
tmp = fma(F, (sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))) * (1.0 / B)), (-x / tan(B)));
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.12e+39) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= 1.1e+39) tmp = fma(F, Float64(sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))) * Float64(1.0 / B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.12e+39], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e+39], N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.12 \cdot 10^{+39}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}} \cdot \frac{1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1.12e39Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6435.8
Applied rewrites35.8%
if -1.12e39 < F < 1.1000000000000001e39Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-sin.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6470.1
Applied rewrites70.1%
if 1.1000000000000001e39 < F Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
Applied rewrites37.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.32e+26)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F 1.05e+39)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))) (/ F B)))
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.32e+26) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= 1.05e+39) {
tmp = -(x * (1.0 / tan(B))) + ((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * (F / B));
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.32e+26) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= 1.05e+39) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * Float64(F / B))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.32e+26], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e+39], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.32 \cdot 10^{+26}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{+39}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1.32e26Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6435.8
Applied rewrites35.8%
if -1.32e26 < F < 1.0499999999999999e39Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.3%
if 1.0499999999999999e39 < F Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
Applied rewrites37.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -1.4)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 1.26)
(+ t_0 (/ (* F (pow (fma 2.0 x 2.0) -0.5)) (sin B)))
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.4) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 1.26) {
tmp = t_0 + ((F * pow(fma(2.0, x, 2.0), -0.5)) / sin(B));
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 1.26) tmp = Float64(t_0 + Float64(Float64(F * (fma(2.0, x, 2.0) ^ -0.5)) / sin(B))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.4], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.26], N[(t$95$0 + N[(N[(F * N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $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 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.26:\\
\;\;\;\;t\_0 + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6435.8
Applied rewrites35.8%
if -1.3999999999999999 < F < 1.26000000000000001Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around 0
Applied rewrites35.9%
if 1.26000000000000001 < F Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
Applied rewrites37.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -1.4)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 1.26)
(+ t_0 (* (/ F (sin B)) (sqrt (/ 1.0 (- 2.0 (* -2.0 x))))))
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.4) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 1.26) {
tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / (2.0 - (-2.0 * x)))));
} else {
tmp = (1.0 - 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 / b)
if (f <= (-1.4d0)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 1.26d0) then
tmp = t_0 + ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 - ((-2.0d0) * x)))))
else
tmp = (1.0d0 - x) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.4) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 1.26) {
tmp = t_0 + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 - (-2.0 * x)))));
} else {
tmp = (1.0 - x) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = -(x / B) tmp = 0 if F <= -1.4: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 1.26: tmp = t_0 + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 - (-2.0 * x))))) else: tmp = (1.0 - x) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 1.26) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 - Float64(-2.0 * x)))))); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x / B); tmp = 0.0; if (F <= -1.4) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 1.26) tmp = t_0 + ((F / sin(B)) * sqrt((1.0 / (2.0 - (-2.0 * x))))); else tmp = (1.0 - x) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.4], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.26], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 - N[(-2.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.26:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 - -2 \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6435.8
Applied rewrites35.8%
if -1.3999999999999999 < F < 1.26000000000000001Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
metadata-eval35.2
Applied rewrites35.2%
if 1.26000000000000001 < F Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
Applied rewrites37.7%
(FPCore (F B x)
:precision binary64
(if (<= F -31000000.0)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F -1.6e-85)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
(if (<= F 2020.0)
(/ (- (/ (* 1.0 F) (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(/ (- 1.0 x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -31000000.0) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= -1.6e-85) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
} else if (F <= 2020.0) {
tmp = (((1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -31000000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= -1.6e-85) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (F <= 2020.0) tmp = Float64(Float64(Float64(Float64(1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -31000000.0], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.6e-85], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2020.0], N[(N[(N[(N[(1.0 * F), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -31000000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -1.6 \cdot 10^{-85}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 2020:\\
\;\;\;\;\frac{\frac{1 \cdot F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -3.1e7Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6435.8
Applied rewrites35.8%
if -3.1e7 < F < -1.60000000000000014e-85Initial program 77.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6429.7
Applied rewrites29.7%
if -1.60000000000000014e-85 < F < 2020Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f6443.5
Applied rewrites43.5%
if 2020 < F Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
Applied rewrites37.7%
(FPCore (F B x)
:precision binary64
(if (<= F -15500000.0)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F 2020.0)
(/ (- (/ (* 1.0 F) (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -15500000.0) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= 2020.0) {
tmp = (((1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -15500000.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= 2020.0) tmp = Float64(Float64(Float64(Float64(1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -15500000.0], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2020.0], N[(N[(N[(N[(1.0 * F), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 -15500000:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2020:\\
\;\;\;\;\frac{\frac{1 \cdot F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -1.55e7Initial program 77.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-/.f64N/A
lift-neg.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites85.1%
Taylor expanded in B around 0
lower-/.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6435.8
Applied rewrites35.8%
if -1.55e7 < F < 2020Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f6443.5
Applied rewrites43.5%
if 2020 < F Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
Applied rewrites37.7%
(FPCore (F B x) :precision binary64 (if (<= F 2020.0) (/ (- (/ (* 1.0 F) (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (/ (- 1.0 x) (sin B))))
double code(double F, double B, double x) {
double tmp;
if (F <= 2020.0) {
tmp = (((1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 2020.0) tmp = Float64(Float64(Float64(Float64(1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 2020.0], N[(N[(N[(N[(1.0 * F), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $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 2020:\\
\;\;\;\;\frac{\frac{1 \cdot F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < 2020Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f6443.5
Applied rewrites43.5%
if 2020 < F Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
Applied rewrites37.7%
(FPCore (F B x) :precision binary64 (if (<= B 780000.0) (/ (- (/ (* 1.0 F) (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 780000.0) {
tmp = (((1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 780000.0) tmp = Float64(Float64(Float64(Float64(1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 780000.0], N[(N[(N[(N[(1.0 * F), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 780000:\\
\;\;\;\;\frac{\frac{1 \cdot F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 7.8e5Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f6443.5
Applied rewrites43.5%
if 7.8e5 < B Initial program 77.3%
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.7
Applied rewrites55.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
pow2N/A
lift-*.f6428.9
Applied rewrites28.9%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6417.2
Applied rewrites17.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.031)
(/ (- (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) 1.0) x) B)
(if (<= F 1.45)
(/ (- (* (/ 1.0 (sqrt (fma 2.0 x 2.0))) F) x) B)
(/ (- (fma (/ 2.0 (* F F)) -0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.031) {
tmp = ((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - 1.0) - x) / B;
} else if (F <= 1.45) {
tmp = (((1.0 / sqrt(fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (fma((2.0 / (F * F)), -0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.031) tmp = Float64(Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - 1.0) - x) / B); elseif (F <= 1.45) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(fma(Float64(2.0 / Float64(F * F)), -0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.031], N[(N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(N[(N[(1.0 / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(2.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.031:\\
\;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{2}{F \cdot F}, -0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -0.031Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around -inf
metadata-evalN/A
associate--r+N/A
lower--.f64N/A
Applied rewrites21.3%
if -0.031 < F < 1.44999999999999996Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
Taylor expanded in F around 0
Applied rewrites29.4%
if 1.44999999999999996 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f64N/A
Applied rewrites25.6%
Taylor expanded in x around 0
lower-/.f64N/A
pow2N/A
lift-*.f6425.9
Applied rewrites25.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(/ (- -1.0 x) B)
(if (<= F 1.45)
(/ (- (* (/ 1.0 (sqrt (fma 2.0 x 2.0))) F) x) B)
(/ (- (fma (/ 2.0 (* F F)) -0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.45) {
tmp = (((1.0 / sqrt(fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (fma((2.0 / (F * F)), -0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.45) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(fma(Float64(2.0 / Float64(F * F)), -0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(N[(N[(1.0 / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(2.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{2}{F \cdot F}, -0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
Taylor expanded in F around -inf
Applied rewrites28.9%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
Taylor expanded in F around 0
Applied rewrites29.4%
if 1.44999999999999996 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f64N/A
Applied rewrites25.6%
Taylor expanded in x around 0
lower-/.f64N/A
pow2N/A
lift-*.f6425.9
Applied rewrites25.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(/ (- -1.0 x) B)
(if (<= F 1.45)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x 2.0))) F) x) B)
(/ (- (fma (/ 2.0 (* F F)) -0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.45) {
tmp = ((sqrt((1.0 / fma(2.0, x, 2.0))) * F) - x) / B;
} else {
tmp = (fma((2.0 / (F * F)), -0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.45) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, 2.0))) * F) - x) / B); else tmp = Float64(Float64(fma(Float64(2.0 / Float64(F * F)), -0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(2.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{2}{F \cdot F}, -0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
Taylor expanded in F around -inf
Applied rewrites28.9%
if -1.3999999999999999 < F < 1.44999999999999996Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around 0
lower-/.f64N/A
+-commutativeN/A
lower-fma.f6429.4
Applied rewrites29.4%
if 1.44999999999999996 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f64N/A
Applied rewrites25.6%
Taylor expanded in x around 0
lower-/.f64N/A
pow2N/A
lift-*.f6425.9
Applied rewrites25.9%
(FPCore (F B x) :precision binary64 (if (<= F 50000000000000.0) (/ (- (/ (* 1.0 F) (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 50000000000000.0) {
tmp = (((1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 50000000000000.0) tmp = Float64(Float64(Float64(Float64(1.0 * F) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 50000000000000.0], N[(N[(N[(N[(1.0 * F), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 50000000000000:\\
\;\;\;\;\frac{\frac{1 \cdot F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5e13Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sqrt.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f6443.5
Applied rewrites43.5%
if 5e13 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f6429.0
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (if (<= F 50000000000000.0) (/ (- (* (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))) F) x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 50000000000000.0) {
tmp = (((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 50000000000000.0) tmp = Float64(Float64(Float64(Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 50000000000000.0], N[(N[(N[(N[(1.0 / N[Sqrt[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] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 50000000000000:\\
\;\;\;\;\frac{\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5e13Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
if 5e13 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f6429.0
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (if (<= F -5.5e-30) (/ (- -1.0 x) B) (if (<= F 4.8e-21) (/ (- x) B) (/ (- (fma (/ 2.0 (* F F)) -0.5 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.5e-30) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.8e-21) {
tmp = -x / B;
} else {
tmp = (fma((2.0 / (F * F)), -0.5, 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.5e-30) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.8e-21) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(fma(Float64(2.0 / Float64(F * F)), -0.5, 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.5e-30], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.8e-21], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(2.0 / N[(F * F), $MachinePrecision]), $MachinePrecision] * -0.5 + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{-21}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{2}{F \cdot F}, -0.5, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -5.49999999999999976e-30Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
Taylor expanded in F around -inf
Applied rewrites28.9%
if -5.49999999999999976e-30 < F < 4.7999999999999999e-21Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.7
Applied rewrites28.7%
if 4.7999999999999999e-21 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f64N/A
Applied rewrites25.6%
Taylor expanded in x around 0
lower-/.f64N/A
pow2N/A
lift-*.f6425.9
Applied rewrites25.9%
(FPCore (F B x) :precision binary64 (if (<= F -5.5e-30) (/ (- -1.0 x) B) (if (<= F 1.5e-98) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.5e-30) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.5e-98) {
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 <= (-5.5d-30)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.5d-98) 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 <= -5.5e-30) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.5e-98) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.5e-30: tmp = (-1.0 - x) / B elif F <= 1.5e-98: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.5e-30) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.5e-98) 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 <= -5.5e-30) tmp = (-1.0 - x) / B; elseif (F <= 1.5e-98) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.5e-30], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.5e-98], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{-98}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.49999999999999976e-30Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Applied rewrites43.4%
Taylor expanded in F around -inf
Applied rewrites28.9%
if -5.49999999999999976e-30 < F < 1.5e-98Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.7
Applied rewrites28.7%
if 1.5e-98 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f6429.0
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (if (<= F 1.5e-98) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.5e-98) {
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 <= 1.5d-98) 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 <= 1.5e-98) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.5e-98: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.5e-98) 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 <= 1.5e-98) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.5e-98], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.5 \cdot 10^{-98}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 1.5e-98Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.7
Applied rewrites28.7%
if 1.5e-98 < F Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around inf
lower--.f6429.0
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 77.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites43.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.7
Applied rewrites28.7%
herbie shell --seed 2025131
(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))))))