
(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 22 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 (/ 1.0 (sin B))))
(if (<= F -1.16e+24)
(fma (/ -1.0 (tan B)) x (* -1.0 t_0))
(if (<= F 42000000.0)
(+
(- (* (/ x (sin B)) (cos B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(- t_0 (/ x (tan B)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -1.16e+24) {
tmp = fma((-1.0 / tan(B)), x, (-1.0 * t_0));
} else if (F <= 42000000.0) {
tmp = -((x / sin(B)) * cos(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_0 - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -1.16e+24) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 * t_0)); elseif (F <= 42000000.0) tmp = Float64(Float64(-Float64(Float64(x / sin(B)) * cos(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(t_0 - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.16e+24], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 42000000.0], N[((-N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -1.16 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, -1 \cdot t\_0\right)\\
\mathbf{elif}\;F \leq 42000000:\\
\;\;\;\;\left(-\frac{x}{\sin B} \cdot \cos B\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.16000000000000005e24Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around -inf
Applied rewrites55.9%
if -1.16000000000000005e24 < F < 4.2e7Initial program 76.9%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f64N/A
lower-cos.f6476.9
Applied rewrites76.9%
if 4.2e7 < F Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-frac-negN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift-tan.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (/ 1.0 (sin B))))
(if (<= F -1.16e+24)
(fma (/ -1.0 (tan B)) x (* -1.0 t_1))
(if (<= F 42000000.0)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) t_0)
(- t_1 t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = 1.0 / sin(B);
double tmp;
if (F <= -1.16e+24) {
tmp = fma((-1.0 / tan(B)), x, (-1.0 * t_1));
} else if (F <= 42000000.0) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - t_0;
} else {
tmp = t_1 - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -1.16e+24) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 * t_1)); elseif (F <= 42000000.0) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - t_0); else tmp = Float64(t_1 - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.16e+24], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 42000000.0], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(t$95$1 - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -1.16 \cdot 10^{+24}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, -1 \cdot t\_1\right)\\
\mathbf{elif}\;F \leq 42000000:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\_0\\
\end{array}
\end{array}
if F < -1.16000000000000005e24Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around -inf
Applied rewrites55.9%
if -1.16000000000000005e24 < F < 4.2e7Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6476.9
Applied rewrites77.0%
if 4.2e7 < F Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-frac-negN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift-tan.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -370000000.0)
(fma (/ -1.0 (tan B)) x (* -1.0 t_0))
(if (<= F 0.00031)
(fma F (/ (pow (fma 2.0 x 2.0) -0.5) (sin B)) (/ (- x) (tan B)))
(- t_0 (/ x (tan B)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -370000000.0) {
tmp = fma((-1.0 / tan(B)), x, (-1.0 * t_0));
} else if (F <= 0.00031) {
tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / sin(B)), (-x / tan(B)));
} else {
tmp = t_0 - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -370000000.0) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 * t_0)); elseif (F <= 0.00031) tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(t_0 - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -370000000.0], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 * t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00031], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -370000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, -1 \cdot t\_0\right)\\
\mathbf{elif}\;F \leq 0.00031:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -3.7e8Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around -inf
Applied rewrites55.9%
if -3.7e8 < F < 3.1e-4Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in F around 0
Applied rewrites56.3%
if 3.1e-4 < F Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-frac-negN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift-tan.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B)))
(t_1 (pow (fma x 2.0 (fma F F 2.0)) -0.5))
(t_2 (/ 1.0 (sin B))))
(if (<= F -370000.0)
(fma (/ -1.0 (tan B)) x (* -1.0 t_2))
(if (<= F -3.2e-58)
(fma (/ -1.0 B) x (/ t_1 (/ (sin B) F)))
(if (<= F 920000.0) (- (* (/ F B) t_1) t_0) (- t_2 t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5);
double t_2 = 1.0 / sin(B);
double tmp;
if (F <= -370000.0) {
tmp = fma((-1.0 / tan(B)), x, (-1.0 * t_2));
} else if (F <= -3.2e-58) {
tmp = fma((-1.0 / B), x, (t_1 / (sin(B) / F)));
} else if (F <= 920000.0) {
tmp = ((F / B) * t_1) - t_0;
} else {
tmp = t_2 - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5 t_2 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -370000.0) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 * t_2)); elseif (F <= -3.2e-58) tmp = fma(Float64(-1.0 / B), x, Float64(t_1 / Float64(sin(B) / F))); elseif (F <= 920000.0) tmp = Float64(Float64(Float64(F / B) * t_1) - t_0); else tmp = Float64(t_2 - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$2 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -370000.0], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 * t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.2e-58], N[(N[(-1.0 / B), $MachinePrecision] * x + N[(t$95$1 / N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 920000.0], N[(N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision] - t$95$0), $MachinePrecision], N[(t$95$2 - t$95$0), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_2 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -370000:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, -1 \cdot t\_2\right)\\
\mathbf{elif}\;F \leq -3.2 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{B}, x, \frac{t\_1}{\frac{\sin B}{F}}\right)\\
\mathbf{elif}\;F \leq 920000:\\
\;\;\;\;\frac{F}{B} \cdot t\_1 - t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2 - t\_0\\
\end{array}
\end{array}
if F < -3.7e5Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around -inf
Applied rewrites55.9%
if -3.7e5 < F < -3.2000000000000001e-58Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
div-flipN/A
mult-flip-revN/A
lower-/.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6477.7
Applied rewrites77.7%
Taylor expanded in B around 0
Applied rewrites50.5%
if -3.2000000000000001e-58 < F < 9.2e5Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.0
Applied rewrites62.0%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.1%
if 9.2e5 < F Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-frac-negN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift-tan.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(if (<= F -3.05e+161)
(fma F (/ -1.0 (* F (sin B))) (* -1.0 (/ x B)))
(if (<= F 920000.0)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) B) (/ (- x) (tan B)))
(- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.05e+161) {
tmp = fma(F, (-1.0 / (F * sin(B))), (-1.0 * (x / B)));
} else if (F <= 920000.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / B), (-x / tan(B)));
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.05e+161) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), Float64(-1.0 * Float64(x / B))); elseif (F <= 920000.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / B), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.05e+161], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 920000.0], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.05 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 920000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -3.0500000000000001e161Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6434.7
Applied rewrites34.7%
if -3.0500000000000001e161 < F < 9.2e5Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
Applied rewrites70.3%
if 9.2e5 < F Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
lift-fma.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*l/N/A
mul-1-negN/A
distribute-frac-negN/A
sub-flip-reverseN/A
lower--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lower-/.f64N/A
lift-tan.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (* x (/ 1.0 (tan B))))
(*
(/ F (sin B))
(pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(t_1 (* -1.0 (/ x B)))
(t_2 (pow (fma 2.0 x (fma F F 2.0)) -0.5))
(t_3 (fma F (/ t_2 B) (/ (- x) (tan B)))))
(if (<= t_0 -1000.0)
t_3
(if (<= t_0 2.0)
(fma F (/ t_2 (sin B)) t_1)
(if (<= t_0 INFINITY) t_3 (fma F (/ -1.0 (* F (sin B))) t_1))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
double t_1 = -1.0 * (x / B);
double t_2 = pow(fma(2.0, x, fma(F, F, 2.0)), -0.5);
double t_3 = fma(F, (t_2 / B), (-x / tan(B)));
double tmp;
if (t_0 <= -1000.0) {
tmp = t_3;
} else if (t_0 <= 2.0) {
tmp = fma(F, (t_2 / sin(B)), t_1);
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_3;
} else {
tmp = fma(F, (-1.0 / (F * sin(B))), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = 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))))) t_1 = Float64(-1.0 * Float64(x / B)) t_2 = fma(2.0, x, fma(F, F, 2.0)) ^ -0.5 t_3 = fma(F, Float64(t_2 / B), Float64(Float64(-x) / tan(B))) tmp = 0.0 if (t_0 <= -1000.0) tmp = t_3; elseif (t_0 <= 2.0) tmp = fma(F, Float64(t_2 / sin(B)), t_1); elseif (t_0 <= Inf) tmp = t_3; else tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(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]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$3 = N[(F * N[(t$95$2 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1000.0], t$95$3, If[LessEqual[t$95$0, 2.0], N[(F * N[(t$95$2 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$0, Infinity], t$95$3, N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)}\\
t_1 := -1 \cdot \frac{x}{B}\\
t_2 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}\\
t_3 := \mathsf{fma}\left(F, \frac{t\_2}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{if}\;t\_0 \leq -1000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{t\_2}{\sin B}, t\_1\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, t\_1\right)\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1e3 or 2 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
Applied rewrites70.3%
if -1e3 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
if +inf.0 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6434.7
Applied rewrites34.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (* x (/ 1.0 (tan B))))
(*
(/ F (sin B))
(pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(t_1 (* -1.0 (/ x B)))
(t_2
(- (* (/ F B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x (tan B)))))
(if (<= t_0 -1000.0)
t_2
(if (<= t_0 2.0)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_1)
(if (<= t_0 INFINITY) t_2 (fma F (/ -1.0 (* F (sin B))) t_1))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
double t_1 = -1.0 * (x / B);
double t_2 = ((F / B) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / tan(B));
double tmp;
if (t_0 <= -1000.0) {
tmp = t_2;
} else if (t_0 <= 2.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_1);
} else if (t_0 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = fma(F, (-1.0 / (F * sin(B))), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = 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))))) t_1 = Float64(-1.0 * Float64(x / B)) t_2 = Float64(Float64(Float64(F / B) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / tan(B))) tmp = 0.0 if (t_0 <= -1000.0) tmp = t_2; elseif (t_0 <= 2.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_1); elseif (t_0 <= Inf) tmp = t_2; else tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(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]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1000.0], t$95$2, If[LessEqual[t$95$0, 2.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] + t$95$1), $MachinePrecision], If[LessEqual[t$95$0, Infinity], t$95$2, N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \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)}\\
t_1 := -1 \cdot \frac{x}{B}\\
t_2 := \frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -1000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_0 \leq 2:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_1\right)\\
\mathbf{elif}\;t\_0 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, t\_1\right)\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1e3 or 2 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.0
Applied rewrites62.0%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.1%
if -1e3 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
if +inf.0 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6434.7
Applied rewrites34.7%
(FPCore (F B x)
:precision binary64
(if (<= x -1.95e-10)
(fma (/ -1.0 (tan B)) x (* 1.0 (/ 1.0 B)))
(if (<= x 7.2e-9)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (* -1.0 (/ x B)))
(* -1.0 (/ (* x (cos B)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.95e-10) {
tmp = fma((-1.0 / tan(B)), x, (1.0 * (1.0 / B)));
} else if (x <= 7.2e-9) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-1.0 * (x / B)));
} else {
tmp = -1.0 * ((x * cos(B)) / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.95e-10) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 * Float64(1.0 / B))); elseif (x <= 7.2e-9) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(-1.0 * Float64(x / B))); else tmp = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.95e-10], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.2e-9], 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[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, 1 \cdot \frac{1}{B}\right)\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if x < -1.95e-10Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
Taylor expanded in B around 0
lower-/.f6454.0
Applied rewrites54.0%
if -1.95e-10 < x < 7.2e-9Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
if 7.2e-9 < x Initial program 76.9%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.8
Applied rewrites55.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma (/ -1.0 (tan B)) x (* 1.0 (/ 1.0 B)))))
(if (<= x -1.95e-10)
t_0
(if (<= x 1.22)
(fma
F
(/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B))
(* -1.0 (/ x B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = fma((-1.0 / tan(B)), x, (1.0 * (1.0 / B)));
double tmp;
if (x <= -1.95e-10) {
tmp = t_0;
} else if (x <= 1.22) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-1.0 * (x / B)));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 * Float64(1.0 / B))) tmp = 0.0 if (x <= -1.95e-10) tmp = t_0; elseif (x <= 1.22) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(-1.0 * Float64(x / B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e-10], t$95$0, If[LessEqual[x, 1.22], 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[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{-1}{\tan B}, x, 1 \cdot \frac{1}{B}\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{-10}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.22:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.95e-10 or 1.21999999999999997 < x Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
Taylor expanded in B around 0
lower-/.f6454.0
Applied rewrites54.0%
if -1.95e-10 < x < 1.21999999999999997Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma (/ -1.0 (tan B)) x (* 1.0 (/ 1.0 B)))))
(if (<= x -1.4e-11)
t_0
(if (<= x 0.0057)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) (/ (- x) B))
t_0))))
double code(double F, double B, double x) {
double t_0 = fma((-1.0 / tan(B)), x, (1.0 * (1.0 / B)));
double tmp;
if (x <= -1.4e-11) {
tmp = t_0;
} else if (x <= 0.0057) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 * Float64(1.0 / B))) tmp = 0.0 if (x <= -1.4e-11) tmp = t_0; elseif (x <= 0.0057) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.4e-11], t$95$0, If[LessEqual[x, 0.0057], 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) / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{-1}{\tan B}, x, 1 \cdot \frac{1}{B}\right)\\
\mathbf{if}\;x \leq -1.4 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.0057:\\
\;\;\;\;\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}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.4e-11 or 0.0057000000000000002 < x Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
Taylor expanded in B around 0
lower-/.f6454.0
Applied rewrites54.0%
if -1.4e-11 < x < 0.0057000000000000002Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
lift-fma.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lift-sin.f64N/A
lower-fma.f64N/A
lift-sin.f64N/A
lower-/.f6449.8
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lift-*.f64N/A
lower-/.f6449.8
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6449.8
Applied rewrites49.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ x B))))
(if (<= F -370000000.0)
(fma F (/ -1.0 (* F (sin B))) t_0)
(if (<= F 9e-5)
(fma F (/ (pow (fma 2.0 x 2.0) -0.5) (sin B)) t_0)
(fma (/ -1.0 (tan B)) x (* 1.0 (/ 1.0 B)))))))
double code(double F, double B, double x) {
double t_0 = -1.0 * (x / B);
double tmp;
if (F <= -370000000.0) {
tmp = fma(F, (-1.0 / (F * sin(B))), t_0);
} else if (F <= 9e-5) {
tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / sin(B)), t_0);
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 * (1.0 / B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 * Float64(x / B)) tmp = 0.0 if (F <= -370000000.0) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), t_0); elseif (F <= 9e-5) tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / sin(B)), t_0); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 * Float64(1.0 / B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -370000000.0], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 9e-5], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 \cdot \frac{x}{B}\\
\mathbf{if}\;F \leq -370000000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, 1 \cdot \frac{1}{B}\right)\\
\end{array}
\end{array}
if F < -3.7e8Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6434.7
Applied rewrites34.7%
if -3.7e8 < F < 9.00000000000000057e-5Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites37.2%
if 9.00000000000000057e-5 < F Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
Taylor expanded in B around 0
lower-/.f6454.0
Applied rewrites54.0%
(FPCore (F B x) :precision binary64 (if (<= B 90000.0) (/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B) (- (* (/ F B) (/ 1.0 F)) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 90000.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = ((F / B) * (1.0 / F)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 90000.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = Float64(Float64(Float64(F / B) * Float64(1.0 / F)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 90000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 90000:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{1}{F} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 9e4Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
if 9e4 < B Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.0
Applied rewrites62.0%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.1%
Taylor expanded in F around inf
lower-/.f6446.4
Applied rewrites46.4%
(FPCore (F B x) :precision binary64 (if (<= B 90000.0) (/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B) (fma (/ -1.0 (tan B)) x (* 1.0 (/ 1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 90000.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 * (1.0 / B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 90000.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 * Float64(1.0 / B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 90000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 90000:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, 1 \cdot \frac{1}{B}\right)\\
\end{array}
\end{array}
if B < 9e4Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
if 9e4 < B Initial program 76.9%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6476.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6485.1
Applied rewrites85.1%
Taylor expanded in F around inf
Applied rewrites56.3%
Taylor expanded in B around 0
lower-/.f6454.0
Applied rewrites54.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))) (t_1 (* -1.0 (/ x B))))
(if (<= F -6.3e-18)
(fma F (/ -1.0 t_0) t_1)
(if (<= F 920000.0)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma F (/ 1.0 t_0) t_1)))))
double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = -1.0 * (x / B);
double tmp;
if (F <= -6.3e-18) {
tmp = fma(F, (-1.0 / t_0), t_1);
} else if (F <= 920000.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma(F, (1.0 / t_0), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(-1.0 * Float64(x / B)) tmp = 0.0 if (F <= -6.3e-18) tmp = fma(F, Float64(-1.0 / t_0), t_1); elseif (F <= 920000.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(F, Float64(1.0 / t_0), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6.3e-18], N[(F * N[(-1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 920000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(F * N[(1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := -1 \cdot \frac{x}{B}\\
\mathbf{if}\;F \leq -6.3 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{t\_0}, t\_1\right)\\
\mathbf{elif}\;F \leq 920000:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_0}, t\_1\right)\\
\end{array}
\end{array}
if F < -6.3000000000000004e-18Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6434.7
Applied rewrites34.7%
if -6.3000000000000004e-18 < F < 9.2e5Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
if 9.2e5 < F Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6432.4
Applied rewrites32.4%
(FPCore (F B x)
:precision binary64
(if (<= F -6.3e-18)
(fma F (/ -1.0 (* F (sin B))) (* -1.0 (/ x B)))
(if (<= F 6600000.0)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.3e-18) {
tmp = fma(F, (-1.0 / (F * sin(B))), (-1.0 * (x / B)));
} else if (F <= 6600000.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.3e-18) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), Float64(-1.0 * Float64(x / B))); elseif (F <= 6600000.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.3e-18], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6600000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.3 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 6600000:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -6.3000000000000004e-18Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6434.7
Applied rewrites34.7%
if -6.3000000000000004e-18 < F < 6.6e6Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
if 6.6e6 < F Initial program 76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.9
Applied rewrites16.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.4e+153)
(/ -1.0 (sin B))
(if (<= F 6600000.0)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e+153) {
tmp = -1.0 / sin(B);
} else if (F <= 6600000.0) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.4e+153) tmp = Float64(-1.0 / sin(B)); elseif (F <= 6600000.0) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.4e+153], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6600000.0], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.4 \cdot 10^{+153}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6600000:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.3999999999999997e153Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -3.3999999999999997e153 < F < 6.6e6Initial program 76.9%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
if 6.6e6 < F Initial program 76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.9
Applied rewrites16.9%
(FPCore (F B x)
:precision binary64
(if (<= F -6.3e-18)
(/ -1.0 (sin B))
(if (<= F 6600000.0)
(- (* (/ F B) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x B))
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.3e-18) {
tmp = -1.0 / sin(B);
} else if (F <= 6600000.0) {
tmp = ((F / B) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.3e-18) tmp = Float64(-1.0 / sin(B)); elseif (F <= 6600000.0) tmp = Float64(Float64(Float64(F / B) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.3e-18], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6600000.0], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.3 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6600000:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -6.3000000000000004e-18Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -6.3000000000000004e-18 < F < 6.6e6Initial program 76.9%
Taylor expanded in B around 0
lower-/.f6462.0
Applied rewrites62.0%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f64N/A
lower--.f64N/A
Applied rewrites62.1%
Taylor expanded in B around 0
Applied rewrites35.7%
if 6.6e6 < F Initial program 76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.9
Applied rewrites16.9%
(FPCore (F B x) :precision binary64 (if (<= F -3.4e-22) (/ -1.0 (sin B)) (/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.4e-22) {
tmp = -1.0 / sin(B);
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.4e-22) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.4e-22], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.4 \cdot 10^{-22}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
\end{array}
if F < -3.3999999999999998e-22Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -3.3999999999999998e-22 < F Initial program 76.9%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.7
Applied rewrites47.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.7
Applied rewrites28.7%
(FPCore (F B x) :precision binary64 (if (<= F -215.0) (/ (- (* -0.16666666666666666 (pow B 2.0)) 1.0) B) (/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -215.0) {
tmp = ((-0.16666666666666666 * pow(B, 2.0)) - 1.0) / B;
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -215.0) tmp = Float64(Float64(Float64(-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -215.0], N[(N[(N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -215:\\
\;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
\end{array}
if F < -215Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f649.9
Applied rewrites9.9%
if -215 < F Initial program 76.9%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.7
Applied rewrites47.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.7
Applied rewrites28.7%
(FPCore (F B x) :precision binary64 (if (<= F -3100000000.0) (/ -1.0 B) (/ (* F (fma -1.0 (/ x F) (/ 1.0 F))) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3100000000.0) {
tmp = -1.0 / B;
} else {
tmp = (F * fma(-1.0, (x / F), (1.0 / F))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3100000000.0) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(F * fma(-1.0, Float64(x / F), Float64(1.0 / F))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3100000000.0], N[(-1.0 / B), $MachinePrecision], N[(N[(F * N[(-1.0 * N[(x / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3100000000:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \mathsf{fma}\left(-1, \frac{x}{F}, \frac{1}{F}\right)}{B}\\
\end{array}
\end{array}
if F < -3.1e9Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.2%
if -3.1e9 < F Initial program 76.9%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.7
Applied rewrites47.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.7
Applied rewrites28.7%
(FPCore (F B x) :precision binary64 (if (<= F -3100000000.0) (/ -1.0 B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3100000000.0) {
tmp = -1.0 / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3100000000.0d0)) then
tmp = (-1.0d0) / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3100000000.0) {
tmp = -1.0 / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3100000000.0: tmp = -1.0 / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3100000000.0) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3100000000.0) tmp = -1.0 / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3100000000.0], N[(-1.0 / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3100000000:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.1e9Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.2%
if -3.1e9 < F Initial program 76.9%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.7
Applied rewrites47.7%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
Applied rewrites48.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6429.7
Applied rewrites29.7%
lift-+.f64N/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6429.7
Applied rewrites29.7%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 76.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.2%
herbie shell --seed 2025150
(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))))))