
(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 25 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1e+81)
(fma t_0 -1.0 t_1)
(if (<= F 5e+121)
(fma t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) t_1)
(fma -1.0 (/ (* x (cos B)) (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1e+81) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5e+121) {
tmp = fma(t_0, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F), t_1);
} else {
tmp = fma(-1.0, ((x * cos(B)) / sin(B)), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1e+81) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5e+121) tmp = fma(t_0, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F), t_1); else tmp = fma(-1.0, Float64(Float64(x * cos(B)) / sin(B)), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+81], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5e+121], N[(t$95$0 * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+121}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{x \cdot \cos B}{\sin B}, t\_0\right)\\
\end{array}
\end{array}
if F < -9.99999999999999921e80Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
Taylor expanded in F around -inf
Applied rewrites55.6%
if -9.99999999999999921e80 < F < 5.00000000000000007e121Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
if 5.00000000000000007e121 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in F around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-sin.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1e+81)
(fma t_0 -1.0 t_1)
(if (<= F 1.8e+95)
(fma t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) t_1)
(fma (- (/ x (* (tan B) F))) F t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1e+81) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 1.8e+95) {
tmp = fma(t_0, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F), t_1);
} else {
tmp = fma(-(x / (tan(B) * F)), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1e+81) tmp = fma(t_0, -1.0, t_1); elseif (F <= 1.8e+95) tmp = fma(t_0, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F), t_1); else tmp = fma(Float64(-Float64(x / Float64(tan(B) * F))), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+81], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.8e+95], N[(t$95$0 * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], N[((-N[(x / N[(N[Tan[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]) * F + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{\tan B \cdot F}, F, t\_0\right)\\
\end{array}
\end{array}
if F < -9.99999999999999921e80Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
Taylor expanded in F around -inf
Applied rewrites55.6%
if -9.99999999999999921e80 < F < 1.79999999999999989e95Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
if 1.79999999999999989e95 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -8e+58)
(fma t_0 -1.0 t_1)
(if (<= F 2.2e+100)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_1)
(fma (- (/ x (* (tan B) F))) F t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -8e+58) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 2.2e+100) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_1);
} else {
tmp = fma(-(x / (tan(B) * F)), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -8e+58) tmp = fma(t_0, -1.0, t_1); elseif (F <= 2.2e+100) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_1); else tmp = fma(Float64(-Float64(x / Float64(tan(B) * F))), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+58], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 2.2e+100], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[((-N[(x / N[(N[Tan[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]) * F + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{+100}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{\tan B \cdot F}, F, t\_0\right)\\
\end{array}
\end{array}
if F < -7.99999999999999955e58Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
Taylor expanded in F around -inf
Applied rewrites55.6%
if -7.99999999999999955e58 < F < 2.2000000000000001e100Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.8%
if 2.2000000000000001e100 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -3.6e+52)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F 2.2e+90)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(fma (- (/ x (* (tan B) F))) F t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -3.6e+52) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= 2.2e+90) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = fma(-(x / (tan(B) * F)), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -3.6e+52) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= 2.2e+90) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); else tmp = fma(Float64(-Float64(x / Float64(tan(B) * F))), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.6e+52], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.2e+90], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / N[(N[Tan[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]) * F + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -3.6 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{+90}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{\tan B \cdot F}, F, t\_0\right)\\
\end{array}
\end{array}
if F < -3.6e52Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
Taylor expanded in F around -inf
Applied rewrites55.6%
if -3.6e52 < F < 2.1999999999999999e90Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
if 2.1999999999999999e90 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -2.3e+30)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F 0.0098)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F (sin B))) (/ x (tan B)))
(fma (- (/ x (* (tan B) F))) F t_0)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -2.3e+30) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= 0.0098) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = fma(-(x / (tan(B) * F)), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -2.3e+30) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= 0.0098) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); else tmp = fma(Float64(-Float64(x / Float64(tan(B) * F))), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e+30], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0098], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / N[(N[Tan[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]) * F + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 0.0098:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{\tan B \cdot F}, F, t\_0\right)\\
\end{array}
\end{array}
if F < -2.3e30Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
Taylor expanded in F around -inf
Applied rewrites55.6%
if -2.3e30 < F < 0.0097999999999999997Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in F around 0
Applied rewrites55.1%
if 0.0097999999999999997 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -14000.0)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F -1.75e-85)
(+
(- (* x (/ 1.0 B)))
(/ 1.0 (/ (sin B) (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F))))
(if (<= F 270000.0)
(-
(/ 1.0 (/ B (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)))
(/ x (tan B)))
(fma (- (/ x (* (tan B) F))) F t_0))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -14000.0) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= -1.75e-85) {
tmp = -(x * (1.0 / B)) + (1.0 / (sin(B) / (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F)));
} else if (F <= 270000.0) {
tmp = (1.0 / (B / (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F))) - (x / tan(B));
} else {
tmp = fma(-(x / (tan(B) * F)), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -14000.0) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= -1.75e-85) tmp = Float64(Float64(-Float64(x * Float64(1.0 / B))) + Float64(1.0 / Float64(sin(B) / Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F)))); elseif (F <= 270000.0) tmp = Float64(Float64(1.0 / Float64(B / Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F))) - Float64(x / tan(B))); else tmp = fma(Float64(-Float64(x / Float64(tan(B) * F))), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -14000.0], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.75e-85], N[((-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 270000.0], N[(N[(1.0 / N[(B / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / N[(N[Tan[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]) * F + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -14000:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq -1.75 \cdot 10^{-85}:\\
\;\;\;\;\left(-x \cdot \frac{1}{B}\right) + \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}}\\
\mathbf{elif}\;F \leq 270000:\\
\;\;\;\;\frac{1}{\frac{B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{\tan B \cdot F}, F, t\_0\right)\\
\end{array}
\end{array}
if F < -14000Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
Taylor expanded in F around -inf
Applied rewrites55.6%
if -14000 < F < -1.74999999999999989e-85Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites49.7%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites57.7%
if -1.74999999999999989e-85 < F < 2.7e5Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-flipN/A
lower-unsound-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
*-commutativeN/A
Applied rewrites70.0%
if 2.7e5 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(if (<= F -14000.0)
(fma (/ 1.0 (sin B)) -1.0 (/ (- x) (tan B)))
(if (<= F -1.75e-85)
(+
(- (* x (/ 1.0 B)))
(/ 1.0 (/ (sin B) (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F))))
(if (<= F 270000.0)
(-
(/ 1.0 (/ B (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)))
(/ x (tan B)))
(* (/ (fma (cos B) (- x) 1.0) (* (sin B) F)) F)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -14000.0) {
tmp = fma((1.0 / sin(B)), -1.0, (-x / tan(B)));
} else if (F <= -1.75e-85) {
tmp = -(x * (1.0 / B)) + (1.0 / (sin(B) / (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F)));
} else if (F <= 270000.0) {
tmp = (1.0 / (B / (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F))) - (x / tan(B));
} else {
tmp = (fma(cos(B), -x, 1.0) / (sin(B) * F)) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -14000.0) tmp = fma(Float64(1.0 / sin(B)), -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= -1.75e-85) tmp = Float64(Float64(-Float64(x * Float64(1.0 / B))) + Float64(1.0 / Float64(sin(B) / Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F)))); elseif (F <= 270000.0) tmp = Float64(Float64(1.0 / Float64(B / Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F))) - Float64(x / tan(B))); else tmp = Float64(Float64(fma(cos(B), Float64(-x), 1.0) / Float64(sin(B) * F)) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -14000.0], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.75e-85], N[((-N[(x * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 270000.0], N[(N[(1.0 / N[(B / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cos[B], $MachinePrecision] * (-x) + 1.0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -14000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq -1.75 \cdot 10^{-85}:\\
\;\;\;\;\left(-x \cdot \frac{1}{B}\right) + \frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}}\\
\mathbf{elif}\;F \leq 270000:\\
\;\;\;\;\frac{1}{\frac{B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, 1\right)}{\sin B \cdot F} \cdot F\\
\end{array}
\end{array}
if F < -14000Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.9%
Taylor expanded in F around -inf
Applied rewrites55.6%
if -14000 < F < -1.74999999999999989e-85Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites49.7%
lift-*.f64N/A
*-commutativeN/A
Applied rewrites57.7%
if -1.74999999999999989e-85 < F < 2.7e5Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-flipN/A
lower-unsound-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
*-commutativeN/A
Applied rewrites70.0%
if 2.7e5 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6447.4
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (sin B) F)))
(if (<= F -2e+205)
(* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 t_0))))
(if (<= F 270000.0)
(-
(/ 1.0 (/ B (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)))
(/ x (tan B)))
(* (/ (fma (cos B) (- x) 1.0) t_0) F)))))
double code(double F, double B, double x) {
double t_0 = sin(B) * F;
double tmp;
if (F <= -2e+205) {
tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / t_0)));
} else if (F <= 270000.0) {
tmp = (1.0 / (B / (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F))) - (x / tan(B));
} else {
tmp = (fma(cos(B), -x, 1.0) / t_0) * F;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(sin(B) * F) tmp = 0.0 if (F <= -2e+205) tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / t_0)))); elseif (F <= 270000.0) tmp = Float64(Float64(1.0 / Float64(B / Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F))) - Float64(x / tan(B))); else tmp = Float64(Float64(fma(cos(B), Float64(-x), 1.0) / t_0) * F); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]}, If[LessEqual[F, -2e+205], N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 270000.0], N[(N[(1.0 / N[(B / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Cos[B], $MachinePrecision] * (-x) + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision] * F), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin B \cdot F\\
\mathbf{if}\;F \leq -2 \cdot 10^{+205}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{t\_0}\right|\right)\\
\mathbf{elif}\;F \leq 270000:\\
\;\;\;\;\frac{1}{\frac{B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, 1\right)}{t\_0} \cdot F\\
\end{array}
\end{array}
if F < -2.00000000000000003e205Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6416.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-exp.f64N/A
exp-fabsN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
inv-powN/A
lift-*.f64N/A
lift-sin.f64N/A
lower-fabs.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lower-/.f6432.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6432.8
Applied rewrites32.8%
if -2.00000000000000003e205 < F < 2.7e5Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-flipN/A
lower-unsound-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
*-commutativeN/A
Applied rewrites70.0%
if 2.7e5 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6447.4
Applied rewrites50.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (* x (/ 1.0 (tan B))))
(*
(/ F (sin B))
(pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(t_1
(-
(/ 1.0 (/ B (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F)))
(/ x (tan B)))))
(if (<= t_0 -200000.0)
t_1
(if (<= t_0 10.0)
(fma
(/ 1.0 (sin B))
(* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F)
(/ (- x) B))
(if (<= t_0 4e+290)
t_1
(* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* (sin B) F))))))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
double t_1 = (1.0 / (B / (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F))) - (x / tan(B));
double tmp;
if (t_0 <= -200000.0) {
tmp = t_1;
} else if (t_0 <= 10.0) {
tmp = fma((1.0 / sin(B)), (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), (-x / B));
} else if (t_0 <= 4e+290) {
tmp = t_1;
} else {
tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (sin(B) * F))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) t_1 = Float64(Float64(1.0 / Float64(B / Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F))) - Float64(x / tan(B))) tmp = 0.0 if (t_0 <= -200000.0) tmp = t_1; elseif (t_0 <= 10.0) tmp = fma(Float64(1.0 / sin(B)), Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), Float64(Float64(-x) / B)); elseif (t_0 <= 4e+290) tmp = t_1; else tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(sin(B) * F))))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / N[(B / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200000.0], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+290], t$95$1, N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
t_1 := \frac{1}{\frac{B}{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -200000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{-x}{B}\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e5 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 4.00000000000000025e290Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
div-flipN/A
lower-unsound-/.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift-neg.f64N/A
*-commutativeN/A
Applied rewrites70.0%
if -2e5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites49.7%
Applied rewrites57.7%
if 4.00000000000000025e290 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6416.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-exp.f64N/A
exp-fabsN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
inv-powN/A
lift-*.f64N/A
lift-sin.f64N/A
lower-fabs.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lower-/.f6432.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6432.8
Applied rewrites32.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (* x (/ 1.0 (tan B))))
(*
(/ F (sin B))
(pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(t_1
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))))
(if (<= t_0 -200000.0)
t_1
(if (<= t_0 10.0)
(fma
(/ 1.0 (sin B))
(* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F)
(/ (- x) B))
(if (<= t_0 4e+290)
t_1
(* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* (sin B) F))))))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
double t_1 = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
double tmp;
if (t_0 <= -200000.0) {
tmp = t_1;
} else if (t_0 <= 10.0) {
tmp = fma((1.0 / sin(B)), (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), (-x / B));
} else if (t_0 <= 4e+290) {
tmp = t_1;
} else {
tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (sin(B) * F))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) t_1 = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))) tmp = 0.0 if (t_0 <= -200000.0) tmp = t_1; elseif (t_0 <= 10.0) tmp = fma(Float64(1.0 / sin(B)), Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), Float64(Float64(-x) / B)); elseif (t_0 <= 4e+290) tmp = t_1; else tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(sin(B) * F))))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200000.0], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+290], t$95$1, N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
t_1 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -200000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, \frac{-x}{B}\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e5 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 4.00000000000000025e290Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
if -2e5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites49.7%
Applied rewrites57.7%
if 4.00000000000000025e290 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6416.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-exp.f64N/A
exp-fabsN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
inv-powN/A
lift-*.f64N/A
lift-sin.f64N/A
lower-fabs.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lower-/.f6432.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6432.8
Applied rewrites32.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(- (* x (/ 1.0 (tan B))))
(*
(/ F (sin B))
(pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
(t_1
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))))
(if (<= t_0 -200000.0)
t_1
(if (<= t_0 10.0)
(fma F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B))
(if (<= t_0 4e+290)
t_1
(* F (fma -1.0 (/ x (* B F)) (fabs (/ 1.0 (* (sin B) F))))))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
double t_1 = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
double tmp;
if (t_0 <= -200000.0) {
tmp = t_1;
} else if (t_0 <= 10.0) {
tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
} else if (t_0 <= 4e+290) {
tmp = t_1;
} else {
tmp = F * fma(-1.0, (x / (B * F)), fabs((1.0 / (sin(B) * F))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) t_1 = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))) tmp = 0.0 if (t_0 <= -200000.0) tmp = t_1; elseif (t_0 <= 10.0) tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / B)); elseif (t_0 <= 4e+290) tmp = t_1; else tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), abs(Float64(1.0 / Float64(sin(B) * F))))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200000.0], t$95$1, If[LessEqual[t$95$0, 10.0], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 4e+290], t$95$1, N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[Abs[N[(1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
t_1 := {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq -200000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+290}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \left|\frac{1}{\sin B \cdot F}\right|\right)\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -2e5 or 10 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 4.00000000000000025e290Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
if -2e5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 10Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites49.7%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites57.7%
if 4.00000000000000025e290 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6416.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-exp.f64N/A
exp-fabsN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
inv-powN/A
lift-*.f64N/A
lift-sin.f64N/A
lower-fabs.f64N/A
lift-sin.f64N/A
lift-*.f64N/A
lower-/.f6432.8
lift-*.f64N/A
*-commutativeN/A
lift-*.f6432.8
Applied rewrites32.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+154)
(/ -1.0 (sin B))
(if (<= F -1.75e-85)
(fma F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) (/ (- x) B))
(if (<= F 9.8e+42)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(fma (- (/ x (* B F))) F (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+154) {
tmp = -1.0 / sin(B);
} else if (F <= -1.75e-85) {
tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / B));
} else if (F <= 9.8e+42) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else {
tmp = fma(-(x / (B * F)), F, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+154) tmp = Float64(-1.0 / sin(B)); elseif (F <= -1.75e-85) tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / B)); elseif (F <= 9.8e+42) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); else tmp = fma(Float64(-Float64(x / Float64(B * F))), F, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+154], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.75e-85], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.8e+42], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]) * F + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -1.75 \cdot 10^{-85}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{B}\right)\\
\mathbf{elif}\;F \leq 9.8 \cdot 10^{+42}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.35000000000000003e154Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -1.35000000000000003e154 < F < -1.74999999999999989e-85Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites49.7%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites57.7%
if -1.74999999999999989e-85 < F < 9.8000000000000004e42Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in F around 0
Applied rewrites48.8%
if 9.8000000000000004e42 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites34.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.8e+147)
(/ -1.0 (sin B))
(if (<= F -1.75e-85)
(- (* (/ F (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5)) (/ x B))
(if (<= F 9.8e+42)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(fma (- (/ x (* B F))) F (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e+147) {
tmp = -1.0 / sin(B);
} else if (F <= -1.75e-85) {
tmp = ((F / sin(B)) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)) - (x / B);
} else if (F <= 9.8e+42) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else {
tmp = fma(-(x / (B * F)), F, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.8e+147) tmp = Float64(-1.0 / sin(B)); elseif (F <= -1.75e-85) tmp = Float64(Float64(Float64(F / sin(B)) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 9.8e+42) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); else tmp = fma(Float64(-Float64(x / Float64(B * F))), F, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.8e+147], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.75e-85], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.8e+42], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]) * F + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{+147}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -1.75 \cdot 10^{-85}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9.8 \cdot 10^{+42}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.8000000000000001e147Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -1.8000000000000001e147 < F < -1.74999999999999989e-85Initial program 77.7%
Taylor expanded in B around 0
Applied rewrites49.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.7
Applied rewrites49.7%
if -1.74999999999999989e-85 < F < 9.8000000000000004e42Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in F around 0
Applied rewrites48.8%
if 9.8000000000000004e42 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites34.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (* B F)))) (t_1 (/ 1.0 (sin B))))
(if (<= F -2.3e+30)
(* F (fma (/ 1.0 (fabs F)) (fabs t_1) t_0))
(if (<= F 9.8e+42)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F B)) (/ x (tan B)))
(fma t_0 F t_1)))))
double code(double F, double B, double x) {
double t_0 = -(x / (B * F));
double t_1 = 1.0 / sin(B);
double tmp;
if (F <= -2.3e+30) {
tmp = F * fma((1.0 / fabs(F)), fabs(t_1), t_0);
} else if (F <= 9.8e+42) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / B)) - (x / tan(B));
} else {
tmp = fma(t_0, F, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / Float64(B * F))) t_1 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -2.3e+30) tmp = Float64(F * fma(Float64(1.0 / abs(F)), abs(t_1), t_0)); elseif (F <= 9.8e+42) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); else tmp = fma(t_0, F, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e+30], N[(F * N[(N[(1.0 / N[Abs[F], $MachinePrecision]), $MachinePrecision] * N[Abs[t$95$1], $MachinePrecision] + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.8e+42], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * F + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B \cdot F}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(\frac{1}{\left|F\right|}, \left|t\_1\right|, t\_0\right)\\
\mathbf{elif}\;F \leq 9.8 \cdot 10^{+42}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, F, t\_1\right)\\
\end{array}
\end{array}
if F < -2.3e30Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6416.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-fma.f64N/A
+-commutativeN/A
lift-exp.f64N/A
exp-fabsN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
lift-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
inv-powN/A
lift-/.f64N/A
inv-powN/A
lift-/.f64N/A
fabs-mulN/A
Applied rewrites34.1%
if -2.3e30 < F < 9.8000000000000004e42Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in F around 0
Applied rewrites48.8%
if 9.8000000000000004e42 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites34.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= B 7.4e-227)
(* F (fma (/ 1.0 (fabs F)) (fabs (/ 1.0 (sin B))) (- (/ x (* B F)))))
(if (<= B 8e-14)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(if (<= B 6e+35) (* (- (/ t_0 F)) F) (- (* (/ 1.0 F) (/ F B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (B <= 7.4e-227) {
tmp = F * fma((1.0 / fabs(F)), fabs((1.0 / sin(B))), -(x / (B * F)));
} else if (B <= 8e-14) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else if (B <= 6e+35) {
tmp = -(t_0 / F) * F;
} else {
tmp = ((1.0 / F) * (F / B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (B <= 7.4e-227) tmp = Float64(F * fma(Float64(1.0 / abs(F)), abs(Float64(1.0 / sin(B))), Float64(-Float64(x / Float64(B * F))))); elseif (B <= 8e-14) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); elseif (B <= 6e+35) tmp = Float64(Float64(-Float64(t_0 / F)) * F); else tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 7.4e-227], N[(F * N[(N[(1.0 / N[Abs[F], $MachinePrecision]), $MachinePrecision] * N[Abs[N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 8e-14], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 6e+35], N[((-N[(t$95$0 / F), $MachinePrecision]) * F), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;B \leq 7.4 \cdot 10^{-227}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(\frac{1}{\left|F\right|}, \left|\frac{1}{\sin B}\right|, -\frac{x}{B \cdot F}\right)\\
\mathbf{elif}\;B \leq 8 \cdot 10^{-14}:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{elif}\;B \leq 6 \cdot 10^{+35}:\\
\;\;\;\;\left(-\frac{t\_0}{F}\right) \cdot F\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - t\_0\\
\end{array}
\end{array}
if B < 7.39999999999999957e-227Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-/.f64N/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f6416.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6416.6
Applied rewrites16.6%
lift-fma.f64N/A
+-commutativeN/A
lift-exp.f64N/A
exp-fabsN/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
lift-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
inv-powN/A
lift-/.f64N/A
inv-powN/A
lift-/.f64N/A
fabs-mulN/A
Applied rewrites34.1%
if 7.39999999999999957e-227 < B < 7.99999999999999999e-14Initial program 77.7%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites42.7%
if 7.99999999999999999e-14 < B < 5.99999999999999981e35Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6446.1
Applied rewrites46.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.1
Applied rewrites48.0%
if 5.99999999999999981e35 < B Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in F around inf
lower-/.f6447.0
Applied rewrites47.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= B 8e-14)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B)
(if (<= B 6e+35) (* (- (/ t_0 F)) F) (- (* (/ 1.0 F) (/ F B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (B <= 8e-14) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else if (B <= 6e+35) {
tmp = -(t_0 / F) * F;
} else {
tmp = ((1.0 / F) * (F / B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (B <= 8e-14) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); elseif (B <= 6e+35) tmp = Float64(Float64(-Float64(t_0 / F)) * F); else tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[B, 8e-14], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 6e+35], N[((-N[(t$95$0 / F), $MachinePrecision]) * F), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;B \leq 8 \cdot 10^{-14}:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{elif}\;B \leq 6 \cdot 10^{+35}:\\
\;\;\;\;\left(-\frac{t\_0}{F}\right) \cdot F\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - t\_0\\
\end{array}
\end{array}
if B < 7.99999999999999999e-14Initial program 77.7%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites42.7%
if 7.99999999999999999e-14 < B < 5.99999999999999981e35Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6446.1
Applied rewrites46.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.1
Applied rewrites48.0%
if 5.99999999999999981e35 < B Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in F around inf
lower-/.f6447.0
Applied rewrites47.0%
(FPCore (F B x) :precision binary64 (if (<= B 8e-14) (/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) B) (* (- (/ (/ x (tan B)) F)) F)))
double code(double F, double B, double x) {
double tmp;
if (B <= 8e-14) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / B;
} else {
tmp = -((x / tan(B)) / F) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 8e-14) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / B); else tmp = Float64(Float64(-Float64(Float64(x / tan(B)) / F)) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 8e-14], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-N[(N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]) * F), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 8 \cdot 10^{-14}:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\frac{x}{\tan B}}{F}\right) \cdot F\\
\end{array}
\end{array}
if B < 7.99999999999999999e-14Initial program 77.7%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites42.7%
if 7.99999999999999999e-14 < B Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6446.1
Applied rewrites46.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.1
Applied rewrites48.0%
(FPCore (F B x)
:precision binary64
(if (<= B 9.2e-220)
(/ (* -1.0 x) B)
(if (<= B 8e-14)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(* (- (/ (/ x (tan B)) F)) F))))
double code(double F, double B, double x) {
double tmp;
if (B <= 9.2e-220) {
tmp = (-1.0 * x) / B;
} else if (B <= 8e-14) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = -((x / tan(B)) / F) * F;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 9.2e-220) tmp = Float64(Float64(-1.0 * x) / B); elseif (B <= 8e-14) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(-Float64(Float64(x / tan(B)) / F)) * F); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 9.2e-220], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 8e-14], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-N[(N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision]) * F), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9.2 \cdot 10^{-220}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{elif}\;B \leq 8 \cdot 10^{-14}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\frac{x}{\tan B}}{F}\right) \cdot F\\
\end{array}
\end{array}
if B < 9.19999999999999922e-220Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in x around inf
lower-*.f6428.8
Applied rewrites28.8%
if 9.19999999999999922e-220 < B < 7.99999999999999999e-14Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in B around 0
lower-/.f6434.7
Applied rewrites34.7%
if 7.99999999999999999e-14 < B Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f6446.1
Applied rewrites46.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6446.1
Applied rewrites48.0%
(FPCore (F B x)
:precision binary64
(if (<= F -8.5e+43)
(/ -1.0 (sin B))
(if (<= F 4e+28)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 8e+188)
(/
(+
1.0
(fma
-1.0
x
(*
(pow B 2.0)
(+
0.16666666666666666
(* -1.0 (- (* -0.5 x) (* -0.16666666666666666 x)))))))
B)
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e+43) {
tmp = -1.0 / sin(B);
} else if (F <= 4e+28) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 8e+188) {
tmp = (1.0 + fma(-1.0, x, (pow(B, 2.0) * (0.16666666666666666 + (-1.0 * ((-0.5 * x) - (-0.16666666666666666 * x))))))) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8.5e+43) tmp = Float64(-1.0 / sin(B)); elseif (F <= 4e+28) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 8e+188) tmp = Float64(Float64(1.0 + fma(-1.0, x, Float64((B ^ 2.0) * Float64(0.16666666666666666 + Float64(-1.0 * Float64(Float64(-0.5 * x) - Float64(-0.16666666666666666 * x))))))) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8.5e+43], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e+28], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+188], N[(N[(1.0 + N[(-1.0 * x + N[(N[Power[B, 2.0], $MachinePrecision] * N[(0.16666666666666666 + N[(-1.0 * N[(N[(-0.5 * x), $MachinePrecision] - N[(-0.16666666666666666 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+28}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+188}:\\
\;\;\;\;\frac{1 + \mathsf{fma}\left(-1, x, {B}^{2} \cdot \left(0.16666666666666666 + -1 \cdot \left(-0.5 \cdot x - -0.16666666666666666 \cdot x\right)\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -8.5e43Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -8.5e43 < F < 3.99999999999999983e28Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in B around 0
lower-/.f6434.7
Applied rewrites34.7%
if 3.99999999999999983e28 < F < 8.0000000000000002e188Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites34.0%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites28.7%
if 8.0000000000000002e188 < F Initial program 77.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8
Applied rewrites16.8%
(FPCore (F B x)
:precision binary64
(if (<= F -8.5e+43)
(/ -1.0 (sin B))
(if (<= F 8.5e+88)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(if (<= F 8e+188)
(fma
(- (/ x (* B F)))
F
(/ (+ 1.0 (* 0.16666666666666666 (pow B 2.0))) B))
(/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.5e+43) {
tmp = -1.0 / sin(B);
} else if (F <= 8.5e+88) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else if (F <= 8e+188) {
tmp = fma(-(x / (B * F)), F, ((1.0 + (0.16666666666666666 * pow(B, 2.0))) / B));
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8.5e+43) tmp = Float64(-1.0 / sin(B)); elseif (F <= 8.5e+88) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); elseif (F <= 8e+188) tmp = fma(Float64(-Float64(x / Float64(B * F))), F, Float64(Float64(1.0 + Float64(0.16666666666666666 * (B ^ 2.0))) / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8.5e+43], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.5e+88], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+188], N[((-N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]) * F + N[(N[(1.0 + N[(0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8.5 \cdot 10^{+88}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+188}:\\
\;\;\;\;\mathsf{fma}\left(-\frac{x}{B \cdot F}, F, \frac{1 + 0.16666666666666666 \cdot {B}^{2}}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -8.5e43Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -8.5e43 < F < 8.5000000000000005e88Initial program 77.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.7
Applied rewrites77.8%
Taylor expanded in B around 0
Applied rewrites62.0%
Taylor expanded in B around 0
lower-/.f6434.7
Applied rewrites34.7%
if 8.5000000000000005e88 < F < 8.0000000000000002e188Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f6431.3
Applied rewrites31.3%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
associate-*l/N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lower-fma.f64N/A
Applied rewrites34.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6426.6
Applied rewrites26.6%
if 8.0000000000000002e188 < F Initial program 77.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8
Applied rewrites16.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2.3e+30)
(/ -1.0 (sin B))
(if (<= F 8e-40)
(/ (* -1.0 x) B)
(if (<= F 8e+188) (/ (* -1.0 (- x 1.0)) B) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+30) {
tmp = -1.0 / sin(B);
} else if (F <= 8e-40) {
tmp = (-1.0 * x) / B;
} else if (F <= 8e+188) {
tmp = (-1.0 * (x - 1.0)) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.3d+30)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 8d-40) then
tmp = ((-1.0d0) * x) / b
else if (f <= 8d+188) then
tmp = ((-1.0d0) * (x - 1.0d0)) / b
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+30) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 8e-40) {
tmp = (-1.0 * x) / B;
} else if (F <= 8e+188) {
tmp = (-1.0 * (x - 1.0)) / B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e+30: tmp = -1.0 / math.sin(B) elif F <= 8e-40: tmp = (-1.0 * x) / B elif F <= 8e+188: tmp = (-1.0 * (x - 1.0)) / B else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e+30) tmp = Float64(-1.0 / sin(B)); elseif (F <= 8e-40) tmp = Float64(Float64(-1.0 * x) / B); elseif (F <= 8e+188) tmp = Float64(Float64(-1.0 * Float64(x - 1.0)) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.3e+30) tmp = -1.0 / sin(B); elseif (F <= 8e-40) tmp = (-1.0 * x) / B; elseif (F <= 8e+188) tmp = (-1.0 * (x - 1.0)) / B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e+30], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-40], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e+188], N[(N[(-1.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+188}:\\
\;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.3e30Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -2.3e30 < F < 7.9999999999999994e-40Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in x around inf
lower-*.f6428.8
Applied rewrites28.8%
if 7.9999999999999994e-40 < F < 8.0000000000000002e188Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in F around -inf
lower-*.f64N/A
lower--.f6429.0
Applied rewrites29.0%
if 8.0000000000000002e188 < F Initial program 77.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.8
Applied rewrites16.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.3e+30) (/ -1.0 (sin B)) (if (<= F 8e-40) (/ (* -1.0 x) B) (/ (* -1.0 (- x 1.0)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+30) {
tmp = -1.0 / sin(B);
} else if (F <= 8e-40) {
tmp = (-1.0 * x) / B;
} else {
tmp = (-1.0 * (x - 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.3d+30)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 8d-40) then
tmp = ((-1.0d0) * x) / b
else
tmp = ((-1.0d0) * (x - 1.0d0)) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+30) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 8e-40) {
tmp = (-1.0 * x) / B;
} else {
tmp = (-1.0 * (x - 1.0)) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e+30: tmp = -1.0 / math.sin(B) elif F <= 8e-40: tmp = (-1.0 * x) / B else: tmp = (-1.0 * (x - 1.0)) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e+30) tmp = Float64(-1.0 / sin(B)); elseif (F <= 8e-40) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(Float64(-1.0 * Float64(x - 1.0)) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.3e+30) tmp = -1.0 / sin(B); elseif (F <= 8e-40) tmp = (-1.0 * x) / B; else tmp = (-1.0 * (x - 1.0)) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e+30], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-40], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{+30}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\
\end{array}
\end{array}
if F < -2.3e30Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
if -2.3e30 < F < 7.9999999999999994e-40Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in x around inf
lower-*.f6428.8
Applied rewrites28.8%
if 7.9999999999999994e-40 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in F around -inf
lower-*.f64N/A
lower--.f6429.0
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (if (<= F -5.6e+34) (/ -1.0 B) (if (<= F 8e-40) (/ (* -1.0 x) B) (/ (* -1.0 (- x 1.0)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e+34) {
tmp = -1.0 / B;
} else if (F <= 8e-40) {
tmp = (-1.0 * x) / B;
} else {
tmp = (-1.0 * (x - 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 <= (-5.6d+34)) then
tmp = (-1.0d0) / b
else if (f <= 8d-40) then
tmp = ((-1.0d0) * x) / b
else
tmp = ((-1.0d0) * (x - 1.0d0)) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e+34) {
tmp = -1.0 / B;
} else if (F <= 8e-40) {
tmp = (-1.0 * x) / B;
} else {
tmp = (-1.0 * (x - 1.0)) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.6e+34: tmp = -1.0 / B elif F <= 8e-40: tmp = (-1.0 * x) / B else: tmp = (-1.0 * (x - 1.0)) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.6e+34) tmp = Float64(-1.0 / B); elseif (F <= 8e-40) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(Float64(-1.0 * Float64(x - 1.0)) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.6e+34) tmp = -1.0 / B; elseif (F <= 8e-40) tmp = (-1.0 * x) / B; else tmp = (-1.0 * (x - 1.0)) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.6e+34], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 8e-40], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 * N[(x - 1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{+34}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-40}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot \left(x - 1\right)}{B}\\
\end{array}
\end{array}
if F < -5.60000000000000016e34Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.1%
if -5.60000000000000016e34 < F < 7.9999999999999994e-40Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in x around inf
lower-*.f6428.8
Applied rewrites28.8%
if 7.9999999999999994e-40 < F Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in F around -inf
lower-*.f64N/A
lower--.f6429.0
Applied rewrites29.0%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (* -1.0 x) B))) (if (<= x -6e-154) t_0 (if (<= x 5.6e-101) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = (-1.0 * x) / B;
double tmp;
if (x <= -6e-154) {
tmp = t_0;
} else if (x <= 5.6e-101) {
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 = ((-1.0d0) * x) / b
if (x <= (-6d-154)) then
tmp = t_0
else if (x <= 5.6d-101) 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 = (-1.0 * x) / B;
double tmp;
if (x <= -6e-154) {
tmp = t_0;
} else if (x <= 5.6e-101) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 * x) / B tmp = 0 if x <= -6e-154: tmp = t_0 elif x <= 5.6e-101: tmp = -1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 * x) / B) tmp = 0.0 if (x <= -6e-154) tmp = t_0; elseif (x <= 5.6e-101) tmp = Float64(-1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 * x) / B; tmp = 0.0; if (x <= -6e-154) tmp = t_0; elseif (x <= 5.6e-101) tmp = -1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[x, -6e-154], t$95$0, If[LessEqual[x, 5.6e-101], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1 \cdot x}{B}\\
\mathbf{if}\;x \leq -6 \cdot 10^{-154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{-101}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.0000000000000005e-154 or 5.59999999999999978e-101 < x Initial program 77.7%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6428.0
Applied rewrites28.0%
Taylor expanded in x around inf
lower-*.f6428.8
Applied rewrites28.8%
if -6.0000000000000005e-154 < x < 5.59999999999999978e-101Initial program 77.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.1%
(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.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.2
Applied rewrites17.2%
Taylor expanded in B around 0
Applied rewrites10.1%
herbie shell --seed 2025157
(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))))))