
(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 33 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(if (<= F -1000000000.0)
(fma F (/ (/ -1.0 F) (sin B)) (/ (- x) (tan B)))
(if (<= F 1.35e+25)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1000000000.0) {
tmp = fma(F, ((-1.0 / F) / sin(B)), (-x / tan(B)));
} else if (F <= 1.35e+25) {
tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1000000000.0) tmp = fma(F, Float64(Float64(-1.0 / F) / sin(B)), Float64(Float64(-x) / tan(B))); elseif (F <= 1.35e+25) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1000000000.0], N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e+25], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[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[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1000000000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{-1}{F}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+25}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1e9Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-/l*N/A
Applied rewrites55.2%
if -1e9 < F < 1.35e25Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
if 1.35e25 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(if (<= F -70000000.0)
(fma F (/ (/ -1.0 F) (sin B)) (/ (- x) (tan B)))
(if (<= F 5e+23)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (fma F F 2.0) -0.5)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -70000000.0) {
tmp = fma(F, ((-1.0 / F) / sin(B)), (-x / tan(B)));
} else if (F <= 5e+23) {
tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -70000000.0) tmp = fma(F, Float64(Float64(-1.0 / F) / sin(B)), Float64(Float64(-x) / tan(B))); elseif (F <= 5e+23) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (fma(F, F, 2.0) ^ -0.5))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -70000000.0], N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e+23], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -70000000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{-1}{F}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+23}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -7e7Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-/l*N/A
Applied rewrites55.2%
if -7e7 < F < 4.9999999999999999e23Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
if 4.9999999999999999e23 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1.52)
(fma F (/ (/ -1.0 F) (sin B)) (/ (- x) (tan B)))
(if (<= F 1.65)
(/ (- (* (pow (fma 2.0 x 2.0) -0.5) F) t_0) (sin B))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1.52) {
tmp = fma(F, ((-1.0 / F) / sin(B)), (-x / tan(B)));
} else if (F <= 1.65) {
tmp = ((pow(fma(2.0, x, 2.0), -0.5) * F) - t_0) / sin(B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1.52) tmp = fma(F, Float64(Float64(-1.0 / F) / sin(B)), Float64(Float64(-x) / tan(B))); elseif (F <= 1.65) tmp = Float64(Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * F) - t_0) / sin(B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.52], N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65], N[(N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.52:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{-1}{F}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.65:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1.52Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-/l*N/A
Applied rewrites55.2%
if -1.52 < F < 1.6499999999999999Initial program 76.2%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
sub-divN/A
lower-/.f64N/A
Applied rewrites55.2%
if 1.6499999999999999 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.182)
(fma F (/ (/ -1.0 F) (sin B)) (/ (- x) (tan B)))
(if (<= F 1700.0)
(+
(- (/ (* x 1.0) (tan B)))
(/ (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) B))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.182) {
tmp = fma(F, ((-1.0 / F) / sin(B)), (-x / tan(B)));
} else if (F <= 1700.0) {
tmp = -((x * 1.0) / tan(B)) + ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) / B);
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.182) tmp = fma(F, Float64(Float64(-1.0 / F) / sin(B)), Float64(Float64(-x) / tan(B))); elseif (F <= 1700.0) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) / B)); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.182], N[(F * N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1700.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\frac{-1}{F}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1700:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-sin.f64N/A
associate-/l*N/A
Applied rewrites55.2%
if -0.182 < F < 1700Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites70.0%
if 1700 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -0.182)
(- (* (/ (+ 1.0 t_0) (* (sin B) F)) F))
(if (<= F 1700.0)
(+
(- (/ (* x 1.0) (tan B)))
(/ (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) B))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -0.182) {
tmp = -(((1.0 + t_0) / (sin(B) * F)) * F);
} else if (F <= 1700.0) {
tmp = -((x * 1.0) / tan(B)) + ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) / B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -0.182) tmp = Float64(-Float64(Float64(Float64(1.0 + t_0) / Float64(sin(B) * F)) * F)); elseif (F <= 1700.0) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) / B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -0.182], (-N[(N[(N[(1.0 + t$95$0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, 1700.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B \cdot F} \cdot F\\
\mathbf{elif}\;F \leq 1700:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6450.7
Applied rewrites50.7%
if -0.182 < F < 1700Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites70.0%
if 1700 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(if (<= F -2.6e+92)
(+ (- (/ x B)) (/ (* F (/ -1.0 F)) (sin B)))
(if (<= F 1700.0)
(+
(- (/ (* x 1.0) (tan B)))
(/ (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) B))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e+92) {
tmp = -(x / B) + ((F * (-1.0 / F)) / sin(B));
} else if (F <= 1700.0) {
tmp = -((x * 1.0) / tan(B)) + ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) / B);
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.6e+92) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(-1.0 / F)) / sin(B))); elseif (F <= 1700.0) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) / B)); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.6e+92], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1700.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+92}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \frac{-1}{F}}{\sin B}\\
\mathbf{elif}\;F \leq 1700:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.5999999999999999e92Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
Taylor expanded in B around 0
lower-/.f6437.0
Applied rewrites37.0%
if -2.5999999999999999e92 < F < 1700Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites70.0%
if 1700 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(if (<= F -2.6e+92)
(+ (- (/ x B)) (/ (* F (/ -1.0 F)) (sin B)))
(if (<= F 1700.0)
(+
(- (* x (/ 1.0 (tan B))))
(/ (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) B))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.6e+92) {
tmp = -(x / B) + ((F * (-1.0 / F)) / sin(B));
} else if (F <= 1700.0) {
tmp = -(x * (1.0 / tan(B))) + ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) / B);
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.6e+92) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(-1.0 / F)) / sin(B))); elseif (F <= 1700.0) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) / B)); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.6e+92], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1700.0], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.6 \cdot 10^{+92}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \frac{-1}{F}}{\sin B}\\
\mathbf{elif}\;F \leq 1700:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.5999999999999999e92Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
Taylor expanded in B around 0
lower-/.f6437.0
Applied rewrites37.0%
if -2.5999999999999999e92 < F < 1700Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites69.9%
if 1700 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x))
(t_1 (- (/ x B)))
(t_2 (+ t_1 (* (/ F (sin B)) (pow (fma F F 2.0) -0.5)))))
(if (<= F -200000000.0)
(+ t_1 (/ (* F (/ -1.0 F)) (sin B)))
(if (<= F -3.7e-227)
t_2
(if (<= F 3.8e-130)
(- (/ t_0 (sin B)))
(if (<= F 24000.0) t_2 (/ (- 1.0 t_0) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double t_1 = -(x / B);
double t_2 = t_1 + ((F / sin(B)) * pow(fma(F, F, 2.0), -0.5));
double tmp;
if (F <= -200000000.0) {
tmp = t_1 + ((F * (-1.0 / F)) / sin(B));
} else if (F <= -3.7e-227) {
tmp = t_2;
} else if (F <= 3.8e-130) {
tmp = -(t_0 / sin(B));
} else if (F <= 24000.0) {
tmp = t_2;
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) t_1 = Float64(-Float64(x / B)) t_2 = Float64(t_1 + Float64(Float64(F / sin(B)) * (fma(F, F, 2.0) ^ -0.5))) tmp = 0.0 if (F <= -200000000.0) tmp = Float64(t_1 + Float64(Float64(F * Float64(-1.0 / F)) / sin(B))); elseif (F <= -3.7e-227) tmp = t_2; elseif (F <= 3.8e-130) tmp = Float64(-Float64(t_0 / sin(B))); elseif (F <= 24000.0) tmp = t_2; else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$2 = N[(t$95$1 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -200000000.0], N[(t$95$1 + N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.7e-227], t$95$2, If[LessEqual[F, 3.8e-130], (-N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 24000.0], t$95$2, N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
t_1 := -\frac{x}{B}\\
t_2 := t\_1 + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{if}\;F \leq -200000000:\\
\;\;\;\;t\_1 + \frac{F \cdot \frac{-1}{F}}{\sin B}\\
\mathbf{elif}\;F \leq -3.7 \cdot 10^{-227}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-130}:\\
\;\;\;\;-\frac{t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 24000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2e8Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
Taylor expanded in B around 0
lower-/.f6437.0
Applied rewrites37.0%
if -2e8 < F < -3.69999999999999978e-227 or 3.7999999999999998e-130 < F < 24000Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
if -3.69999999999999978e-227 < F < 3.7999999999999998e-130Initial program 76.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if 24000 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in F around 0
sub-divN/A
lower-/.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-cos.f64N/A
lift-*.f64N/A
lift-sin.f6456.3
Applied rewrites56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (* (cos B) x) (sin B)))))
(if (<= x -1.05e-11)
t_0
(if (<= x 4.25e-38)
(+ (- (/ x B)) (* (/ F (sin B)) (pow (fma F F 2.0) -0.5)))
t_0))))
double code(double F, double B, double x) {
double t_0 = -((cos(B) * x) / sin(B));
double tmp;
if (x <= -1.05e-11) {
tmp = t_0;
} else if (x <= 4.25e-38) {
tmp = -(x / B) + ((F / sin(B)) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(Float64(cos(B) * x) / sin(B))) tmp = 0.0 if (x <= -1.05e-11) tmp = t_0; elseif (x <= 4.25e-38) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (fma(F, F, 2.0) ^ -0.5))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -1.05e-11], t$95$0, If[LessEqual[x, 4.25e-38], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{\cos B \cdot x}{\sin B}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.25 \cdot 10^{-38}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.0499999999999999e-11 or 4.25000000000000023e-38 < x Initial program 76.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
if -1.0499999999999999e-11 < x < 4.25000000000000023e-38Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= x -1.46e-5)
(+ t_0 (* (/ F B) (/ -1.0 F)))
(if (<= x 4.1e-34)
(+ (- (/ x B)) (* (/ F (sin B)) (pow (fma F F 2.0) -0.5)))
(+
t_0
(* (/ F (* (fma (* B B) -0.16666666666666666 1.0) B)) (/ -1.0 F)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (x <= -1.46e-5) {
tmp = t_0 + ((F / B) * (-1.0 / F));
} else if (x <= 4.1e-34) {
tmp = -(x / B) + ((F / sin(B)) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = t_0 + ((F / (fma((B * B), -0.16666666666666666, 1.0) * B)) * (-1.0 / F));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (x <= -1.46e-5) tmp = Float64(t_0 + Float64(Float64(F / B) * Float64(-1.0 / F))); elseif (x <= 4.1e-34) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (fma(F, F, 2.0) ^ -0.5))); else tmp = Float64(t_0 + Float64(Float64(F / Float64(fma(Float64(B * B), -0.16666666666666666, 1.0) * B)) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -1.46e-5], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.1e-34], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(F / N[(N[(N[(B * B), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;x \leq -1.46 \cdot 10^{-5}:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \frac{-1}{F}\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{-34}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{F}{\mathsf{fma}\left(B \cdot B, -0.16666666666666666, 1\right) \cdot B} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if x < -1.46000000000000008e-5Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in B around 0
lower-/.f6447.0
Applied rewrites47.0%
if -1.46000000000000008e-5 < x < 4.1000000000000004e-34Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
if 4.1000000000000004e-34 < x Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6447.9
Applied rewrites47.9%
(FPCore (F B x)
:precision binary64
(if (<= B 80000.0)
(/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F (* (fma (* B B) -0.16666666666666666 1.0) B)) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 80000.0) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + ((F / (fma((B * B), -0.16666666666666666, 1.0) * B)) * (-1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 80000.0) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / Float64(fma(Float64(B * B), -0.16666666666666666, 1.0) * B)) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 80000.0], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[(N[(N[(B * B), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 80000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\mathsf{fma}\left(B \cdot B, -0.16666666666666666, 1\right) \cdot B} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if B < 8e4Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
if 8e4 < B Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6447.9
Applied rewrites47.9%
(FPCore (F B x) :precision binary64 (if (<= B 80000.0) (/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B) (+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 80000.0) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * (-1.0 / F));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 80000.0) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 80000.0], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 80000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot \frac{-1}{F}\\
\end{array}
\end{array}
if B < 8e4Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
if 8e4 < B Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
Taylor expanded in B around 0
lower-/.f6447.0
Applied rewrites47.0%
(FPCore (F B x)
:precision binary64
(if (<= F -0.182)
(+ (- (/ x B)) (/ (* F (/ -1.0 F)) (sin B)))
(if (<= F 1700.0)
(/ (- (* F (pow (pow (+ 2.0 (fma 2.0 x (* F F))) -0.25) 2.0)) x) B)
(* (+ (/ 1.0 (* (sin B) F)) (- (/ x (* F B)))) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.182) {
tmp = -(x / B) + ((F * (-1.0 / F)) / sin(B));
} else if (F <= 1700.0) {
tmp = ((F * pow(pow((2.0 + fma(2.0, x, (F * F))), -0.25), 2.0)) - x) / B;
} else {
tmp = ((1.0 / (sin(B) * F)) + -(x / (F * B))) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.182) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * Float64(-1.0 / F)) / sin(B))); elseif (F <= 1700.0) tmp = Float64(Float64(Float64(F * ((Float64(2.0 + fma(2.0, x, Float64(F * F))) ^ -0.25) ^ 2.0)) - x) / B); else tmp = Float64(Float64(Float64(1.0 / Float64(sin(B) * F)) + Float64(-Float64(x / Float64(F * B)))) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.182], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1700.0], N[(N[(N[(F * N[Power[N[Power[N[(2.0 + N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.25], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] + (-N[(x / N[(F * B), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot \frac{-1}{F}}{\sin B}\\
\mathbf{elif}\;F \leq 1700:\\
\;\;\;\;\frac{F \cdot {\left({\left(2 + \mathsf{fma}\left(2, x, F \cdot F\right)\right)}^{-0.25}\right)}^{2} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B \cdot F} + \left(-\frac{x}{F \cdot B}\right)\right) \cdot F\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
Taylor expanded in B around 0
lower-/.f6437.0
Applied rewrites37.0%
if -0.182 < F < 1700Initial program 76.2%
lift-pow.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
sqr-powN/A
pow2N/A
lower-pow.f64N/A
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lower-*.f6443.3
Applied rewrites43.3%
if 1700 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.5
Applied rewrites31.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -0.182)
(+ t_0 (/ (* F (/ -1.0 F)) (sin B)))
(if (<= F 1700.0)
(+ t_0 (* (/ F B) (pow (fma F F 2.0) -0.5)))
(* (+ (/ 1.0 (* (sin B) F)) (- (/ x (* F B)))) F)))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -0.182) {
tmp = t_0 + ((F * (-1.0 / F)) / sin(B));
} else if (F <= 1700.0) {
tmp = t_0 + ((F / B) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = ((1.0 / (sin(B) * F)) + -(x / (F * B))) * F;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -0.182) tmp = Float64(t_0 + Float64(Float64(F * Float64(-1.0 / F)) / sin(B))); elseif (F <= 1700.0) tmp = Float64(t_0 + Float64(Float64(F / B) * (fma(F, F, 2.0) ^ -0.5))); else tmp = Float64(Float64(Float64(1.0 / Float64(sin(B) * F)) + Float64(-Float64(x / Float64(F * B)))) * F); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -0.182], N[(t$95$0 + N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1700.0], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] + (-N[(x / N[(F * B), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] * F), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;t\_0 + \frac{F \cdot \frac{-1}{F}}{\sin B}\\
\mathbf{elif}\;F \leq 1700:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{\sin B \cdot F} + \left(-\frac{x}{F \cdot B}\right)\right) \cdot F\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
Taylor expanded in B around 0
lower-/.f6437.0
Applied rewrites37.0%
if -0.182 < F < 1700Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in B around 0
lower-/.f6434.8
Applied rewrites34.8%
if 1700 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6431.5
Applied rewrites31.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -0.182)
(+ t_0 (/ (* F (/ -1.0 F)) (sin B)))
(if (<= F 1.4e+29)
(/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B)
(+ t_0 (* (/ F (sin B)) (/ 1.0 F)))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -0.182) {
tmp = t_0 + ((F * (-1.0 / F)) / sin(B));
} else if (F <= 1.4e+29) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = t_0 + ((F / sin(B)) * (1.0 / F));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -0.182) tmp = Float64(t_0 + Float64(Float64(F * Float64(-1.0 / F)) / sin(B))); elseif (F <= 1.4e+29) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -0.182], N[(t$95$0 + N[(N[(F * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e+29], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;t\_0 + \frac{F \cdot \frac{-1}{F}}{\sin B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{F}{\sin B} \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.1
Applied rewrites48.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f6456.5
Applied rewrites56.5%
Taylor expanded in B around 0
lower-/.f6437.0
Applied rewrites37.0%
if -0.182 < F < 1.4e29Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
if 1.4e29 < F Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in F around inf
lower-/.f6428.5
Applied rewrites28.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))) (t_1 (/ F (sin B))))
(if (<= F -5.2e+174)
(/
(-
(* (+ (- (/ (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) x) F)) (/ 1.0 F)) F))
B)
(if (<= F -0.182)
(+ t_0 (* t_1 (/ -1.0 F)))
(if (<= F 1.4e+29)
(/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B)
(+ t_0 (* t_1 (/ 1.0 F))))))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double t_1 = F / sin(B);
double tmp;
if (F <= -5.2e+174) {
tmp = -((-((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - x) / F) + (1.0 / F)) * F) / B;
} else if (F <= -0.182) {
tmp = t_0 + (t_1 * (-1.0 / F));
} else if (F <= 1.4e+29) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = t_0 + (t_1 * (1.0 / F));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) t_1 = Float64(F / sin(B)) tmp = 0.0 if (F <= -5.2e+174) tmp = Float64(Float64(-Float64(Float64(Float64(-Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - x) / F)) + Float64(1.0 / F)) * F)) / B); elseif (F <= -0.182) tmp = Float64(t_0 + Float64(t_1 * Float64(-1.0 / F))); elseif (F <= 1.4e+29) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(t_0 + Float64(t_1 * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.2e+174], N[((-N[(N[((-N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - x), $MachinePrecision] / F), $MachinePrecision]) + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, -0.182], N[(t$95$0 + N[(t$95$1 * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4e+29], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(t$95$0 + N[(t$95$1 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
t_1 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+174}:\\
\;\;\;\;\frac{-\left(\left(-\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - x}{F}\right) + \frac{1}{F}\right) \cdot F}{B}\\
\mathbf{elif}\;F \leq -0.182:\\
\;\;\;\;t\_0 + t\_1 \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{+29}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + t\_1 \cdot \frac{1}{F}\\
\end{array}
\end{array}
if F < -5.1999999999999997e174Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites22.1%
if -5.1999999999999997e174 < F < -0.182Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in F around -inf
lower-/.f6428.6
Applied rewrites28.6%
if -0.182 < F < 1.4e29Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
if 1.4e29 < F Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in F around inf
lower-/.f6428.5
Applied rewrites28.5%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e+174)
(/
(- (* (+ (- (/ (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) x) F)) (/ 1.0 F)) F))
B)
(if (<= F -0.182)
(+ (- (/ x B)) (* (/ F (sin B)) (/ -1.0 F)))
(if (<= F 3.2e+177)
(/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B)
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e+174) {
tmp = -((-((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - x) / F) + (1.0 / F)) * F) / B;
} else if (F <= -0.182) {
tmp = -(x / B) + ((F / sin(B)) * (-1.0 / F));
} else if (F <= 3.2e+177) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.2e+174) tmp = Float64(Float64(-Float64(Float64(Float64(-Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - x) / F)) + Float64(1.0 / F)) * F)) / B); elseif (F <= -0.182) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * Float64(-1.0 / F))); elseif (F <= 3.2e+177) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.2e+174], N[((-N[(N[((-N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - x), $MachinePrecision] / F), $MachinePrecision]) + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, -0.182], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.2e+177], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{+174}:\\
\;\;\;\;\frac{-\left(\left(-\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - x}{F}\right) + \frac{1}{F}\right) \cdot F}{B}\\
\mathbf{elif}\;F \leq -0.182:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \frac{-1}{F}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{+177}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -5.1999999999999997e174Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites22.1%
if -5.1999999999999997e174 < F < -0.182Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in F around -inf
lower-/.f6428.6
Applied rewrites28.6%
if -0.182 < F < 3.2e177Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
if 3.2e177 < F Initial program 76.2%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6416.9
Applied rewrites16.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.75e+174)
(/
(- (* (+ (- (/ (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) x) F)) (/ 1.0 F)) F))
B)
(if (<= F -0.182)
(/ -1.0 (sin B))
(if (<= F 3.2e+177)
(/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B)
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.75e+174) {
tmp = -((-((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - x) / F) + (1.0 / F)) * F) / B;
} else if (F <= -0.182) {
tmp = -1.0 / sin(B);
} else if (F <= 3.2e+177) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.75e+174) tmp = Float64(Float64(-Float64(Float64(Float64(-Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - x) / F)) + Float64(1.0 / F)) * F)) / B); elseif (F <= -0.182) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3.2e+177) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.75e+174], N[((-N[(N[((-N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - x), $MachinePrecision] / F), $MachinePrecision]) + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, -0.182], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.2e+177], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.75 \cdot 10^{+174}:\\
\;\;\;\;\frac{-\left(\left(-\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - x}{F}\right) + \frac{1}{F}\right) \cdot F}{B}\\
\mathbf{elif}\;F \leq -0.182:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{+177}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.7500000000000002e174Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites22.1%
if -3.7500000000000002e174 < F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
if -0.182 < F < 3.2e177Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
if 3.2e177 < F Initial program 76.2%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6416.9
Applied rewrites16.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.75e+174)
(/
(- (* (+ (- (/ (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) x) F)) (/ 1.0 F)) F))
B)
(if (<= F -0.182)
(/ -1.0 (sin B))
(if (<= F 3800.0)
(+ (- (/ x B)) (* (/ F B) (pow (fma F F 2.0) -0.5)))
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.75e+174) {
tmp = -((-((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - x) / F) + (1.0 / F)) * F) / B;
} else if (F <= -0.182) {
tmp = -1.0 / sin(B);
} else if (F <= 3800.0) {
tmp = -(x / B) + ((F / B) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.75e+174) tmp = Float64(Float64(-Float64(Float64(Float64(-Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - x) / F)) + Float64(1.0 / F)) * F)) / B); elseif (F <= -0.182) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3800.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (fma(F, F, 2.0) ^ -0.5))); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.75e+174], N[((-N[(N[((-N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - x), $MachinePrecision] / F), $MachinePrecision]) + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, -0.182], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3800.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.75 \cdot 10^{+174}:\\
\;\;\;\;\frac{-\left(\left(-\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - x}{F}\right) + \frac{1}{F}\right) \cdot F}{B}\\
\mathbf{elif}\;F \leq -0.182:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3800:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.7500000000000002e174Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites22.1%
if -3.7500000000000002e174 < F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
if -0.182 < F < 3800Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in B around 0
lower-/.f6434.8
Applied rewrites34.8%
if 3800 < F Initial program 76.2%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6416.9
Applied rewrites16.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.75e+174)
(/
(- (* (+ (- (/ (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) x) F)) (/ 1.0 F)) F))
B)
(if (<= F -0.182)
(/ -1.0 (sin B))
(if (<= F 3800.0)
(+ (- (/ x B)) (* (/ F B) (pow (fma F F 2.0) -0.5)))
(* (/ (/ (- 1.0 x) F) B) F)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.75e+174) {
tmp = -((-((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - x) / F) + (1.0 / F)) * F) / B;
} else if (F <= -0.182) {
tmp = -1.0 / sin(B);
} else if (F <= 3800.0) {
tmp = -(x / B) + ((F / B) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.75e+174) tmp = Float64(Float64(-Float64(Float64(Float64(-Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - x) / F)) + Float64(1.0 / F)) * F)) / B); elseif (F <= -0.182) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3800.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (fma(F, F, 2.0) ^ -0.5))); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.75e+174], N[((-N[(N[((-N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - x), $MachinePrecision] / F), $MachinePrecision]) + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, -0.182], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3800.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.75 \cdot 10^{+174}:\\
\;\;\;\;\frac{-\left(\left(-\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - x}{F}\right) + \frac{1}{F}\right) \cdot F}{B}\\
\mathbf{elif}\;F \leq -0.182:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3800:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -3.7500000000000002e174Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites22.1%
if -3.7500000000000002e174 < F < -0.182Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
if -0.182 < F < 3800Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in B around 0
lower-/.f6434.8
Applied rewrites34.8%
if 3800 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x)
:precision binary64
(if (<= F -4e+36)
(/
(- (* (+ (- (/ (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) x) F)) (/ 1.0 F)) F))
B)
(if (<= F 3800.0)
(+ (- (/ x B)) (* (/ F B) (pow (fma F F 2.0) -0.5)))
(* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e+36) {
tmp = -((-((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - x) / F) + (1.0 / F)) * F) / B;
} else if (F <= 3800.0) {
tmp = -(x / B) + ((F / B) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4e+36) tmp = Float64(Float64(-Float64(Float64(Float64(-Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - x) / F)) + Float64(1.0 / F)) * F)) / B); elseif (F <= 3800.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (fma(F, F, 2.0) ^ -0.5))); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4e+36], N[((-N[(N[((-N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - x), $MachinePrecision] / F), $MachinePrecision]) + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3800.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{+36}:\\
\;\;\;\;\frac{-\left(\left(-\frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - x}{F}\right) + \frac{1}{F}\right) \cdot F}{B}\\
\mathbf{elif}\;F \leq 3800:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -4.00000000000000017e36Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites22.1%
if -4.00000000000000017e36 < F < 3800Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in B around 0
lower-/.f6434.8
Applied rewrites34.8%
if 3800 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.182)
(/ (- (* (/ (+ 1.0 x) F) F)) B)
(if (<= F 3800.0)
(+ (- (/ x B)) (* (/ F B) (pow (fma F F 2.0) -0.5)))
(* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.182) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 3800.0) {
tmp = -(x / B) + ((F / B) * pow(fma(F, F, 2.0), -0.5));
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.182) tmp = Float64(Float64(-Float64(Float64(Float64(1.0 + x) / F) * F)) / B); elseif (F <= 3800.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / B) * (fma(F, F, 2.0) ^ -0.5))); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.182], N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3800.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;\frac{-\frac{1 + x}{F} \cdot F}{B}\\
\mathbf{elif}\;F \leq 3800:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{B} \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6429.0
Applied rewrites29.0%
if -0.182 < F < 3800Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-eval76.1
Applied rewrites76.1%
Taylor expanded in B around 0
lower-/.f6448.8
Applied rewrites48.8%
Taylor expanded in B around 0
lower-/.f6434.8
Applied rewrites34.8%
if 3800 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.182)
(/ (- (* (/ (+ 1.0 x) F) F)) B)
(if (<= F 3900.0)
(fma F (/ (pow (fma 2.0 x 2.0) -0.5) B) (/ (- x) B))
(* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.182) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 3900.0) {
tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / B), (-x / B));
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.182) tmp = Float64(Float64(-Float64(Float64(Float64(1.0 + x) / F) * F)) / B); elseif (F <= 3900.0) tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / B), Float64(Float64(-x) / B)); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.182], N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3900.0], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / B), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;\frac{-\frac{1 + x}{F} \cdot F}{B}\\
\mathbf{elif}\;F \leq 3900:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{B}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6429.0
Applied rewrites29.0%
if -0.182 < F < 3900Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites29.3%
if 3900 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.182)
(/ (- (* (/ (+ 1.0 x) F) F)) B)
(if (<= F 3900.0)
(/ (- (* (pow (fma 2.0 x 2.0) -0.5) F) x) B)
(* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.182) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 3900.0) {
tmp = ((pow(fma(2.0, x, 2.0), -0.5) * F) - x) / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.182) tmp = Float64(Float64(-Float64(Float64(Float64(1.0 + x) / F) * F)) / B); elseif (F <= 3900.0) tmp = Float64(Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.182], N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3900.0], N[(N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.182:\\
\;\;\;\;\frac{-\frac{1 + x}{F} \cdot F}{B}\\
\mathbf{elif}\;F \leq 3900:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -0.182Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6429.0
Applied rewrites29.0%
if -0.182 < F < 3900Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
+-commutativeN/A
lower-fma.f6429.1
Applied rewrites29.1%
if 3900 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x)
:precision binary64
(if (<= F -5.7e-61)
(/ (- (* (/ (+ 1.0 x) F) F)) B)
(if (<= F 9.2e-69)
(/ (- (* (* 0.3333333333333333 x) (* B B)) x) B)
(/ (* (+ (/ (- x) F) (/ 1.0 F)) F) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.7e-61) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 9.2e-69) {
tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B;
} else {
tmp = (((-x / F) + (1.0 / F)) * F) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-5.7d-61)) then
tmp = -(((1.0d0 + x) / f) * f) / b
else if (f <= 9.2d-69) then
tmp = (((0.3333333333333333d0 * x) * (b * b)) - x) / b
else
tmp = (((-x / f) + (1.0d0 / f)) * f) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.7e-61) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 9.2e-69) {
tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B;
} else {
tmp = (((-x / F) + (1.0 / F)) * F) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.7e-61: tmp = -(((1.0 + x) / F) * F) / B elif F <= 9.2e-69: tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B else: tmp = (((-x / F) + (1.0 / F)) * F) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.7e-61) tmp = Float64(Float64(-Float64(Float64(Float64(1.0 + x) / F) * F)) / B); elseif (F <= 9.2e-69) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * x) * Float64(B * B)) - x) / B); else tmp = Float64(Float64(Float64(Float64(Float64(-x) / F) + Float64(1.0 / F)) * F) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.7e-61) tmp = -(((1.0 + x) / F) * F) / B; elseif (F <= 9.2e-69) tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B; else tmp = (((-x / F) + (1.0 / F)) * F) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.7e-61], N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 9.2e-69], N[(N[(N[(N[(0.3333333333333333 * x), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[((-x) / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.7 \cdot 10^{-61}:\\
\;\;\;\;\frac{-\frac{1 + x}{F} \cdot F}{B}\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{-69}:\\
\;\;\;\;\frac{\left(0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{-x}{F} + \frac{1}{F}\right) \cdot F}{B}\\
\end{array}
\end{array}
if F < -5.70000000000000005e-61Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6429.0
Applied rewrites29.0%
if -5.70000000000000005e-61 < F < 9.2000000000000003e-69Initial program 76.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites28.7%
if 9.2000000000000003e-69 < F Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
lower-+.f64N/A
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f64N/A
lower-/.f6428.5
Applied rewrites28.5%
(FPCore (F B x)
:precision binary64
(if (<= F -5.7e-61)
(/ (- (* (/ (+ 1.0 x) F) F)) B)
(if (<= F 3e-52)
(/ (- (* (* 0.3333333333333333 x) (* B B)) x) B)
(* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.7e-61) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 3e-52) {
tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-5.7d-61)) then
tmp = -(((1.0d0 + x) / f) * f) / b
else if (f <= 3d-52) then
tmp = (((0.3333333333333333d0 * x) * (b * b)) - x) / b
else
tmp = (((1.0d0 - x) / f) / b) * f
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.7e-61) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 3e-52) {
tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.7e-61: tmp = -(((1.0 + x) / F) * F) / B elif F <= 3e-52: tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B else: tmp = (((1.0 - x) / F) / B) * F return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.7e-61) tmp = Float64(Float64(-Float64(Float64(Float64(1.0 + x) / F) * F)) / B); elseif (F <= 3e-52) tmp = Float64(Float64(Float64(Float64(0.3333333333333333 * x) * Float64(B * B)) - x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.7e-61) tmp = -(((1.0 + x) / F) * F) / B; elseif (F <= 3e-52) tmp = (((0.3333333333333333 * x) * (B * B)) - x) / B; else tmp = (((1.0 - x) / F) / B) * F; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.7e-61], N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3e-52], N[(N[(N[(N[(0.3333333333333333 * x), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.7 \cdot 10^{-61}:\\
\;\;\;\;\frac{-\frac{1 + x}{F} \cdot F}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-52}:\\
\;\;\;\;\frac{\left(0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -5.70000000000000005e-61Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6429.0
Applied rewrites29.0%
if -5.70000000000000005e-61 < F < 3e-52Initial program 76.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.4
Applied rewrites55.4%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites28.7%
if 3e-52 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x) :precision binary64 (if (<= F -2.65e-37) (/ (- (* (/ (+ 1.0 x) F) F)) B) (if (<= F 3.25e-40) (/ (- x) B) (* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-37) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 3.25e-40) {
tmp = -x / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.65d-37)) then
tmp = -(((1.0d0 + x) / f) * f) / b
else if (f <= 3.25d-40) then
tmp = -x / b
else
tmp = (((1.0d0 - x) / f) / b) * f
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-37) {
tmp = -(((1.0 + x) / F) * F) / B;
} else if (F <= 3.25e-40) {
tmp = -x / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.65e-37: tmp = -(((1.0 + x) / F) * F) / B elif F <= 3.25e-40: tmp = -x / B else: tmp = (((1.0 - x) / F) / B) * F return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.65e-37) tmp = Float64(Float64(-Float64(Float64(Float64(1.0 + x) / F) * F)) / B); elseif (F <= 3.25e-40) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.65e-37) tmp = -(((1.0 + x) / F) * F) / B; elseif (F <= 3.25e-40) tmp = -x / B; else tmp = (((1.0 - x) / F) / B) * F; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.65e-37], N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / F), $MachinePrecision] * F), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 3.25e-40], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.65 \cdot 10^{-37}:\\
\;\;\;\;\frac{-\frac{1 + x}{F} \cdot F}{B}\\
\mathbf{elif}\;F \leq 3.25 \cdot 10^{-40}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -2.64999999999999998e-37Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f6429.0
Applied rewrites29.0%
if -2.64999999999999998e-37 < F < 3.25e-40Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.8
Applied rewrites28.8%
if 3.25e-40 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x) :precision binary64 (if (<= F -2.65e-37) (- (* (/ (+ 1.0 x) (* F B)) F)) (if (<= F 3.25e-40) (/ (- x) B) (* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-37) {
tmp = -(((1.0 + x) / (F * B)) * F);
} else if (F <= 3.25e-40) {
tmp = -x / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.65d-37)) then
tmp = -(((1.0d0 + x) / (f * b)) * f)
else if (f <= 3.25d-40) then
tmp = -x / b
else
tmp = (((1.0d0 - x) / f) / b) * f
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-37) {
tmp = -(((1.0 + x) / (F * B)) * F);
} else if (F <= 3.25e-40) {
tmp = -x / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.65e-37: tmp = -(((1.0 + x) / (F * B)) * F) elif F <= 3.25e-40: tmp = -x / B else: tmp = (((1.0 - x) / F) / B) * F return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.65e-37) tmp = Float64(-Float64(Float64(Float64(1.0 + x) / Float64(F * B)) * F)); elseif (F <= 3.25e-40) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.65e-37) tmp = -(((1.0 + x) / (F * B)) * F); elseif (F <= 3.25e-40) tmp = -x / B; else tmp = (((1.0 - x) / F) / B) * F; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.65e-37], (-N[(N[(N[(1.0 + x), $MachinePrecision] / N[(F * B), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, 3.25e-40], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.65 \cdot 10^{-37}:\\
\;\;\;\;-\frac{1 + x}{F \cdot B} \cdot F\\
\mathbf{elif}\;F \leq 3.25 \cdot 10^{-40}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -2.64999999999999998e-37Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6427.6
Applied rewrites27.6%
if -2.64999999999999998e-37 < F < 3.25e-40Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.8
Applied rewrites28.8%
if 3.25e-40 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-12) (/ (- (* (* B B) -0.16666666666666666) 1.0) B) (if (<= F 3.25e-40) (/ (- x) B) (* (/ (/ (- 1.0 x) F) B) F))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-12) {
tmp = (((B * B) * -0.16666666666666666) - 1.0) / B;
} else if (F <= 3.25e-40) {
tmp = -x / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
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.45d-12)) then
tmp = (((b * b) * (-0.16666666666666666d0)) - 1.0d0) / b
else if (f <= 3.25d-40) then
tmp = -x / b
else
tmp = (((1.0d0 - x) / f) / b) * f
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-12) {
tmp = (((B * B) * -0.16666666666666666) - 1.0) / B;
} else if (F <= 3.25e-40) {
tmp = -x / B;
} else {
tmp = (((1.0 - x) / F) / B) * F;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-12: tmp = (((B * B) * -0.16666666666666666) - 1.0) / B elif F <= 3.25e-40: tmp = -x / B else: tmp = (((1.0 - x) / F) / B) * F return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-12) tmp = Float64(Float64(Float64(Float64(B * B) * -0.16666666666666666) - 1.0) / B); elseif (F <= 3.25e-40) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 - x) / F) / B) * F); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.45e-12) tmp = (((B * B) * -0.16666666666666666) - 1.0) / B; elseif (F <= 3.25e-40) tmp = -x / B; else tmp = (((1.0 - x) / F) / B) * F; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-12], N[(N[(N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.25e-40], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(1.0 - x), $MachinePrecision] / F), $MachinePrecision] / B), $MachinePrecision] * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-12}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot -0.16666666666666666 - 1}{B}\\
\mathbf{elif}\;F \leq 3.25 \cdot 10^{-40}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x}{F}}{B} \cdot F\\
\end{array}
\end{array}
if F < -1.4500000000000001e-12Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6410.6
Applied rewrites10.6%
if -1.4500000000000001e-12 < F < 3.25e-40Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.8
Applied rewrites28.8%
if 3.25e-40 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6427.2
Applied rewrites27.2%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (- x) B))) (if (<= x -1.6e-22) t_0 (if (<= x 2.6e-225) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.6e-22) {
tmp = t_0;
} else if (x <= 2.6e-225) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -x / b
if (x <= (-1.6d-22)) then
tmp = t_0
else if (x <= 2.6d-225) then
tmp = (-1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.6e-22) {
tmp = t_0;
} else if (x <= 2.6e-225) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if x <= -1.6e-22: tmp = t_0 elif x <= 2.6e-225: tmp = -1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (x <= -1.6e-22) tmp = t_0; elseif (x <= 2.6e-225) tmp = Float64(-1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / B; tmp = 0.0; if (x <= -1.6e-22) tmp = t_0; elseif (x <= 2.6e-225) tmp = -1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -1.6e-22], t$95$0, If[LessEqual[x, 2.6e-225], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{-22}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{-225}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.59999999999999994e-22 or 2.60000000000000013e-225 < x Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.8
Applied rewrites28.8%
if -1.59999999999999994e-22 < x < 2.60000000000000013e-225Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
lower-/.f6410.8
Applied rewrites10.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-12) (/ (- (* (* B B) -0.16666666666666666) 1.0) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-12) {
tmp = (((B * B) * -0.16666666666666666) - 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.45d-12)) then
tmp = (((b * b) * (-0.16666666666666666d0)) - 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.45e-12) {
tmp = (((B * B) * -0.16666666666666666) - 1.0) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-12: tmp = (((B * B) * -0.16666666666666666) - 1.0) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-12) tmp = Float64(Float64(Float64(Float64(B * B) * -0.16666666666666666) - 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.45e-12) tmp = (((B * B) * -0.16666666666666666) - 1.0) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-12], N[(N[(N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-12}:\\
\;\;\;\;\frac{\left(B \cdot B\right) \cdot -0.16666666666666666 - 1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.4500000000000001e-12Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6410.6
Applied rewrites10.6%
if -1.4500000000000001e-12 < F Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6428.8
Applied rewrites28.8%
(FPCore (F B x) :precision binary64 (if (<= F 2.25e-63) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.25e-63) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 2.25d-63) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.25e-63) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.25e-63: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.25e-63) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2.25e-63) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.25e-63], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.25 \cdot 10^{-63}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 2.25e-63Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
lower-/.f6410.8
Applied rewrites10.8%
if 2.25e-63 < F Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.3%
Taylor expanded in F around inf
Applied rewrites9.8%
(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.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.7
Applied rewrites17.7%
Taylor expanded in B around 0
lower-/.f6410.8
Applied rewrites10.8%
herbie shell --seed 2025142
(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))))))