
(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]
\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)}
Herbie found 23 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]
\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)}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1.65e+31)
(/ (- (* (/ -1.0 F) F) t_0) (sin B))
(if (<= F 1.32e+54)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(/ (- (* (/ 1.0 F) F) t_0) (sin B))))))double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1.65e+31) {
tmp = (((-1.0 / F) * F) - t_0) / sin(B);
} else if (F <= 1.32e+54) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = (((1.0 / F) * F) - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1.65e+31) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - t_0) / sin(B)); elseif (F <= 1.32e+54) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.65e+31], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.32e+54], 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] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.65 \cdot 10^{+31}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.32 \cdot 10^{+54}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\
\end{array}
if F < -1.65e31Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f6455.4%
Applied rewrites55.4%
if -1.65e31 < F < 1.3200000000000001e54Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.4%
Applied rewrites77.5%
if 1.3200000000000001e54 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f6447.4%
Applied rewrites47.4%
Applied rewrites55.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -0.0225)
(/ (- (* (/ -1.0 F) F) t_0) (sin B))
(if (<= F 39000.0)
(fma F (/ (pow (fma x 2.0 2.0) -0.5) (sin B)) (/ (- x) (tan B)))
(/ (- (* (/ 1.0 F) F) t_0) (sin B))))))double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -0.0225) {
tmp = (((-1.0 / F) * F) - t_0) / sin(B);
} else if (F <= 39000.0) {
tmp = fma(F, (pow(fma(x, 2.0, 2.0), -0.5) / sin(B)), (-x / tan(B)));
} else {
tmp = (((1.0 / F) * F) - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -0.0225) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - t_0) / sin(B)); elseif (F <= 39000.0) tmp = fma(F, Float64((fma(x, 2.0, 2.0) ^ -0.5) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - 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, -0.0225], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 39000.0], N[(F * N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -0.0225:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 39000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\
\end{array}
if F < -0.022499999999999999Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f6455.4%
Applied rewrites55.4%
if -0.022499999999999999 < F < 39000Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
lift-/.f64N/A
associate-*l/N/A
*-lft-identityN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-/.f64N/A
mult-flipN/A
lift-/.f64N/A
lift-neg.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
lift-neg.f64N/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in F around 0
Applied rewrites56.1%
if 39000 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f6447.4%
Applied rewrites47.4%
Applied rewrites55.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -0.0225)
(/ (- (* (/ -1.0 F) F) t_0) (sin B))
(if (<= F 2e-9)
(/ (- (* (pow (+ 2.0 (* 2.0 x)) -0.5) F) t_0) (sin B))
(/ (- (* (/ 1.0 F) F) t_0) (sin B))))))double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -0.0225) {
tmp = (((-1.0 / F) * F) - t_0) / sin(B);
} else if (F <= 2e-9) {
tmp = ((pow((2.0 + (2.0 * x)), -0.5) * F) - t_0) / sin(B);
} else {
tmp = (((1.0 / F) * F) - t_0) / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = cos(b) * x
if (f <= (-0.0225d0)) then
tmp = ((((-1.0d0) / f) * f) - t_0) / sin(b)
else if (f <= 2d-9) then
tmp = ((((2.0d0 + (2.0d0 * x)) ** (-0.5d0)) * f) - t_0) / sin(b)
else
tmp = (((1.0d0 / f) * f) - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.cos(B) * x;
double tmp;
if (F <= -0.0225) {
tmp = (((-1.0 / F) * F) - t_0) / Math.sin(B);
} else if (F <= 2e-9) {
tmp = ((Math.pow((2.0 + (2.0 * x)), -0.5) * F) - t_0) / Math.sin(B);
} else {
tmp = (((1.0 / F) * F) - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = math.cos(B) * x tmp = 0 if F <= -0.0225: tmp = (((-1.0 / F) * F) - t_0) / math.sin(B) elif F <= 2e-9: tmp = ((math.pow((2.0 + (2.0 * x)), -0.5) * F) - t_0) / math.sin(B) else: tmp = (((1.0 / F) * F) - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -0.0225) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - t_0) / sin(B)); elseif (F <= 2e-9) tmp = Float64(Float64(Float64((Float64(2.0 + Float64(2.0 * x)) ^ -0.5) * F) - t_0) / sin(B)); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = cos(B) * x; tmp = 0.0; if (F <= -0.0225) tmp = (((-1.0 / F) * F) - t_0) / sin(B); elseif (F <= 2e-9) tmp = ((((2.0 + (2.0 * x)) ^ -0.5) * F) - t_0) / sin(B); else tmp = (((1.0 / F) * F) - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -0.0225], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-9], N[(N[(N[(N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -0.0225:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\frac{{\left(2 + 2 \cdot x\right)}^{-0.5} \cdot F - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\
\end{array}
if F < -0.022499999999999999Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f6455.4%
Applied rewrites55.4%
if -0.022499999999999999 < F < 2.0000000000000001e-9Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in F around 0
lower-+.f64N/A
lower-*.f6455.7%
Applied rewrites55.7%
if 2.0000000000000001e-9 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f6447.4%
Applied rewrites47.4%
Applied rewrites55.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -4.2e-13)
(/ (- (* (/ -1.0 F) F) t_0) (sin B))
(if (<= F 1.8e-95)
(fma
(/ -1.0 (tan B))
x
(* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)))
(if (<= F 2e-9)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (sin B))
(/ (- (* (/ 1.0 F) F) t_0) (sin B)))))))double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -4.2e-13) {
tmp = (((-1.0 / F) * F) - t_0) / sin(B);
} else if (F <= 1.8e-95) {
tmp = fma((-1.0 / tan(B)), x, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)));
} else if (F <= 2e-9) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / sin(B);
} else {
tmp = (((1.0 / F) * F) - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -4.2e-13) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - t_0) / sin(B)); elseif (F <= 1.8e-95) tmp = fma(Float64(-1.0 / tan(B)), x, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B))); elseif (F <= 2e-9) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / sin(B)); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - 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, -4.2e-13], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-95], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-9], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -4.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-95}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B}\right)\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\
\end{array}
if F < -4.1999999999999998e-13Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f6455.4%
Applied rewrites55.4%
if -4.1999999999999998e-13 < F < 1.8000000000000001e-95Initial program 77.4%
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-/.f6477.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.4%
Applied rewrites77.4%
Taylor expanded in B around 0
Applied rewrites62.2%
if 1.8000000000000001e-95 < F < 2.0000000000000001e-9Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
Applied rewrites60.1%
if 2.0000000000000001e-9 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f6447.4%
Applied rewrites47.4%
Applied rewrites55.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -4.2e-13)
(/ (- (* (/ -1.0 F) F) t_0) (sin B))
(if (<= F 1.8e-95)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F B) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F 2e-9)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (sin B))
(/ (- (* (/ 1.0 F) F) t_0) (sin B)))))))double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -4.2e-13) {
tmp = (((-1.0 / F) * F) - t_0) / sin(B);
} else if (F <= 1.8e-95) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 2e-9) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / sin(B);
} else {
tmp = (((1.0 / F) * F) - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -4.2e-13) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - t_0) / sin(B)); elseif (F <= 1.8e-95) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); elseif (F <= 2e-9) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / sin(B)); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - 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, -4.2e-13], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-95], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $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], If[LessEqual[F, 2e-9], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -4.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-95}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - t\_0}{\sin B}\\
\end{array}
if F < -4.1999999999999998e-13Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f6455.4%
Applied rewrites55.4%
if -4.1999999999999998e-13 < F < 1.8000000000000001e-95Initial program 77.4%
Taylor expanded in B around 0
lower-/.f6462.2%
Applied rewrites62.2%
if 1.8000000000000001e-95 < F < 2.0000000000000001e-9Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
Applied rewrites60.1%
if 2.0000000000000001e-9 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f6447.4%
Applied rewrites47.4%
Applied rewrites55.5%
(FPCore (F B x)
:precision binary64
(if (<= F -4.2e-13)
(/ (- (* (/ -1.0 F) F) (* (cos B) x)) (sin B))
(if (<= F 1.8e-95)
(fma (/ -1.0 (tan B)) x (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)))
(if (<= F 9.5e+157)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (sin B))
(fma
F
(/ (/ 1.0 F) (sin B))
(/ (- x) (* B (+ 1.0 (* 0.3333333333333333 (pow B 2.0))))))))))double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e-13) {
tmp = (((-1.0 / F) * F) - (cos(B) * x)) / sin(B);
} else if (F <= 1.8e-95) {
tmp = fma((-1.0 / tan(B)), x, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)));
} else if (F <= 9.5e+157) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / sin(B);
} else {
tmp = fma(F, ((1.0 / F) / sin(B)), (-x / (B * (1.0 + (0.3333333333333333 * pow(B, 2.0))))));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.2e-13) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - Float64(cos(B) * x)) / sin(B)); elseif (F <= 1.8e-95) tmp = fma(Float64(-1.0 / tan(B)), x, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B))); elseif (F <= 9.5e+157) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / sin(B)); else tmp = fma(F, Float64(Float64(1.0 / F) / sin(B)), Float64(Float64(-x) / Float64(B * Float64(1.0 + Float64(0.3333333333333333 * (B ^ 2.0)))))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-13], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-95], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e+157], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[(B * N[(1.0 + N[(0.3333333333333333 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;F \leq -4.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-95}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B}\right)\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{+157}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, \frac{-x}{B \cdot \left(1 + 0.3333333333333333 \cdot {B}^{2}\right)}\right)\\
\end{array}
if F < -4.1999999999999998e-13Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f6455.4%
Applied rewrites55.4%
if -4.1999999999999998e-13 < F < 1.8000000000000001e-95Initial program 77.4%
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-/.f6477.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6477.4%
Applied rewrites77.4%
Taylor expanded in B around 0
Applied rewrites62.2%
if 1.8000000000000001e-95 < F < 9.4999999999999996e157Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
Applied rewrites60.1%
if 9.4999999999999996e157 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f6447.4%
Applied rewrites47.4%
metadata-eval47.4%
metadata-eval47.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
Applied rewrites51.9%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6432.3%
Applied rewrites32.3%
(FPCore (F B x)
:precision binary64
(if (<= x -8.2e-48)
(/ (- x) (/ 1.0 (/ 1.0 (tan B))))
(if (<= x 0.0135)
(/ (- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) x) (sin B))
(/ (- x) (tan B)))))double code(double F, double B, double x) {
double tmp;
if (x <= -8.2e-48) {
tmp = -x / (1.0 / (1.0 / tan(B)));
} else if (x <= 0.0135) {
tmp = ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) - x) / sin(B);
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -8.2e-48) tmp = Float64(Float64(-x) / Float64(1.0 / Float64(1.0 / tan(B)))); elseif (x <= 0.0135) tmp = Float64(Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) - x) / sin(B)); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -8.2e-48], N[((-x) / N[(1.0 / N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.0135], N[(N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{-48}:\\
\;\;\;\;\frac{-x}{\frac{1}{\frac{1}{\tan B}}}\\
\mathbf{elif}\;x \leq 0.0135:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
if x < -8.2000000000000003e-48Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flipN/A
lower-unsound-/.f32N/A
lower-/.f32N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lower-unsound-/.f64N/A
lower-/.f64N/A
lift-tan.f6455.9%
Applied rewrites55.9%
if -8.2000000000000003e-48 < x < 0.0135Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
lift-fma.f64N/A
add-flipN/A
*-commutativeN/A
lift-/.f64N/A
mult-flip-revN/A
lift-/.f64N/A
distribute-neg-fracN/A
lift-neg.f64N/A
remove-double-negN/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
div-flip-revN/A
associate-/l*N/A
lift-*.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
Applied rewrites60.1%
if 0.0135 < x Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (* -1.0 (/ x B))))
(if (<= F -2.2e-15)
(fma t_0 -1.0 t_1)
(if (<= F 2.9e-152)
(/ (- x) (tan B))
(if (<= F 2e-9)
(fma (pow (fma 2.0 x 2.0) -0.5) (/ F (sin B)) (/ (- x) B))
(fma t_0 1.0 t_1))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -1.0 * (x / B);
double tmp;
if (F <= -2.2e-15) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 2.9e-152) {
tmp = -x / tan(B);
} else if (F <= 2e-9) {
tmp = fma(pow(fma(2.0, x, 2.0), -0.5), (F / sin(B)), (-x / B));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-1.0 * Float64(x / B)) tmp = 0.0 if (F <= -2.2e-15) tmp = fma(t_0, -1.0, t_1); elseif (F <= 2.9e-152) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 2e-9) tmp = fma((fma(2.0, x, 2.0) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / B)); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e-15], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 2.9e-152], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-9], N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -1 \cdot \frac{x}{B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-152}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -2.1999999999999999e-15Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around -inf
Applied rewrites35.8%
if -2.1999999999999999e-15 < F < 2.9000000000000001e-152Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
if 2.9000000000000001e-152 < F < 2.0000000000000001e-9Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites36.6%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
lift-/.f64N/A
mult-flipN/A
lift-sin.f64N/A
lower-fma.f64N/A
lift-sin.f64N/A
lower-/.f6435.1%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-neg-fracN/A
Applied rewrites35.1%
if 2.0000000000000001e-9 < F Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (* -1.0 (/ x B))))
(if (<= F -2.2e-15)
(fma t_0 -1.0 t_1)
(if (<= F 1.82e-90)
(/ (- x) (tan B))
(if (<= F 2e-9)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(fma t_0 1.0 t_1))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -1.0 * (x / B);
double tmp;
if (F <= -2.2e-15) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 1.82e-90) {
tmp = -x / tan(B);
} else if (F <= 2e-9) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-1.0 * Float64(x / B)) tmp = 0.0 if (F <= -2.2e-15) tmp = fma(t_0, -1.0, t_1); elseif (F <= 1.82e-90) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 2e-9) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e-15], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.82e-90], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-9], 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[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -1 \cdot \frac{x}{B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -2.1999999999999999e-15Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around -inf
Applied rewrites35.8%
if -2.1999999999999999e-15 < F < 1.8199999999999999e-90Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
if 1.8199999999999999e-90 < F < 2.0000000000000001e-9Initial program 77.4%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.6%
if 2.0000000000000001e-9 < F Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (* -1.0 (/ x B))))
(if (<= F -2.2e-15)
(fma t_0 -1.0 t_1)
(if (<= F 1.82e-90)
(/ (- x) (tan B))
(if (<= F 2e-9)
(fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) t_1)
(fma t_0 1.0 t_1))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -1.0 * (x / B);
double tmp;
if (F <= -2.2e-15) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 1.82e-90) {
tmp = -x / tan(B);
} else if (F <= 2e-9) {
tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-1.0 * Float64(x / B)) tmp = 0.0 if (F <= -2.2e-15) tmp = fma(t_0, -1.0, t_1); elseif (F <= 1.82e-90) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 2e-9) tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e-15], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.82e-90], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-9], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -1 \cdot \frac{x}{B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-9}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -2.1999999999999999e-15Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around -inf
Applied rewrites35.8%
if -2.1999999999999999e-15 < F < 1.8199999999999999e-90Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
if 1.8199999999999999e-90 < F < 2.0000000000000001e-9Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites36.6%
Taylor expanded in B around 0
lower-/.f6429.9%
Applied rewrites29.9%
if 2.0000000000000001e-9 < F Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (/ 1.0 (sin B))) (t_2 (* -1.0 (/ x B))))
(if (<= F -2.2e-15)
(fma t_1 -1.0 t_2)
(if (<= F 1.82e-90)
t_0
(if (<= F 480000000000.0)
(fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) t_2)
(if (<= F 6.2e+186) 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 t_2 = -1.0 * (x / B);
double tmp;
if (F <= -2.2e-15) {
tmp = fma(t_1, -1.0, t_2);
} else if (F <= 1.82e-90) {
tmp = t_0;
} else if (F <= 480000000000.0) {
tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), t_2);
} else if (F <= 6.2e+186) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(1.0 / sin(B)) t_2 = Float64(-1.0 * Float64(x / B)) tmp = 0.0 if (F <= -2.2e-15) tmp = fma(t_1, -1.0, t_2); elseif (F <= 1.82e-90) tmp = t_0; elseif (F <= 480000000000.0) tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), t_2); elseif (F <= 6.2e+186) tmp = t_1; else tmp = 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]}, Block[{t$95$2 = N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e-15], N[(t$95$1 * -1.0 + t$95$2), $MachinePrecision], If[LessEqual[F, 1.82e-90], t$95$0, If[LessEqual[F, 480000000000.0], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[F, 6.2e+186], t$95$1, t$95$0]]]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
t_2 := -1 \cdot \frac{x}{B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -1, t\_2\right)\\
\mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 480000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, t\_2\right)\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -2.1999999999999999e-15Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around -inf
Applied rewrites35.8%
if -2.1999999999999999e-15 < F < 1.8199999999999999e-90 or 6.2000000000000002e186 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
if 1.8199999999999999e-90 < F < 4.8e11Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites36.6%
Taylor expanded in B around 0
lower-/.f6429.9%
Applied rewrites29.9%
if 4.8e11 < F < 6.2000000000000002e186Initial program 77.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8%
Applied rewrites16.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -3.4e+202)
(/ 1.0 (/ (tan B) (- x)))
(if (<= F -1.35e+18)
(/ -1.0 (sin B))
(if (<= F 1.82e-90)
t_0
(if (<= F 480000000000.0)
(fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) (* -1.0 (/ x B)))
(if (<= F 6.2e+186) (/ 1.0 (sin B)) t_0)))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -3.4e+202) {
tmp = 1.0 / (tan(B) / -x);
} else if (F <= -1.35e+18) {
tmp = -1.0 / sin(B);
} else if (F <= 1.82e-90) {
tmp = t_0;
} else if (F <= 480000000000.0) {
tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), (-1.0 * (x / B)));
} else if (F <= 6.2e+186) {
tmp = 1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -3.4e+202) tmp = Float64(1.0 / Float64(tan(B) / Float64(-x))); elseif (F <= -1.35e+18) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.82e-90) tmp = t_0; elseif (F <= 480000000000.0) tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), Float64(-1.0 * Float64(x / B))); elseif (F <= 6.2e+186) tmp = Float64(1.0 / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.4e+202], N[(1.0 / N[(N[Tan[B], $MachinePrecision] / (-x)), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.35e+18], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.82e-90], t$95$0, If[LessEqual[F, 480000000000.0], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e+186], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -3.4 \cdot 10^{+202}:\\
\;\;\;\;\frac{1}{\frac{\tan B}{-x}}\\
\mathbf{elif}\;F \leq -1.35 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 480000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -3.4000000000000001e202Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
lift-tan.f64N/A
lift-/.f64N/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
lift-tan.f6455.9%
Applied rewrites55.9%
if -3.4000000000000001e202 < F < -1.35e18Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
if -1.35e18 < F < 1.8199999999999999e-90 or 6.2000000000000002e186 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
if 1.8199999999999999e-90 < F < 4.8e11Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites36.6%
Taylor expanded in B around 0
lower-/.f6429.9%
Applied rewrites29.9%
if 4.8e11 < F < 6.2000000000000002e186Initial program 77.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8%
Applied rewrites16.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -3.4e+202)
t_0
(if (<= F -1.35e+18)
(/ -1.0 (sin B))
(if (<= F 1.82e-90)
t_0
(if (<= F 480000000000.0)
(fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) (* -1.0 (/ x B)))
(if (<= F 6.2e+186) (/ 1.0 (sin B)) t_0)))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -3.4e+202) {
tmp = t_0;
} else if (F <= -1.35e+18) {
tmp = -1.0 / sin(B);
} else if (F <= 1.82e-90) {
tmp = t_0;
} else if (F <= 480000000000.0) {
tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), (-1.0 * (x / B)));
} else if (F <= 6.2e+186) {
tmp = 1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -3.4e+202) tmp = t_0; elseif (F <= -1.35e+18) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.82e-90) tmp = t_0; elseif (F <= 480000000000.0) tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), Float64(-1.0 * Float64(x / B))); elseif (F <= 6.2e+186) tmp = Float64(1.0 / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.4e+202], t$95$0, If[LessEqual[F, -1.35e+18], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.82e-90], t$95$0, If[LessEqual[F, 480000000000.0], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e+186], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -3.4 \cdot 10^{+202}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -1.35 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.82 \cdot 10^{-90}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 480000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{+186}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -3.4000000000000001e202 or -1.35e18 < F < 1.8199999999999999e-90 or 6.2000000000000002e186 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
if -3.4000000000000001e202 < F < -1.35e18Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
if 1.8199999999999999e-90 < F < 4.8e11Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites36.6%
Taylor expanded in B around 0
lower-/.f6429.9%
Applied rewrites29.9%
if 4.8e11 < F < 6.2000000000000002e186Initial program 77.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8%
Applied rewrites16.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2.15)
(/ -1.0 (sin B))
(if (<= F 480000000000.0)
(fma (/ 1.0 B) (* (pow (fma 2.0 x 2.0) -0.5) F) (* -1.0 (/ x B)))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -2.15) {
tmp = -1.0 / sin(B);
} else if (F <= 480000000000.0) {
tmp = fma((1.0 / B), (pow(fma(2.0, x, 2.0), -0.5) * F), (-1.0 * (x / B)));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.15) tmp = Float64(-1.0 / sin(B)); elseif (F <= 480000000000.0) tmp = fma(Float64(1.0 / B), Float64((fma(2.0, x, 2.0) ^ -0.5) * F), Float64(-1.0 * Float64(x / B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.15], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 480000000000.0], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -2.15:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 480000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -2.1499999999999999Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
if -2.1499999999999999 < F < 4.8e11Initial program 77.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.0%
Applied rewrites58.0%
Taylor expanded in F around 0
Applied rewrites36.6%
Taylor expanded in B around 0
lower-/.f6429.9%
Applied rewrites29.9%
if 4.8e11 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8%
Applied rewrites16.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.06e+15) (/ -1.0 (sin B)) (if (<= F 480000000000.0) (* -1.0 (/ x (sin B))) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e+15) {
tmp = -1.0 / sin(B);
} else if (F <= 480000000000.0) {
tmp = -1.0 * (x / sin(B));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.06d+15)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 480000000000.0d0) then
tmp = (-1.0d0) * (x / sin(b))
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e+15) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 480000000000.0) {
tmp = -1.0 * (x / Math.sin(B));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.06e+15: tmp = -1.0 / math.sin(B) elif F <= 480000000000.0: tmp = -1.0 * (x / math.sin(B)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.06e+15) tmp = Float64(-1.0 / sin(B)); elseif (F <= 480000000000.0) tmp = Float64(-1.0 * Float64(x / sin(B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.06e+15) tmp = -1.0 / sin(B); elseif (F <= 480000000000.0) tmp = -1.0 * (x / sin(B)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.06e+15], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 480000000000.0], N[(-1.0 * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.06 \cdot 10^{+15}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 480000000000:\\
\;\;\;\;-1 \cdot \frac{x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -1.06e15Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
if -1.06e15 < F < 4.8e11Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
Taylor expanded in B around 0
Applied rewrites31.4%
if 4.8e11 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8%
Applied rewrites16.8%
(FPCore (F B x) :precision binary64 (if (<= F -40000000000000.0) (/ -1.0 (sin B)) (if (<= F 480000000000.0) (- (/ x B)) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -40000000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 480000000000.0) {
tmp = -(x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-40000000000000.0d0)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 480000000000.0d0) then
tmp = -(x / b)
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -40000000000000.0) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 480000000000.0) {
tmp = -(x / B);
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -40000000000000.0: tmp = -1.0 / math.sin(B) elif F <= 480000000000.0: tmp = -(x / B) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -40000000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 480000000000.0) tmp = Float64(-Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -40000000000000.0) tmp = -1.0 / sin(B); elseif (F <= 480000000000.0) tmp = -(x / B); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -40000000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 480000000000.0], (-N[(x / B), $MachinePrecision]), N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -40000000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 480000000000:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -4e13Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
if -4e13 < F < 4.8e11Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
Taylor expanded in B around 0
lower-/.f6429.1%
Applied rewrites29.1%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6429.1%
Applied rewrites29.1%
if 4.8e11 < F Initial program 77.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8%
Applied rewrites16.8%
(FPCore (F B x) :precision binary64 (if (<= F -40000000000000.0) (/ -1.0 (sin B)) (/ (fma -1.0 x (* 0.3333333333333333 (* (pow B 2.0) x))) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -40000000000000.0) {
tmp = -1.0 / sin(B);
} else {
tmp = fma(-1.0, x, (0.3333333333333333 * (pow(B, 2.0) * x))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -40000000000000.0) tmp = Float64(-1.0 / sin(B)); else tmp = Float64(fma(-1.0, x, Float64(0.3333333333333333 * Float64((B ^ 2.0) * x))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -40000000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * x + N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -40000000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\
\end{array}
if F < -4e13Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
if -4e13 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6429.1%
Applied rewrites29.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.26e+18) (/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0))))) (/ (fma -1.0 x (* 0.3333333333333333 (* (pow B 2.0) x))) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))));
} else {
tmp = fma(-1.0, x, (0.3333333333333333 * (pow(B, 2.0) * x))) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.26e+18) tmp = Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))); else tmp = Float64(fma(-1.0, x, Float64(0.3333333333333333 * Float64((B ^ 2.0) * x))) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * x + N[(0.3333333333333333 * N[(N[Power[B, 2.0], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-1, x, 0.3333333333333333 \cdot \left({B}^{2} \cdot x\right)\right)}{B}\\
\end{array}
if F < -1.26e18Initial program 77.4%
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.f6410.0%
Applied rewrites10.0%
if -1.26e18 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-pow.f6429.1%
Applied rewrites29.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.26e+18) (/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0))))) (/ (- x) (* B (+ 1.0 (* 0.3333333333333333 (pow B 2.0)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))));
} else {
tmp = -x / (B * (1.0 + (0.3333333333333333 * pow(B, 2.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) :: tmp
if (f <= (-1.26d+18)) then
tmp = (-1.0d0) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b ** 2.0d0))))
else
tmp = -x / (b * (1.0d0 + (0.3333333333333333d0 * (b ** 2.0d0))))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * Math.pow(B, 2.0))));
} else {
tmp = -x / (B * (1.0 + (0.3333333333333333 * Math.pow(B, 2.0))));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.26e+18: tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * math.pow(B, 2.0)))) else: tmp = -x / (B * (1.0 + (0.3333333333333333 * math.pow(B, 2.0)))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.26e+18) tmp = Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))); else tmp = Float64(Float64(-x) / Float64(B * Float64(1.0 + Float64(0.3333333333333333 * (B ^ 2.0))))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.26e+18) tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * (B ^ 2.0)))); else tmp = -x / (B * (1.0 + (0.3333333333333333 * (B ^ 2.0)))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(B * N[(1.0 + N[(0.3333333333333333 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B \cdot \left(1 + 0.3333333333333333 \cdot {B}^{2}\right)}\\
\end{array}
if F < -1.26e18Initial program 77.4%
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.f6410.0%
Applied rewrites10.0%
if -1.26e18 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
div-flip-revN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
mult-flip-revN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6456.0%
Applied rewrites56.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6429.0%
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.26e+18) (/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0))))) (- (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))));
} else {
tmp = -(x / B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.26d+18)) then
tmp = (-1.0d0) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b ** 2.0d0))))
else
tmp = -(x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * Math.pow(B, 2.0))));
} else {
tmp = -(x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.26e+18: tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * math.pow(B, 2.0)))) else: tmp = -(x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.26e+18) tmp = Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))); else tmp = Float64(-Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.26e+18) tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * (B ^ 2.0)))); else tmp = -(x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}
\mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\
\end{array}
if F < -1.26e18Initial program 77.4%
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.f6410.0%
Applied rewrites10.0%
if -1.26e18 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
Taylor expanded in B around 0
lower-/.f6429.1%
Applied rewrites29.1%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6429.1%
Applied rewrites29.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.26e+18) (/ (- (* -0.16666666666666666 (pow B 2.0)) 1.0) B) (- (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = ((-0.16666666666666666 * pow(B, 2.0)) - 1.0) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.26d+18)) then
tmp = (((-0.16666666666666666d0) * (b ** 2.0d0)) - 1.0d0) / b
else
tmp = -(x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = ((-0.16666666666666666 * Math.pow(B, 2.0)) - 1.0) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.26e+18: tmp = ((-0.16666666666666666 * math.pow(B, 2.0)) - 1.0) / B else: tmp = -(x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.26e+18) tmp = Float64(Float64(Float64(-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B); else tmp = Float64(-Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.26e+18) tmp = ((-0.16666666666666666 * (B ^ 2.0)) - 1.0) / B; else tmp = -(x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(N[(N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}
\mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
\;\;\;\;\frac{-0.16666666666666666 \cdot {B}^{2} - 1}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\
\end{array}
if F < -1.26e18Initial program 77.4%
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.8%
Applied rewrites9.8%
if -1.26e18 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
Taylor expanded in B around 0
lower-/.f6429.1%
Applied rewrites29.1%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6429.1%
Applied rewrites29.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.26e+18) (/ -1.0 B) (- (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = -1.0 / B;
} else {
tmp = -(x / B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.26d+18)) then
tmp = (-1.0d0) / b
else
tmp = -(x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.26e+18) {
tmp = -1.0 / B;
} else {
tmp = -(x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.26e+18: tmp = -1.0 / B else: tmp = -(x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.26e+18) tmp = Float64(-1.0 / B); else tmp = Float64(-Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.26e+18) tmp = -1.0 / B; else tmp = -(x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.26e+18], N[(-1.0 / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}
\mathbf{if}\;F \leq -1.26 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\
\end{array}
if F < -1.26e18Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.1%
if -1.26e18 < F Initial program 77.4%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6455.9%
Applied rewrites55.9%
Taylor expanded in B around 0
lower-/.f6429.1%
Applied rewrites29.1%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6429.1%
Applied rewrites29.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]
\frac{-1}{B}
Initial program 77.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2%
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.1%
herbie shell --seed 2025191
(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))))))