
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(if (<= F -3e+30)
(- (/ (+ 1.0 (* (cos B) x)) (sin B)))
(if (<= F 6e+40)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(+ (- (* x (/ 1.0 (tan B)))) (/ (* F 1.0) (* (sin B) F))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3e+30) {
tmp = -((1.0 + (cos(B) * x)) / sin(B));
} else if (F <= 6e+40) {
tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = -(x * (1.0 / tan(B))) + ((F * 1.0) / (sin(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 <= (-3d+30)) then
tmp = -((1.0d0 + (cos(b) * x)) / sin(b))
else if (f <= 6d+40) then
tmp = -((x * 1.0d0) / tan(b)) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = -(x * (1.0d0 / tan(b))) + ((f * 1.0d0) / (sin(b) * f))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3e+30) {
tmp = -((1.0 + (Math.cos(B) * x)) / Math.sin(B));
} else if (F <= 6e+40) {
tmp = -((x * 1.0) / Math.tan(B)) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = -(x * (1.0 / Math.tan(B))) + ((F * 1.0) / (Math.sin(B) * F));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3e+30: tmp = -((1.0 + (math.cos(B) * x)) / math.sin(B)) elif F <= 6e+40: tmp = -((x * 1.0) / math.tan(B)) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = -(x * (1.0 / math.tan(B))) + ((F * 1.0) / (math.sin(B) * F)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3e+30) tmp = Float64(-Float64(Float64(1.0 + Float64(cos(B) * x)) / sin(B))); elseif (F <= 6e+40) 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(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * 1.0) / Float64(sin(B) * F))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3e+30) tmp = -((1.0 + (cos(B) * x)) / sin(B)); elseif (F <= 6e+40) tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = -(x * (1.0 / tan(B))) + ((F * 1.0) / (sin(B) * F)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3e+30], (-N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 6e+40], 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[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{+30}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+40}:\\
\;\;\;\;\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}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot 1}{\sin B \cdot F}\\
\end{array}
\end{array}
if F < -2.99999999999999978e30Initial program 54.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -2.99999999999999978e30 < F < 6.0000000000000004e40Initial program 99.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.3
Applied rewrites99.3%
if 6.0000000000000004e40 < F Initial program 53.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites70.9%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites70.9%
Taylor expanded in F around inf
Applied rewrites99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -5e+32)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 4.2e-22)
(+
(- (* x (/ 1.0 (tan B))))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -5e+32) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 4.2e-22) {
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 - t_0) / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = cos(b) * x
if (f <= (-5d+32)) then
tmp = -((1.0d0 + t_0) / sin(b))
else if (f <= 4.2d-22) then
tmp = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.cos(B) * x;
double tmp;
if (F <= -5e+32) {
tmp = -((1.0 + t_0) / Math.sin(B));
} else if (F <= 4.2e-22) {
tmp = -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = math.cos(B) * x tmp = 0 if F <= -5e+32: tmp = -((1.0 + t_0) / math.sin(B)) elif F <= 4.2e-22: tmp = -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -5e+32) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 4.2e-22) tmp = 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))))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = cos(B) * x; tmp = 0.0; if (F <= -5e+32) tmp = -((1.0 + t_0) / sin(B)); elseif (F <= 4.2e-22) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -5e+32], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.2e-22], 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], 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 -5 \cdot 10^{+32}:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;\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)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -4.9999999999999997e32Initial program 54.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -4.9999999999999997e32 < F < 4.20000000000000016e-22Initial program 99.4%
if 4.20000000000000016e-22 < F Initial program 60.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6495.4
Applied rewrites95.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -5.2e+17)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 4.2e-22)
(+
(- (* x (/ 1.0 (tan B))))
(/ (* (/ F (sin B)) 1.0) (sqrt (fma 2.0 x (fma F F 2.0)))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -5.2e+17) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 4.2e-22) {
tmp = -(x * (1.0 / tan(B))) + (((F / sin(B)) * 1.0) / sqrt(fma(2.0, x, fma(F, F, 2.0))));
} 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 <= -5.2e+17) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 4.2e-22) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(Float64(F / sin(B)) * 1.0) / sqrt(fma(2.0, x, fma(F, F, 2.0))))); 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, -5.2e+17], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.2e-22], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+17}:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{\frac{F}{\sin B} \cdot 1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -5.2e17Initial program 55.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -5.2e17 < F < 4.20000000000000016e-22Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites99.4%
if 4.20000000000000016e-22 < F Initial program 60.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6495.4
Applied rewrites95.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -5.2e+17)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 4.2e-22)
(+
(- (* x (/ 1.0 (tan B))))
(/ (* F 1.0) (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -5.2e+17) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 4.2e-22) {
tmp = -(x * (1.0 / tan(B))) + ((F * 1.0) / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))));
} 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 <= -5.2e+17) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 4.2e-22) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * 1.0) / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))))); 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, -5.2e+17], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.2e-22], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+17}:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -5.2e17Initial program 55.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -5.2e17 < F < 4.20000000000000016e-22Initial program 99.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites99.4%
if 4.20000000000000016e-22 < F Initial program 60.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6495.4
Applied rewrites95.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1.5)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 4.2e-22)
(+
(- (* x (/ 1.0 (tan B))))
(/ (* F 1.0) (* (sin B) (sqrt (fma 2.0 x 2.0)))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1.5) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 4.2e-22) {
tmp = -(x * (1.0 / tan(B))) + ((F * 1.0) / (sin(B) * sqrt(fma(2.0, x, 2.0))));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1.5) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 4.2e-22) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * 1.0) / Float64(sin(B) * sqrt(fma(2.0, x, 2.0))))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.5], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.2e-22], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.5:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot 1}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1.5Initial program 58.0%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
if -1.5 < F < 4.20000000000000016e-22Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites99.4%
Taylor expanded in F around 0
Applied rewrites99.1%
if 4.20000000000000016e-22 < F Initial program 60.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6495.4
Applied rewrites95.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma 2.0 x (fma F F 2.0))) (t_1 (- (* x (/ 1.0 (tan B))))))
(if (<= F -1.25e+154)
(+ t_1 (/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)))
(if (<= F -2.9e-30)
(+ (/ (- x) B) (/ (* F 1.0) (* (sin B) (sqrt t_0))))
(if (<= F 4.2e-22)
(+ t_1 (* (/ F B) (sqrt (/ 1.0 t_0))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = fma(2.0, x, fma(F, F, 2.0));
double t_1 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -1.25e+154) {
tmp = t_1 + (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B));
} else if (F <= -2.9e-30) {
tmp = (-x / B) + ((F * 1.0) / (sin(B) * sqrt(t_0)));
} else if (F <= 4.2e-22) {
tmp = t_1 + ((F / B) * sqrt((1.0 / t_0)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(2.0, x, fma(F, F, 2.0)) t_1 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -1.25e+154) tmp = Float64(t_1 + Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B))); elseif (F <= -2.9e-30) tmp = Float64(Float64(Float64(-x) / B) + Float64(Float64(F * 1.0) / Float64(sin(B) * sqrt(t_0)))); elseif (F <= 4.2e-22) tmp = Float64(t_1 + Float64(Float64(F / B) * sqrt(Float64(1.0 / t_0)))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -1.25e+154], N[(t$95$1 + N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.9e-30], N[(N[((-x) / B), $MachinePrecision] + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e-22], N[(t$95$1 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / t$95$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}
t_0 := \mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\\
t_1 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.25 \cdot 10^{+154}:\\
\;\;\;\;t\_1 + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{elif}\;F \leq -2.9 \cdot 10^{-30}:\\
\;\;\;\;\frac{-x}{B} + \frac{F \cdot 1}{\sin B \cdot \sqrt{t\_0}}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;t\_1 + \frac{F}{B} \cdot \sqrt{\frac{1}{t\_0}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.25000000000000001e154Initial program 30.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6475.6
Applied rewrites75.6%
if -1.25000000000000001e154 < F < -2.89999999999999989e-30Initial program 91.1%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6478.9
Applied rewrites78.9%
if -2.89999999999999989e-30 < F < 4.20000000000000016e-22Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
pow2N/A
lift-*.f6485.2
Applied rewrites85.2%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
lower-/.f64N/A
lift-fma.f64N/A
lift-fma.f6485.2
Applied rewrites85.2%
if 4.20000000000000016e-22 < F Initial program 60.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6495.4
Applied rewrites95.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -7e-15)
(- (/ (+ 1.0 t_0) (sin B)))
(if (<= F 4.2e-22)
(+
(- (* x (/ 1.0 (tan B))))
(/ (* F 1.0) (* B (sqrt (fma 2.0 x (fma F F 2.0))))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -7e-15) {
tmp = -((1.0 + t_0) / sin(B));
} else if (F <= 4.2e-22) {
tmp = -(x * (1.0 / tan(B))) + ((F * 1.0) / (B * sqrt(fma(2.0, x, fma(F, F, 2.0)))));
} 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 <= -7e-15) tmp = Float64(-Float64(Float64(1.0 + t_0) / sin(B))); elseif (F <= 4.2e-22) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * 1.0) / Float64(B * sqrt(fma(2.0, x, fma(F, F, 2.0)))))); 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, -7e-15], (-N[(N[(1.0 + t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, 4.2e-22], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -7 \cdot 10^{-15}:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-22}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot 1}{B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -7.0000000000000001e-15Initial program 59.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6496.7
Applied rewrites96.7%
if -7.0000000000000001e-15 < F < 4.20000000000000016e-22Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.5%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
Applied rewrites84.9%
if 4.20000000000000016e-22 < F Initial program 60.5%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6495.4
Applied rewrites95.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma 2.0 x (fma F F 2.0))))
(t_1 (+ (- (* x (/ 1.0 (tan B)))) (/ (* F 1.0) (* B t_0)))))
(if (<= x -1.08e-48)
t_1
(if (<= x 9.8e-27) (+ (/ (- x) B) (/ (* F 1.0) (* (sin B) t_0))) t_1))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0)));
double t_1 = -(x * (1.0 / tan(B))) + ((F * 1.0) / (B * t_0));
double tmp;
if (x <= -1.08e-48) {
tmp = t_1;
} else if (x <= 9.8e-27) {
tmp = (-x / B) + ((F * 1.0) / (sin(B) * t_0));
} else {
tmp = t_1;
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0))) t_1 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * 1.0) / Float64(B * t_0))) tmp = 0.0 if (x <= -1.08e-48) tmp = t_1; elseif (x <= 9.8e-27) tmp = Float64(Float64(Float64(-x) / B) + Float64(Float64(F * 1.0) / Float64(sin(B) * t_0))); else tmp = t_1; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * 1.0), $MachinePrecision] / N[(B * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.08e-48], t$95$1, If[LessEqual[x, 9.8e-27], N[(N[((-x) / B), $MachinePrecision] + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\\
t_1 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot 1}{B \cdot t\_0}\\
\mathbf{if}\;x \leq -1.08 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{-27}:\\
\;\;\;\;\frac{-x}{B} + \frac{F \cdot 1}{\sin B \cdot t\_0}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.08e-48 or 9.79999999999999952e-27 < x Initial program 80.9%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites95.6%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites95.6%
Taylor expanded in B around 0
Applied rewrites93.3%
if -1.08e-48 < x < 9.79999999999999952e-27Initial program 73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.7%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites76.7%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6465.2
Applied rewrites65.2%
(FPCore (F B x)
:precision binary64
(if (<= x -2e-30)
(+
(- (/ (* x 1.0) (tan B)))
(/
-1.0
(*
(fma
(- (* 0.008333333333333333 (* B B)) 0.16666666666666666)
(* B B)
1.0)
B)))
(if (<= x 0.00033)
(+ (/ (- x) B) (/ (* F 1.0) (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))))
(+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (x <= -2e-30) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / (fma(((0.008333333333333333 * (B * B)) - 0.16666666666666666), (B * B), 1.0) * B));
} else if (x <= 0.00033) {
tmp = (-x / B) + ((F * 1.0) / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))));
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -2e-30) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / Float64(fma(Float64(Float64(0.008333333333333333 * Float64(B * B)) - 0.16666666666666666), Float64(B * B), 1.0) * B))); elseif (x <= 0.00033) tmp = Float64(Float64(Float64(-x) / B) + Float64(Float64(F * 1.0) / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))))); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -2e-30], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / N[(N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00033], N[(N[((-x) / B), $MachinePrecision] + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{-30}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right) - 0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{elif}\;x \leq 0.00033:\\
\;\;\;\;\frac{-x}{B} + \frac{F \cdot 1}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if x < -2e-30Initial program 69.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6482.7
Applied rewrites82.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6484.7
Applied rewrites84.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6484.9
Applied rewrites84.9%
if -2e-30 < x < 3.3e-4Initial program 73.4%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites76.7%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6464.6
Applied rewrites64.6%
if 3.3e-4 < x Initial program 87.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6496.9
Applied rewrites96.9%
Taylor expanded in B around 0
Applied rewrites97.3%
(FPCore (F B x)
:precision binary64
(if (<= x -1.85e-12)
(+ (- (/ (* x 1.0) (tan B))) (/ -1.0 B))
(if (<= x 0.00033)
(+ (/ (- x) B) (/ (* F 1.0) (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))))
(+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.85e-12) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / B);
} else if (x <= 0.00033) {
tmp = (-x / B) + ((F * 1.0) / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))));
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.85e-12) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / B)); elseif (x <= 0.00033) tmp = Float64(Float64(Float64(-x) / B) + Float64(Float64(F * 1.0) / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))))); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.85e-12], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 0.00033], N[(N[((-x) / B), $MachinePrecision] + N[(N[(F * 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{-12}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{B}\\
\mathbf{elif}\;x \leq 0.00033:\\
\;\;\;\;\frac{-x}{B} + \frac{F \cdot 1}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if x < -1.84999999999999999e-12Initial program 68.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6490.9
Applied rewrites90.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6491.7
Applied rewrites91.7%
Taylor expanded in B around 0
Applied rewrites91.7%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6491.9
Applied rewrites91.9%
if -1.84999999999999999e-12 < x < 3.3e-4Initial program 73.5%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites76.8%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
pow-flipN/A
lift-sin.f64N/A
associate-*l/N/A
frac-timesN/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-sin.f64N/A
metadata-evalN/A
unpow1/2N/A
lower-sqrt.f64N/A
lift-fma.f64N/A
Applied rewrites76.8%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f6464.3
Applied rewrites64.3%
if 3.3e-4 < x Initial program 87.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6496.9
Applied rewrites96.9%
Taylor expanded in B around 0
Applied rewrites97.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= x -5e-48)
(+ t_0 (/ -1.0 (* (fma (* 0.008333333333333333 (* B B)) (* B B) 1.0) B)))
(if (<= x 5.4e-86)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(if (<= x 1.6e-9)
(- (* (/ F B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (/ x B))
(+ t_0 (/ -1.0 B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (x <= -5e-48) {
tmp = t_0 + (-1.0 / (fma((0.008333333333333333 * (B * B)), (B * B), 1.0) * B));
} else if (x <= 5.4e-86) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else if (x <= 1.6e-9) {
tmp = ((F / B) * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) - (x / B);
} else {
tmp = t_0 + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (x <= -5e-48) tmp = Float64(t_0 + Float64(-1.0 / Float64(fma(Float64(0.008333333333333333 * Float64(B * B)), Float64(B * B), 1.0) * B))); elseif (x <= 5.4e-86) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (x <= 1.6e-9) tmp = Float64(Float64(Float64(F / B) * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(t_0 + Float64(-1.0 / B)); 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, -5e-48], N[(t$95$0 + N[(-1.0 / N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.4e-86], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-9], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-48}:\\
\;\;\;\;t\_0 + \frac{-1}{\mathsf{fma}\left(0.008333333333333333 \cdot \left(B \cdot B\right), B \cdot B, 1\right) \cdot B}\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-86}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\end{array}
\end{array}
if x < -4.9999999999999999e-48Initial program 69.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6476.2
Applied rewrites76.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6478.9
Applied rewrites78.9%
Taylor expanded in B around inf
pow2N/A
lift-*.f64N/A
lift-*.f6478.9
Applied rewrites78.9%
if -4.9999999999999999e-48 < x < 5.39999999999999985e-86Initial program 73.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6453.1
Applied rewrites53.1%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6453.0
Applied rewrites53.0%
if 5.39999999999999985e-86 < x < 1.60000000000000006e-9Initial program 72.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.4%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-subN/A
*-commutativeN/A
associate-*l/N/A
lower--.f64N/A
Applied rewrites36.8%
if 1.60000000000000006e-9 < x Initial program 86.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6496.0
Applied rewrites96.0%
Taylor expanded in B around 0
Applied rewrites96.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B))))))
(if (<= x -5e-48)
(+ t_0 (/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)))
(if (<= x 5.4e-86)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(if (<= x 1.6e-9)
(- (* (/ F B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (/ x B))
(+ t_0 (/ -1.0 B)))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double tmp;
if (x <= -5e-48) {
tmp = t_0 + (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B));
} else if (x <= 5.4e-86) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else if (x <= 1.6e-9) {
tmp = ((F / B) * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) - (x / B);
} else {
tmp = t_0 + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (x <= -5e-48) tmp = Float64(t_0 + Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B))); elseif (x <= 5.4e-86) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (x <= 1.6e-9) tmp = Float64(Float64(Float64(F / B) * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(t_0 + Float64(-1.0 / B)); 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, -5e-48], N[(t$95$0 + N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.4e-86], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-9], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;x \leq -5 \cdot 10^{-48}:\\
\;\;\;\;t\_0 + \frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B}\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-86}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{-1}{B}\\
\end{array}
\end{array}
if x < -4.9999999999999999e-48Initial program 69.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6476.2
Applied rewrites76.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6478.9
Applied rewrites78.9%
if -4.9999999999999999e-48 < x < 5.39999999999999985e-86Initial program 73.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6453.1
Applied rewrites53.1%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6453.0
Applied rewrites53.0%
if 5.39999999999999985e-86 < x < 1.60000000000000006e-9Initial program 72.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.4%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-subN/A
*-commutativeN/A
associate-*l/N/A
lower--.f64N/A
Applied rewrites36.8%
if 1.60000000000000006e-9 < x Initial program 86.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6496.0
Applied rewrites96.0%
Taylor expanded in B around 0
Applied rewrites96.4%
(FPCore (F B x)
:precision binary64
(if (<= x -1.3e-12)
(+ (- (/ (* x 1.0) (tan B))) (/ -1.0 B))
(if (<= x 5.4e-86)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(if (<= x 1.6e-9)
(- (* (/ F B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (/ x B))
(+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.3e-12) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / B);
} else if (x <= 5.4e-86) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else if (x <= 1.6e-9) {
tmp = ((F / B) * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) - (x / B);
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.3e-12) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / B)); elseif (x <= 5.4e-86) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (x <= 1.6e-9) tmp = Float64(Float64(Float64(F / B) * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.3e-12], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.4e-86], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-9], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-12}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{B}\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-86}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if x < -1.29999999999999991e-12Initial program 68.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6490.7
Applied rewrites90.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6491.5
Applied rewrites91.5%
Taylor expanded in B around 0
Applied rewrites91.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6491.7
Applied rewrites91.7%
if -1.29999999999999991e-12 < x < 5.39999999999999985e-86Initial program 73.7%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6451.2
Applied rewrites51.2%
lift-pow.f64N/A
lift-fma.f64N/A
lower-sqrt.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6451.1
Applied rewrites51.1%
if 5.39999999999999985e-86 < x < 1.60000000000000006e-9Initial program 72.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.4%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-subN/A
*-commutativeN/A
associate-*l/N/A
lower--.f64N/A
Applied rewrites36.8%
if 1.60000000000000006e-9 < x Initial program 86.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6496.0
Applied rewrites96.0%
Taylor expanded in B around 0
Applied rewrites96.4%
(FPCore (F B x)
:precision binary64
(if (<= x -1.3e-12)
(+ (- (/ (* x 1.0) (tan B))) (/ -1.0 B))
(if (<= x 5.4e-86)
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B)))
(if (<= x 1.6e-9)
(- (* (/ F B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (/ x B))
(+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -1.3e-12) {
tmp = -((x * 1.0) / tan(B)) + (-1.0 / B);
} else if (x <= 5.4e-86) {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
} else if (x <= 1.6e-9) {
tmp = ((F / B) * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) - (x / B);
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.3e-12) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(-1.0 / B)); elseif (x <= 5.4e-86) tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (x <= 1.6e-9) tmp = Float64(Float64(Float64(F / B) * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.3e-12], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.4e-86], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e-9], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-12}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{-1}{B}\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{-86}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if x < -1.29999999999999991e-12Initial program 68.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6490.7
Applied rewrites90.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6491.5
Applied rewrites91.5%
Taylor expanded in B around 0
Applied rewrites91.5%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6491.7
Applied rewrites91.7%
if -1.29999999999999991e-12 < x < 5.39999999999999985e-86Initial program 73.7%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites77.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6451.2
Applied rewrites51.2%
lift-pow.f64N/A
lift-fma.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6451.2
Applied rewrites51.2%
if 5.39999999999999985e-86 < x < 1.60000000000000006e-9Initial program 72.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.4%
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
div-subN/A
*-commutativeN/A
associate-*l/N/A
lower--.f64N/A
Applied rewrites36.8%
if 1.60000000000000006e-9 < x Initial program 86.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6496.0
Applied rewrites96.0%
Taylor expanded in B around 0
Applied rewrites96.4%
(FPCore (F B x) :precision binary64 (if (<= B 0.17) (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B) (+ (- (* x (/ 1.0 (tan B)))) (/ -1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.17) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -(x * (1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.17) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.17], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.17:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 0.170000000000000012Initial program 74.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites58.4%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
lower-/.f64N/A
lift-fma.f64N/A
lift-fma.f6458.4
Applied rewrites58.4%
if 0.170000000000000012 < B Initial program 86.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6457.7
Applied rewrites57.7%
Taylor expanded in B around 0
Applied rewrites53.5%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-15)
(+ (- (/ x B)) (/ -1.0 (sin B)))
(if (<= F 7.2e+43)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-15) {
tmp = -(x / B) + (-1.0 / sin(B));
} else if (F <= 7.2e+43) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-15) tmp = Float64(Float64(-Float64(x / B)) + Float64(-1.0 / sin(B))); elseif (F <= 7.2e+43) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-15], N[((-N[(x / B), $MachinePrecision]) + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e+43], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-15}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -7.0000000000000001e-15Initial program 59.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6496.6
Applied rewrites96.6%
Taylor expanded in B around 0
lower-/.f6474.3
Applied rewrites74.3%
if -7.0000000000000001e-15 < F < 7.2000000000000002e43Initial program 99.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.6%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
lower-/.f64N/A
lift-fma.f64N/A
lift-fma.f6451.6
Applied rewrites51.6%
if 7.2000000000000002e43 < F Initial program 53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.4%
Taylor expanded in F around inf
lower--.f6451.0
Applied rewrites51.0%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6448.6
Applied rewrites48.6%
(FPCore (F B x) :precision binary64 (if (<= B 2.55e+22) (/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B) (/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.55e+22) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.55e+22) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(-1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.55e+22], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.55 \cdot 10^{+22}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if B < 2.5500000000000001e22Initial program 74.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites57.2%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
lower-/.f64N/A
lift-fma.f64N/A
lift-fma.f6457.2
Applied rewrites57.2%
if 2.5500000000000001e22 < B Initial program 86.2%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites86.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f64N/A
lift-sin.f64N/A
lift-/.f6430.1
Applied rewrites30.1%
Taylor expanded in F around -inf
lift-sin.f64N/A
lift-/.f6417.4
Applied rewrites17.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+154)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F 7.2e+43)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+154) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= 7.2e+43) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+154) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= 7.2e+43) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+154], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e+43], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -1.35000000000000003e154Initial program 30.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6475.0
Applied rewrites75.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6452.0
Applied rewrites52.0%
if -1.35000000000000003e154 < F < 7.2000000000000002e43Initial program 97.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.5%
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
lower-/.f64N/A
lift-fma.f64N/A
lift-fma.f6451.5
Applied rewrites51.5%
if 7.2000000000000002e43 < F Initial program 53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.4%
Taylor expanded in F around inf
lower--.f6451.0
Applied rewrites51.0%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6448.6
Applied rewrites48.6%
(FPCore (F B x) :precision binary64 (if (<= F -8.4e-44) (/ (- (+ 1.0 x)) B) (if (<= F 5.8e-52) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.4e-44) {
tmp = -(1.0 + x) / B;
} else if (F <= 5.8e-52) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-8.4d-44)) then
tmp = -(1.0d0 + x) / b
else if (f <= 5.8d-52) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.4e-44) {
tmp = -(1.0 + x) / B;
} else if (F <= 5.8e-52) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.4e-44: tmp = -(1.0 + x) / B elif F <= 5.8e-52: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.4e-44) tmp = Float64(Float64(-Float64(1.0 + x)) / B); elseif (F <= 5.8e-52) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.4e-44) tmp = -(1.0 + x) / B; elseif (F <= 5.8e-52) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.4e-44], N[((-N[(1.0 + x), $MachinePrecision]) / B), $MachinePrecision], If[LessEqual[F, 5.8e-52], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.4 \cdot 10^{-44}:\\
\;\;\;\;\frac{-\left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-52}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.40000000000000005e-44Initial program 62.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-+.f6447.9
Applied rewrites47.9%
if -8.40000000000000005e-44 < F < 5.8000000000000003e-52Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.4%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6437.5
Applied rewrites37.5%
if 5.8000000000000003e-52 < F Initial program 63.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.0%
Taylor expanded in F around inf
lower--.f6447.3
Applied rewrites47.3%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (- x) B))) (if (<= x -8e-128) t_0 (if (<= x 8.2e-119) (/ 1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -8e-128) {
tmp = t_0;
} else if (x <= 8.2e-119) {
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 <= (-8d-128)) then
tmp = t_0
else if (x <= 8.2d-119) 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 <= -8e-128) {
tmp = t_0;
} else if (x <= 8.2e-119) {
tmp = 1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if x <= -8e-128: tmp = t_0 elif x <= 8.2e-119: 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 <= -8e-128) tmp = t_0; elseif (x <= 8.2e-119) 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 <= -8e-128) tmp = t_0; elseif (x <= 8.2e-119) 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, -8e-128], t$95$0, If[LessEqual[x, 8.2e-119], N[(1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -8 \cdot 10^{-128}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-119}:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8.00000000000000043e-128 or 8.20000000000000041e-119 < x Initial program 79.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites47.3%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6441.2
Applied rewrites41.2%
if -8.00000000000000043e-128 < x < 8.20000000000000041e-119Initial program 73.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites39.8%
Taylor expanded in F around inf
lower--.f6415.4
Applied rewrites15.4%
Taylor expanded in x around 0
Applied rewrites15.4%
(FPCore (F B x) :precision binary64 (if (<= F 5.8e-52) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 5.8e-52) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 5.8d-52) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 5.8e-52) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 5.8e-52: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 5.8e-52) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 5.8e-52) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 5.8e-52], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.8 \cdot 10^{-52}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5.8000000000000003e-52Initial program 83.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites46.7%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6432.6
Applied rewrites32.6%
if 5.8000000000000003e-52 < F Initial program 63.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites40.0%
Taylor expanded in F around inf
lower--.f6447.3
Applied rewrites47.3%
(FPCore (F B x) :precision binary64 (/ 1.0 B))
double code(double F, double B, double x) {
return 1.0 / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = 1.0d0 / b
end function
public static double code(double F, double B, double x) {
return 1.0 / B;
}
def code(F, B, x): return 1.0 / B
function code(F, B, x) return Float64(1.0 / B) end
function tmp = code(F, B, x) tmp = 1.0 / B; end
code[F_, B_, x_] := N[(1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{B}
\end{array}
Initial program 77.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites44.7%
Taylor expanded in F around inf
lower--.f6429.7
Applied rewrites29.7%
Taylor expanded in x around 0
Applied rewrites9.7%
herbie shell --seed 2025106
(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))))))