
(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 27 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(if (<= F -450000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 160000000.0)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (/ (- x) (tan B)))
(+ (- (/ (* x 1.0) (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -450000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 160000000.0) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / tan(B)));
} else {
tmp = -((x * 1.0) / tan(B)) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -450000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 160000000.0) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -450000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 160000000.0], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -450000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 160000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -4.5e8Initial program 58.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -4.5e8 < F < 1.6e8Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
lift-sin.f64N/A
associate-*l/N/A
+-commutativeN/A
Applied rewrites99.6%
if 1.6e8 < F Initial program 58.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 rewrites73.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6473.8
Applied rewrites73.8%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* x 1.0) (tan B)))))
(if (<= F -8e+110)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 1e+62)
(+ t_0 (/ (/ (* F 1.0) (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)))
(+ t_0 (/ (* F (/ 1.0 F)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -((x * 1.0) / tan(B));
double tmp;
if (F <= -8e+110) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 1e+62) {
tmp = t_0 + (((F * 1.0) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B));
} else {
tmp = t_0 + ((F * (1.0 / F)) / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(x * 1.0) / tan(B))) tmp = 0.0 if (F <= -8e+110) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 1e+62) tmp = Float64(t_0 + Float64(Float64(Float64(F * 1.0) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B))); else tmp = Float64(t_0 + Float64(Float64(F * Float64(1.0 / F)) / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -8e+110], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1e+62], N[(t$95$0 + 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], N[(t$95$0 + N[(N[(F * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x \cdot 1}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+110}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+62}:\\
\;\;\;\;t\_0 + \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 + \frac{F \cdot \frac{1}{F}}{\sin B}\\
\end{array}
\end{array}
if F < -8.0000000000000002e110Initial program 44.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -8.0000000000000002e110 < F < 1.00000000000000004e62Initial program 98.0%
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-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.6%
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.6
Applied rewrites99.6%
if 1.00000000000000004e62 < F Initial program 51.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 rewrites68.8%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6468.9
Applied rewrites68.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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites68.9%
Taylor expanded in F around inf
Applied rewrites99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* x 1.0) (tan B)))))
(if (<= F -6e+110)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 100000000.0)
(+ t_0 (/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -((x * 1.0) / tan(B));
double tmp;
if (F <= -6e+110) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 100000000.0) {
tmp = t_0 + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(x * 1.0) / tan(B))) tmp = 0.0 if (F <= -6e+110) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 100000000.0) tmp = Float64(t_0 + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -6e+110], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 100000000.0], N[(t$95$0 + 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], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x \cdot 1}{\tan B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{+110}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;t\_0 + \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 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -6.00000000000000014e110Initial program 44.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -6.00000000000000014e110 < F < 1e8Initial program 98.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-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.6%
if 1e8 < F Initial program 58.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 rewrites73.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6473.8
Applied rewrites73.8%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(if (<= F -75000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 100000000.0)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0)))) (/ F (sin B))))
(+ (- (/ (* x 1.0) (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -75000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 100000000.0) {
tmp = -(x * (1.0 / tan(B))) + ((1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * (F / sin(B)));
} else {
tmp = -((x * 1.0) / tan(B)) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -75000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 100000000.0) 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 / sin(B)))); else tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -75000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 100000000.0], 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 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -75000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\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}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -7.5e7Initial program 59.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -7.5e7 < F < 1e8Initial program 99.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
*-commutativeN/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
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.4%
if 1e8 < F Initial program 58.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 rewrites73.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6473.8
Applied rewrites73.8%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* x 1.0) (tan B)))))
(if (<= F -380000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 1.45)
(+ t_0 (/ (* F (/ 1.0 (sqrt (fma 2.0 x 2.0)))) (sin B)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -((x * 1.0) / tan(B));
double tmp;
if (F <= -380000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 1.45) {
tmp = t_0 + ((F * (1.0 / sqrt(fma(2.0, x, 2.0)))) / sin(B));
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(x * 1.0) / tan(B))) tmp = 0.0 if (F <= -380000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 1.45) tmp = Float64(t_0 + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, 2.0)))) / sin(B))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -380000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 1.45], N[(t$95$0 + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x \cdot 1}{\tan B}\\
\mathbf{if}\;F \leq -380000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;t\_0 + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.8e8Initial program 58.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -3.8e8 < F < 1.44999999999999996Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.5%
Taylor expanded in F around 0
Applied rewrites98.0%
if 1.44999999999999996 < F Initial program 59.6%
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 rewrites74.3%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6474.3
Applied rewrites74.3%
Taylor expanded in F around inf
Applied rewrites99.2%
(FPCore (F B x)
:precision binary64
(if (<= F -2900.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 0.00186)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F B) (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(+ (- (/ (* x 1.0) (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2900.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 0.00186) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)));
} else {
tmp = -((x * 1.0) / tan(B)) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2900.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 0.00186) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)))); else tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2900.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2900:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2900Initial program 59.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
if -2900 < F < 0.0018600000000000001Initial program 99.4%
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-*.f6482.5
Applied rewrites82.5%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6474.5
Applied rewrites74.5%
Taylor expanded in F around inf
Applied rewrites98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* x 1.0) (tan B)))))
(if (<= F -380000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 0.00186)
(+ t_0 (/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) B))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -((x * 1.0) / tan(B));
double tmp;
if (F <= -380000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 0.00186) {
tmp = t_0 + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / B);
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(x * 1.0) / tan(B))) tmp = 0.0 if (F <= -380000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 0.00186) tmp = Float64(t_0 + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / B)); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -380000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[(t$95$0 + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x \cdot 1}{\tan B}\\
\mathbf{if}\;F \leq -380000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;t\_0 + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.8e8Initial program 58.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -3.8e8 < F < 0.0018600000000000001Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
Applied rewrites82.4%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6474.5
Applied rewrites74.5%
Taylor expanded in F around inf
Applied rewrites98.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2900.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 0.00186)
(+
(- (* x (/ 1.0 (tan B))))
(/ (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) B))
(+ (- (/ (* x 1.0) (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2900.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 0.00186) {
tmp = -(x * (1.0 / tan(B))) + ((F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) / B);
} else {
tmp = -((x * 1.0) / tan(B)) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2900.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 0.00186) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) / B)); else tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2900.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2900:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2900Initial program 59.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.5
Applied rewrites99.5%
if -2900 < F < 0.0018600000000000001Initial program 99.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 rewrites99.4%
Taylor expanded in B around 0
Applied rewrites82.5%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6474.5
Applied rewrites74.5%
Taylor expanded in F around inf
Applied rewrites98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* x 1.0) (tan B)))))
(if (<= F -380000000.0)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 0.00186)
(+ t_0 (/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) B))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -((x * 1.0) / tan(B));
double tmp;
if (F <= -380000000.0) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 0.00186) {
tmp = t_0 + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / B);
} else {
tmp = t_0 + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(x * 1.0) / tan(B))) tmp = 0.0 if (F <= -380000000.0) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 0.00186) tmp = Float64(t_0 + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / B)); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -380000000.0], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[(t$95$0 + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x \cdot 1}{\tan B}\\
\mathbf{if}\;F \leq -380000000:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;t\_0 + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.8e8Initial program 58.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -3.8e8 < F < 0.0018600000000000001Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites82.4%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6474.5
Applied rewrites74.5%
Taylor expanded in F around inf
Applied rewrites98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -380000000.0)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 0.00186)
(+
(- (/ (* x 1.0) (tan B)))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) 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 <= -380000000.0) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 0.00186) {
tmp = -((x * 1.0) / tan(B)) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / 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 <= -380000000.0) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 0.00186) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / 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, -380000000.0], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $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 -380000000:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -3.8e8Initial program 58.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
if -3.8e8 < F < 0.0018600000000000001Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites82.4%
if 0.0018600000000000001 < F Initial program 59.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.f6498.8
Applied rewrites98.8%
(FPCore (F B x)
:precision binary64
(if (<= F -460000000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 0.00186)
(+
(- (/ (* x 1.0) (tan B)))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) B))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -460000000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 0.00186) {
tmp = -((x * 1.0) / tan(B)) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / B);
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -460000000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 0.00186) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / B)); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -460000000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $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 -460000000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -4.6e8Initial program 58.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites77.6%
if -4.6e8 < F < 0.0018600000000000001Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites82.4%
if 0.0018600000000000001 < F Initial program 59.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.f6498.8
Applied rewrites98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (/ x B))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) (sin B)))))
(if (<= F -70000000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F -8.6e-233)
t_0
(if (<= F 2.5e-139)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ -1.0 F)))
(if (<= F 45000000.0) t_0 (/ (- 1.0 x) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B));
double tmp;
if (F <= -70000000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= -8.6e-233) {
tmp = t_0;
} else if (F <= 2.5e-139) {
tmp = -(x * (1.0 / tan(B))) + ((F / (fma(-0.16666666666666666, (B * B), 1.0) * B)) * (-1.0 / F));
} else if (F <= 45000000.0) {
tmp = t_0;
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / sin(B))) tmp = 0.0 if (F <= -70000000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= -8.6e-233) tmp = t_0; elseif (F <= 2.5e-139) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) * Float64(-1.0 / F))); elseif (F <= 45000000.0) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, If[LessEqual[F, -70000000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -8.6e-233], t$95$0, If[LessEqual[F, 2.5e-139], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 45000000.0], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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{if}\;F \leq -70000000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq -8.6 \cdot 10^{-233}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-139}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq 45000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -7e7Initial program 59.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites77.6%
if -7e7 < F < -8.59999999999999975e-233 or 2.50000000000000017e-139 < F < 4.5e7Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.5
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f6470.9
Applied rewrites70.9%
if -8.59999999999999975e-233 < F < 2.50000000000000017e-139Initial program 99.5%
Taylor expanded in F around -inf
lower-/.f6434.6
Applied rewrites34.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6456.5
Applied rewrites56.5%
if 4.5e7 < F Initial program 58.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 rewrites73.8%
Taylor expanded in F around inf
sub-divN/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 rewrites76.5%
(FPCore (F B x)
:precision binary64
(if (<= F -460000000.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 0.00186)
(+
(- (/ (* x 1.0) (tan B)))
(/ (* F (/ 1.0 (sqrt (fma 2.0 x (fma F F 2.0))))) B))
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -460000000.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 0.00186) {
tmp = -((x * 1.0) / tan(B)) + ((F * (1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / B);
} else {
tmp = (1.0 - x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -460000000.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 0.00186) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F * Float64(1.0 / sqrt(fma(2.0, x, fma(F, F, 2.0))))) / B)); else tmp = Float64(Float64(1.0 - x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -460000000.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -460000000:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F \cdot \frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -4.6e8Initial program 58.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites77.6%
if -4.6e8 < F < 0.0018600000000000001Initial program 99.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 rewrites99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
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
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
Applied rewrites99.5%
Taylor expanded in B around 0
Applied rewrites82.4%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6498.8
Applied rewrites98.8%
Taylor expanded in B around 0
Applied rewrites75.7%
(FPCore (F B x)
:precision binary64
(if (<= B 0.0034)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0034) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + ((F / (fma(-0.16666666666666666, (B * B), 1.0) * B)) * (-1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.0034) 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(Float64(F / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.0034], 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[(N[(F / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0034:\\
\;\;\;\;\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{F}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if B < 0.00339999999999999981Initial program 73.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.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.f6457.0
Applied rewrites57.0%
if 0.00339999999999999981 < B Initial program 85.7%
Taylor expanded in F around -inf
lower-/.f6457.2
Applied rewrites57.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6455.8
Applied rewrites55.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2020.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 0.00186)
(- (* (/ F B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (/ x B))
(/ (- 1.0 x) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2020.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 0.00186) {
tmp = ((F / B) * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) - (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(1.0 + x) / sin(B))); elseif (F <= 0.00186) tmp = Float64(Float64(Float64(F / B) * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) - Float64(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[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2020:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{\sin B}\\
\end{array}
\end{array}
if F < -2020Initial program 59.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites77.5%
if -2020 < F < 0.0018600000000000001Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.1%
Applied rewrites50.1%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6498.8
Applied rewrites98.8%
Taylor expanded in B around 0
Applied rewrites75.7%
(FPCore (F B x) :precision binary64 (if (<= B 0.0034) (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B) (+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0034) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * (-1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.0034) 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(Float64(F / B) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.0034], 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[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0034:\\
\;\;\;\;\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{F}{B} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if B < 0.00339999999999999981Initial program 73.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.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.f6457.0
Applied rewrites57.0%
if 0.00339999999999999981 < B Initial program 85.7%
Taylor expanded in F around -inf
lower-/.f6457.2
Applied rewrites57.2%
Taylor expanded in B around 0
Applied rewrites54.1%
(FPCore (F B x)
:precision binary64
(if (<= F -2020.0)
(- (/ (+ 1.0 x) (sin B)))
(if (<= F 0.00186)
(/ (- (* (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 <= -2020.0) {
tmp = -((1.0 + x) / sin(B));
} else if (F <= 0.00186) {
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 <= -2020.0) tmp = Float64(-Float64(Float64(1.0 + x) / sin(B))); elseif (F <= 0.00186) 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, -2020.0], (-N[(N[(1.0 + x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 0.00186], 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 -2020:\\
\;\;\;\;-\frac{1 + x}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\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 < -2020Initial program 59.6%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.4
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites77.5%
if -2020 < F < 0.0018600000000000001Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.1%
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.f6450.1
Applied rewrites50.1%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6498.8
Applied rewrites98.8%
Taylor expanded in B around 0
Applied rewrites75.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3.1e+215)
(/ -1.0 (sin B))
(if (<= F 0.00186)
(/ (- (* (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 <= -3.1e+215) {
tmp = -1.0 / sin(B);
} else if (F <= 0.00186) {
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 <= -3.1e+215) tmp = Float64(-1.0 / sin(B)); elseif (F <= 0.00186) 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, -3.1e+215], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00186], 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 -3.1 \cdot 10^{+215}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.00186:\\
\;\;\;\;\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 < -3.0999999999999999e215Initial program 29.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6449.3
Applied rewrites49.3%
if -3.0999999999999999e215 < F < 0.0018600000000000001Initial program 91.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites48.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.f6448.2
Applied rewrites48.2%
if 0.0018600000000000001 < F Initial program 59.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 rewrites74.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6498.8
Applied rewrites98.8%
Taylor expanded in B around 0
Applied rewrites75.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3.1e+215)
(/ -1.0 (sin B))
(if (<= F 550000000.0)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.1e+215) {
tmp = -1.0 / sin(B);
} else if (F <= 550000000.0) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.1e+215) tmp = Float64(-1.0 / sin(B)); elseif (F <= 550000000.0) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.1e+215], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 550000000.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[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.1 \cdot 10^{+215}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 550000000:\\
\;\;\;\;\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}{\sin B}\\
\end{array}
\end{array}
if F < -3.0999999999999999e215Initial program 29.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6449.3
Applied rewrites49.3%
if -3.0999999999999999e215 < F < 5.5e8Initial program 91.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites48.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.f6448.3
Applied rewrites48.3%
if 5.5e8 < F Initial program 58.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 rewrites73.7%
Taylor expanded in F around inf
sub-divN/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
Applied rewrites52.4%
(FPCore (F B x)
:precision binary64
(if (<= F -3.1e+215)
(/ -1.0 (sin B))
(if (<= F 1.06e+79)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) 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 <= -3.1e+215) {
tmp = -1.0 / sin(B);
} else if (F <= 1.06e+79) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / 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 <= -3.1e+215) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.06e+79) 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(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, -3.1e+215], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.06e+79], 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[(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.1 \cdot 10^{+215}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{+79}:\\
\;\;\;\;\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(\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 < -3.0999999999999999e215Initial program 29.9%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6449.3
Applied rewrites49.3%
if -3.0999999999999999e215 < F < 1.05999999999999992e79Initial program 91.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites48.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.f6448.3
Applied rewrites48.3%
if 1.05999999999999992e79 < F Initial program 49.2%
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 rewrites66.6%
Taylor expanded in F around inf
sub-divN/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
metadata-evalN/A
lower-/.f64N/A
Applied rewrites50.7%
(FPCore (F B x)
:precision binary64
(if (<= F -6.2e+153)
(-
(/
(+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
B))
(if (<= F 1.06e+79)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) 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 <= -6.2e+153) {
tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
} else if (F <= 1.06e+79) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / 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 <= -6.2e+153) tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B)); elseif (F <= 1.06e+79) 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(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, -6.2e+153], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 1.06e+79], 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[(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 -6.2 \cdot 10^{+153}:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{+79}:\\
\;\;\;\;\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(\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 < -6.2e153Initial program 33.1%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6451.6
Applied rewrites51.6%
if -6.2e153 < F < 1.05999999999999992e79Initial program 96.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.1%
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.f6450.1
Applied rewrites50.1%
if 1.05999999999999992e79 < F Initial program 49.2%
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 rewrites66.6%
Taylor expanded in F around inf
sub-divN/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
metadata-evalN/A
lower-/.f64N/A
Applied rewrites50.7%
(FPCore (F B x)
:precision binary64
(if (<= F -95.0)
(-
(/
(+ (fma (fma -0.5 x (* 0.16666666666666666 (+ 1.0 x))) (* B B) x) 1.0)
B))
(if (<= F 3.9e-59)
(/ (- x) 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 <= -95.0) {
tmp = -((fma(fma(-0.5, x, (0.16666666666666666 * (1.0 + x))), (B * B), x) + 1.0) / B);
} else if (F <= 3.9e-59) {
tmp = -x / 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 <= -95.0) tmp = Float64(-Float64(Float64(fma(fma(-0.5, x, Float64(0.16666666666666666 * Float64(1.0 + x))), Float64(B * B), x) + 1.0) / B)); elseif (F <= 3.9e-59) tmp = Float64(Float64(-x) / 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, -95.0], (-N[(N[(N[(N[(-0.5 * x + N[(0.16666666666666666 * N[(1.0 + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), If[LessEqual[F, 3.9e-59], N[((-x) / B), $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 -95:\\
\;\;\;\;-\frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.5, x, 0.16666666666666666 \cdot \left(1 + x\right)\right), B \cdot B, x\right) + 1}{B}\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-59}:\\
\;\;\;\;\frac{-x}{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 < -95Initial program 59.7%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.3
Applied rewrites99.3%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6451.2
Applied rewrites51.2%
if -95 < F < 3.90000000000000019e-59Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.1%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6435.4
Applied rewrites35.4%
if 3.90000000000000019e-59 < F Initial program 64.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 rewrites77.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6492.3
Applied rewrites92.3%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites46.5%
(FPCore (F B x)
:precision binary64
(if (<= F -380000000.0)
(/ (- (+ 1.0 x)) B)
(if (<= F 3.9e-59)
(/ (- x) 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 <= -380000000.0) {
tmp = -(1.0 + x) / B;
} else if (F <= 3.9e-59) {
tmp = -x / 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 <= -380000000.0) tmp = Float64(Float64(-Float64(1.0 + x)) / B); elseif (F <= 3.9e-59) tmp = Float64(Float64(-x) / 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, -380000000.0], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3.9e-59], N[((-x) / B), $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 -380000000:\\
\;\;\;\;\frac{-\left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-59}:\\
\;\;\;\;\frac{-x}{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 < -3.8e8Initial program 58.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6451.2
Applied rewrites51.2%
if -3.8e8 < F < 3.90000000000000019e-59Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.0%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6435.1
Applied rewrites35.1%
if 3.90000000000000019e-59 < F Initial program 64.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 rewrites77.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6492.3
Applied rewrites92.3%
Taylor expanded in B around 0
metadata-evalN/A
lower-/.f64N/A
Applied rewrites46.5%
(FPCore (F B x) :precision binary64 (if (<= F -95.0) (/ (- (+ 1.0 x)) B) (if (<= F 5.5e-28) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -95.0) {
tmp = -(1.0 + x) / B;
} else if (F <= 5.5e-28) {
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 <= (-95.0d0)) then
tmp = -(1.0d0 + x) / b
else if (f <= 5.5d-28) 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 <= -95.0) {
tmp = -(1.0 + x) / B;
} else if (F <= 5.5e-28) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -95.0: tmp = -(1.0 + x) / B elif F <= 5.5e-28: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -95.0) tmp = Float64(Float64(-Float64(1.0 + x)) / B); elseif (F <= 5.5e-28) 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 <= -95.0) tmp = -(1.0 + x) / B; elseif (F <= 5.5e-28) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -95.0], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 5.5e-28], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -95:\\
\;\;\;\;\frac{-\left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -95Initial program 59.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites38.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6451.0
Applied rewrites51.0%
if -95 < F < 5.49999999999999967e-28Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6435.0
Applied rewrites35.0%
if 5.49999999999999967e-28 < F Initial program 62.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
lower--.f6448.1
Applied rewrites48.1%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (- x) B))) (if (<= x -1e-48) t_0 (if (<= x 2.3e-100) (/ 1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1e-48) {
tmp = t_0;
} else if (x <= 2.3e-100) {
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 <= (-1d-48)) then
tmp = t_0
else if (x <= 2.3d-100) 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 <= -1e-48) {
tmp = t_0;
} else if (x <= 2.3e-100) {
tmp = 1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if x <= -1e-48: tmp = t_0 elif x <= 2.3e-100: 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 <= -1e-48) tmp = t_0; elseif (x <= 2.3e-100) 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 <= -1e-48) tmp = t_0; elseif (x <= 2.3e-100) 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, -1e-48], t$95$0, If[LessEqual[x, 2.3e-100], N[(1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-48}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{-100}:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -9.9999999999999997e-49 or 2.29999999999999994e-100 < x Initial program 80.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6442.1
Applied rewrites42.1%
if -9.9999999999999997e-49 < x < 2.29999999999999994e-100Initial program 72.2%
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.7%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.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 rewrites15.7%
(FPCore (F B x) :precision binary64 (if (<= F 5.5e-28) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 5.5e-28) {
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-28) 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-28) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 5.5e-28: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 5.5e-28) 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-28) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 5.5e-28], 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^{-28}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5.49999999999999967e-28Initial program 83.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites45.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6431.1
Applied rewrites31.1%
if 5.49999999999999967e-28 < F Initial program 62.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.7%
Taylor expanded in F around inf
lower--.f6448.1
Applied rewrites48.1%
(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 77.0%
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 rewrites85.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites16.5%
Taylor expanded in B around 0
Applied rewrites9.9%
herbie shell --seed 2025092
(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))))))