
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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 (* F (sin B))) (t_1 (- (* x (/ 1.0 (tan B))))))
(if (<= F -1e+115)
(+ t_1 (- (* F (+ (- (/ (/ (+ 1.0 x) t_0) (* F F))) (/ 1.0 t_0)))))
(if (<= F 5.2e+66)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(+
t_1
(fma
F
(/ (/ 1.0 F) (sin B))
(- (/ (* (* (/ 1.0 F) x) F) (* (fma F F 2.0) (sin B))))))))))
double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = -(x * (1.0 / tan(B)));
double tmp;
if (F <= -1e+115) {
tmp = t_1 + -(F * (-(((1.0 + x) / t_0) / (F * F)) + (1.0 / t_0)));
} else if (F <= 5.2e+66) {
tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = t_1 + fma(F, ((1.0 / F) / sin(B)), -((((1.0 / F) * x) * F) / (fma(F, F, 2.0) * sin(B))));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(-Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (F <= -1e+115) tmp = Float64(t_1 + Float64(-Float64(F * Float64(Float64(-Float64(Float64(Float64(1.0 + x) / t_0) / Float64(F * F))) + Float64(1.0 / t_0))))); elseif (F <= 5.2e+66) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(t_1 + fma(F, Float64(Float64(1.0 / F) / sin(B)), Float64(-Float64(Float64(Float64(Float64(1.0 / F) * x) * F) / Float64(fma(F, F, 2.0) * sin(B)))))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -1e+115], N[(t$95$1 + (-N[(F * N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5.2e+66], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(N[(N[(N[(1.0 / F), $MachinePrecision] * x), $MachinePrecision] * F), $MachinePrecision] / N[(N[(F * F + 2.0), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := -x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+115}:\\
\;\;\;\;t\_1 + \left(-F \cdot \left(\left(-\frac{\frac{1 + x}{t\_0}}{F \cdot F}\right) + \frac{1}{t\_0}\right)\right)\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+66}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \mathsf{fma}\left(F, \frac{\frac{1}{F}}{\sin B}, -\frac{\left(\frac{1}{F} \cdot x\right) \cdot F}{\mathsf{fma}\left(F, F, 2\right) \cdot \sin B}\right)\\
\end{array}
\end{array}
if F < -1e115Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied rewrites83.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-+.f64N/A
Applied rewrites39.9%
if -1e115 < F < 5.20000000000000024e66Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
if 5.20000000000000024e66 < F Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied rewrites83.3%
Taylor expanded in F around inf
lower-/.f6451.8
Applied rewrites51.8%
Taylor expanded in F around inf
lower-/.f6444.3
Applied rewrites44.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))) (t_1 (* (sin B) F)))
(if (<= F -1e+115)
(+
(- (* x (/ 1.0 (tan B))))
(- (* F (+ (- (/ (/ (+ 1.0 x) t_0) (* F F))) (/ 1.0 t_0)))))
(if (<= F 8e+82)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(* (+ (/ 1.0 t_1) (- (/ (* (cos B) x) t_1))) F)))))
double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = sin(B) * F;
double tmp;
if (F <= -1e+115) {
tmp = -(x * (1.0 / tan(B))) + -(F * (-(((1.0 + x) / t_0) / (F * F)) + (1.0 / t_0)));
} else if (F <= 8e+82) {
tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = ((1.0 / t_1) + -((cos(B) * x) / t_1)) * F;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = f * sin(b)
t_1 = sin(b) * f
if (f <= (-1d+115)) then
tmp = -(x * (1.0d0 / tan(b))) + -(f * (-(((1.0d0 + x) / t_0) / (f * f)) + (1.0d0 / t_0)))
else if (f <= 8d+82) then
tmp = -((x * 1.0d0) / tan(b)) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = ((1.0d0 / t_1) + -((cos(b) * x) / t_1)) * f
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F * Math.sin(B);
double t_1 = Math.sin(B) * F;
double tmp;
if (F <= -1e+115) {
tmp = -(x * (1.0 / Math.tan(B))) + -(F * (-(((1.0 + x) / t_0) / (F * F)) + (1.0 / t_0)));
} else if (F <= 8e+82) {
tmp = -((x * 1.0) / Math.tan(B)) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = ((1.0 / t_1) + -((Math.cos(B) * x) / t_1)) * F;
}
return tmp;
}
def code(F, B, x): t_0 = F * math.sin(B) t_1 = math.sin(B) * F tmp = 0 if F <= -1e+115: tmp = -(x * (1.0 / math.tan(B))) + -(F * (-(((1.0 + x) / t_0) / (F * F)) + (1.0 / t_0))) elif F <= 8e+82: tmp = -((x * 1.0) / math.tan(B)) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = ((1.0 / t_1) + -((math.cos(B) * x) / t_1)) * F return tmp
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(sin(B) * F) tmp = 0.0 if (F <= -1e+115) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(-Float64(F * Float64(Float64(-Float64(Float64(Float64(1.0 + x) / t_0) / Float64(F * F))) + Float64(1.0 / t_0))))); elseif (F <= 8e+82) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(Float64(Float64(1.0 / t_1) + Float64(-Float64(Float64(cos(B) * x) / t_1))) * F); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F * sin(B); t_1 = sin(B) * F; tmp = 0.0; if (F <= -1e+115) tmp = -(x * (1.0 / tan(B))) + -(F * (-(((1.0 + x) / t_0) / (F * F)) + (1.0 / t_0))); elseif (F <= 8e+82) tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = ((1.0 / t_1) + -((cos(B) * x) / t_1)) * F; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]}, If[LessEqual[F, -1e+115], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + (-N[(F * N[((-N[(N[(N[(1.0 + x), $MachinePrecision] / t$95$0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]) + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 8e+82], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / t$95$1), $MachinePrecision] + (-N[(N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision] / t$95$1), $MachinePrecision])), $MachinePrecision] * F), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := \sin B \cdot F\\
\mathbf{if}\;F \leq -1 \cdot 10^{+115}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \left(-F \cdot \left(\left(-\frac{\frac{1 + x}{t\_0}}{F \cdot F}\right) + \frac{1}{t\_0}\right)\right)\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+82}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t\_1} + \left(-\frac{\cos B \cdot x}{t\_1}\right)\right) \cdot F\\
\end{array}
\end{array}
if F < -1e115Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied rewrites83.3%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-*.f64N/A
lower-+.f64N/A
Applied rewrites39.9%
if -1e115 < F < 7.9999999999999997e82Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
if 7.9999999999999997e82 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites48.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (sin B) F)) (t_1 (* (cos B) x)))
(if (<= F -1.85e+112)
(- (* (/ (+ 1.0 t_1) t_0) F))
(if (<= F 8e+82)
(+
(- (/ (* x 1.0) (tan B)))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(* (+ (/ 1.0 t_0) (- (/ t_1 t_0))) F)))))
double code(double F, double B, double x) {
double t_0 = sin(B) * F;
double t_1 = cos(B) * x;
double tmp;
if (F <= -1.85e+112) {
tmp = -(((1.0 + t_1) / t_0) * F);
} else if (F <= 8e+82) {
tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = ((1.0 / t_0) + -(t_1 / t_0)) * F;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = sin(b) * f
t_1 = cos(b) * x
if (f <= (-1.85d+112)) then
tmp = -(((1.0d0 + t_1) / t_0) * f)
else if (f <= 8d+82) then
tmp = -((x * 1.0d0) / tan(b)) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else
tmp = ((1.0d0 / t_0) + -(t_1 / t_0)) * f
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sin(B) * F;
double t_1 = Math.cos(B) * x;
double tmp;
if (F <= -1.85e+112) {
tmp = -(((1.0 + t_1) / t_0) * F);
} else if (F <= 8e+82) {
tmp = -((x * 1.0) / Math.tan(B)) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = ((1.0 / t_0) + -(t_1 / t_0)) * F;
}
return tmp;
}
def code(F, B, x): t_0 = math.sin(B) * F t_1 = math.cos(B) * x tmp = 0 if F <= -1.85e+112: tmp = -(((1.0 + t_1) / t_0) * F) elif F <= 8e+82: tmp = -((x * 1.0) / math.tan(B)) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) else: tmp = ((1.0 / t_0) + -(t_1 / t_0)) * F return tmp
function code(F, B, x) t_0 = Float64(sin(B) * F) t_1 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1.85e+112) tmp = Float64(-Float64(Float64(Float64(1.0 + t_1) / t_0) * F)); elseif (F <= 8e+82) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); else tmp = Float64(Float64(Float64(1.0 / t_0) + Float64(-Float64(t_1 / t_0))) * F); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sin(B) * F; t_1 = cos(B) * x; tmp = 0.0; if (F <= -1.85e+112) tmp = -(((1.0 + t_1) / t_0) * F); elseif (F <= 8e+82) tmp = -((x * 1.0) / tan(B)) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); else tmp = ((1.0 / t_0) + -(t_1 / t_0)) * F; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1.85e+112], (-N[(N[(N[(1.0 + t$95$1), $MachinePrecision] / t$95$0), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, 8e+82], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / t$95$0), $MachinePrecision] + (-N[(t$95$1 / t$95$0), $MachinePrecision])), $MachinePrecision] * F), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sin B \cdot F\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;-\frac{1 + t\_1}{t\_0} \cdot F\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+82}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{t\_0} + \left(-\frac{t\_1}{t\_0}\right)\right) \cdot F\\
\end{array}
\end{array}
if F < -1.85000000000000002e112Initial program 76.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6451.2
Applied rewrites51.2%
if -1.85000000000000002e112 < F < 7.9999999999999997e82Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
if 7.9999999999999997e82 < F Initial program 76.2%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites48.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sin B))))
(if (<= F -1.85e+112)
(- (* (/ (+ 1.0 (* (cos B) x)) (* (sin B) F)) F))
(if (<= F 1.35e+154)
(+
(- (/ (* x 1.0) (tan B)))
(* t_0 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F 1e+228)
(/ (- (* (/ 1.0 F) F) x) B)
(fma (- x) (/ 1.0 (tan B)) (* t_0 (/ 1.0 F))))))))
double code(double F, double B, double x) {
double t_0 = F / sin(B);
double tmp;
if (F <= -1.85e+112) {
tmp = -(((1.0 + (cos(B) * x)) / (sin(B) * F)) * F);
} else if (F <= 1.35e+154) {
tmp = -((x * 1.0) / tan(B)) + (t_0 * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 1e+228) {
tmp = (((1.0 / F) * F) - x) / B;
} else {
tmp = fma(-x, (1.0 / tan(B)), (t_0 * (1.0 / F)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sin(B)) tmp = 0.0 if (F <= -1.85e+112) tmp = Float64(-Float64(Float64(Float64(1.0 + Float64(cos(B) * x)) / Float64(sin(B) * F)) * F)); elseif (F <= 1.35e+154) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(t_0 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); elseif (F <= 1e+228) tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); else tmp = fma(Float64(-x), Float64(1.0 / tan(B)), Float64(t_0 * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.85e+112], (-N[(N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, 1.35e+154], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(t$95$0 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+228], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + t\_0 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{elif}\;F \leq 10^{+228}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{\tan B}, t\_0 \cdot \frac{1}{F}\right)\\
\end{array}
\end{array}
if F < -1.85000000000000002e112Initial program 76.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6451.2
Applied rewrites51.2%
if -1.85000000000000002e112 < F < 1.35000000000000003e154Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
if 1.35000000000000003e154 < F < 9.9999999999999992e227Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
lower-/.f6430.6
Applied rewrites30.6%
if 9.9999999999999992e227 < F Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.4
Applied rewrites48.4%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-tan.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
Taylor expanded in F around inf
lower-/.f6447.9
Applied rewrites47.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (tan B))) (t_1 (/ F (sin B))))
(if (<= F -1.85e+112)
(- (* (/ (+ 1.0 (* (cos B) x)) (* (sin B) F)) F))
(if (<= F 1.35e+154)
(fma (- x) t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) t_1))
(if (<= F 1e+228)
(/ (- (* (/ 1.0 F) F) x) B)
(fma (- x) t_0 (* t_1 (/ 1.0 F))))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / tan(B);
double t_1 = F / sin(B);
double tmp;
if (F <= -1.85e+112) {
tmp = -(((1.0 + (cos(B) * x)) / (sin(B) * F)) * F);
} else if (F <= 1.35e+154) {
tmp = fma(-x, t_0, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * t_1));
} else if (F <= 1e+228) {
tmp = (((1.0 / F) * F) - x) / B;
} else {
tmp = fma(-x, t_0, (t_1 * (1.0 / F)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / tan(B)) t_1 = Float64(F / sin(B)) tmp = 0.0 if (F <= -1.85e+112) tmp = Float64(-Float64(Float64(Float64(1.0 + Float64(cos(B) * x)) / Float64(sin(B) * F)) * F)); elseif (F <= 1.35e+154) tmp = fma(Float64(-x), t_0, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * t_1)); elseif (F <= 1e+228) tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); else tmp = fma(Float64(-x), t_0, Float64(t_1 * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.85e+112], (-N[(N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, 1.35e+154], N[((-x) * t$95$0 + N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+228], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) * t$95$0 + N[(t$95$1 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{+112}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot t\_1\right)\\
\mathbf{elif}\;F \leq 10^{+228}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, t\_0, t\_1 \cdot \frac{1}{F}\right)\\
\end{array}
\end{array}
if F < -1.85000000000000002e112Initial program 76.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6451.2
Applied rewrites51.2%
if -1.85000000000000002e112 < F < 1.35000000000000003e154Initial program 76.2%
Applied rewrites76.2%
if 1.35000000000000003e154 < F < 9.9999999999999992e227Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
lower-/.f6430.6
Applied rewrites30.6%
if 9.9999999999999992e227 < F Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.4
Applied rewrites48.4%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-tan.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
Taylor expanded in F around inf
lower-/.f6447.9
Applied rewrites47.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.7)
(- (* (/ (+ 1.0 t_0) (* (sin B) F)) F))
(if (<= F 1.45e-5)
(/ (- (* (pow (fma 2.0 x 2.0) -0.5) F) t_0) (sin B))
(fma (- x) (/ 1.0 (tan B)) (* (/ F (sin B)) (/ 1.0 F)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.7) {
tmp = -(((1.0 + t_0) / (sin(B) * F)) * F);
} else if (F <= 1.45e-5) {
tmp = ((pow(fma(2.0, x, 2.0), -0.5) * F) - t_0) / sin(B);
} else {
tmp = fma(-x, (1.0 / tan(B)), ((F / sin(B)) * (1.0 / F)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.7) tmp = Float64(-Float64(Float64(Float64(1.0 + t_0) / Float64(sin(B) * F)) * F)); elseif (F <= 1.45e-5) tmp = Float64(Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * F) - t_0) / sin(B)); else tmp = fma(Float64(-x), Float64(1.0 / tan(B)), Float64(Float64(F / sin(B)) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.7], (-N[(N[(N[(1.0 + t$95$0), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, 1.45e-5], N[(N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.7:\\
\;\;\;\;-\frac{1 + t\_0}{\sin B \cdot F} \cdot F\\
\mathbf{elif}\;F \leq 1.45 \cdot 10^{-5}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot F - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{F}{\sin B} \cdot \frac{1}{F}\right)\\
\end{array}
\end{array}
if F < -2.7000000000000002Initial program 76.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6451.2
Applied rewrites51.2%
if -2.7000000000000002 < F < 1.45e-5Initial program 76.2%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
sub-divN/A
lower-/.f64N/A
Applied rewrites54.9%
if 1.45e-5 < F Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.4
Applied rewrites48.4%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-tan.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
Taylor expanded in F around inf
lower-/.f6447.9
Applied rewrites47.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sin B)))
(t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F -2.3e+39)
(- (* (/ (+ 1.0 (* (cos B) x)) (* (sin B) F)) F))
(if (<= F -3.6e-170)
(+ (- (/ x B)) (* t_0 t_1))
(if (<= F 310.0)
(+ (- (/ (* x 1.0) (tan B))) (* (/ F B) t_1))
(fma (- x) (/ 1.0 (tan B)) (* t_0 (/ 1.0 F))))))))
double code(double F, double B, double x) {
double t_0 = F / sin(B);
double t_1 = pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0));
double tmp;
if (F <= -2.3e+39) {
tmp = -(((1.0 + (cos(B) * x)) / (sin(B) * F)) * F);
} else if (F <= -3.6e-170) {
tmp = -(x / B) + (t_0 * t_1);
} else if (F <= 310.0) {
tmp = -((x * 1.0) / tan(B)) + ((F / B) * t_1);
} else {
tmp = fma(-x, (1.0 / tan(B)), (t_0 * (1.0 / F)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sin(B)) t_1 = Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)) tmp = 0.0 if (F <= -2.3e+39) tmp = Float64(-Float64(Float64(Float64(1.0 + Float64(cos(B) * x)) / Float64(sin(B) * F)) * F)); elseif (F <= -3.6e-170) tmp = Float64(Float64(-Float64(x / B)) + Float64(t_0 * t_1)); elseif (F <= 310.0) tmp = Float64(Float64(-Float64(Float64(x * 1.0) / tan(B))) + Float64(Float64(F / B) * t_1)); else tmp = fma(Float64(-x), Float64(1.0 / tan(B)), Float64(t_0 * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]}, If[LessEqual[F, -2.3e+39], (-N[(N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, -3.6e-170], N[((-N[(x / B), $MachinePrecision]) + N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 310.0], N[((-N[(N[(x * 1.0), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
t_1 := {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F\\
\mathbf{elif}\;F \leq -3.6 \cdot 10^{-170}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_0 \cdot t\_1\\
\mathbf{elif}\;F \leq 310:\\
\;\;\;\;\left(-\frac{x \cdot 1}{\tan B}\right) + \frac{F}{B} \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{\tan B}, t\_0 \cdot \frac{1}{F}\right)\\
\end{array}
\end{array}
if F < -2.30000000000000012e39Initial program 76.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6451.2
Applied rewrites51.2%
if -2.30000000000000012e39 < F < -3.6000000000000003e-170Initial program 76.2%
Taylor expanded in B around 0
lower-/.f6449.2
Applied rewrites49.2%
if -3.6000000000000003e-170 < F < 310Initial program 76.2%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6476.3
Applied rewrites76.3%
Taylor expanded in B around 0
lower-/.f6461.8
Applied rewrites61.8%
if 310 < F Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.4
Applied rewrites48.4%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-tan.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
Taylor expanded in F around inf
lower-/.f6447.9
Applied rewrites47.9%
(FPCore (F B x)
:precision binary64
(if (<= F -2.3e+39)
(- (* (/ (+ 1.0 (* (cos B) x)) (* (sin B) F)) F))
(if (<= F -3.6e-170)
(+
(- (/ x B))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F 1.35e+154)
(+ (- (* x (/ 1.0 (tan B)))) (/ (* F (pow (+ 2.0 (* F F)) -0.5)) B))
(if (<= F 2.3e+224) (/ (- (* (/ 1.0 F) F) x) B) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+39) {
tmp = -(((1.0 + (cos(B) * x)) / (sin(B) * F)) * F);
} else if (F <= -3.6e-170) {
tmp = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 1.35e+154) {
tmp = -(x * (1.0 / tan(B))) + ((F * pow((2.0 + (F * F)), -0.5)) / B);
} else if (F <= 2.3e+224) {
tmp = (((1.0 / F) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.3d+39)) then
tmp = -(((1.0d0 + (cos(b) * x)) / (sin(b) * f)) * f)
else if (f <= (-3.6d-170)) then
tmp = -(x / b) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
else if (f <= 1.35d+154) then
tmp = -(x * (1.0d0 / tan(b))) + ((f * ((2.0d0 + (f * f)) ** (-0.5d0))) / b)
else if (f <= 2.3d+224) then
tmp = (((1.0d0 / f) * f) - x) / b
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+39) {
tmp = -(((1.0 + (Math.cos(B) * x)) / (Math.sin(B) * F)) * F);
} else if (F <= -3.6e-170) {
tmp = -(x / B) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 1.35e+154) {
tmp = -(x * (1.0 / Math.tan(B))) + ((F * Math.pow((2.0 + (F * F)), -0.5)) / B);
} else if (F <= 2.3e+224) {
tmp = (((1.0 / F) * F) - x) / B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e+39: tmp = -(((1.0 + (math.cos(B) * x)) / (math.sin(B) * F)) * F) elif F <= -3.6e-170: tmp = -(x / B) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0))) elif F <= 1.35e+154: tmp = -(x * (1.0 / math.tan(B))) + ((F * math.pow((2.0 + (F * F)), -0.5)) / B) elif F <= 2.3e+224: tmp = (((1.0 / F) * F) - x) / B else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e+39) tmp = Float64(-Float64(Float64(Float64(1.0 + Float64(cos(B) * x)) / Float64(sin(B) * F)) * F)); elseif (F <= -3.6e-170) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); elseif (F <= 1.35e+154) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * (Float64(2.0 + Float64(F * F)) ^ -0.5)) / B)); elseif (F <= 2.3e+224) tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.3e+39) tmp = -(((1.0 + (cos(B) * x)) / (sin(B) * F)) * F); elseif (F <= -3.6e-170) tmp = -(x / B) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); elseif (F <= 1.35e+154) tmp = -(x * (1.0 / tan(B))) + ((F * ((2.0 + (F * F)) ^ -0.5)) / B); elseif (F <= 2.3e+224) tmp = (((1.0 / F) * F) - x) / B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e+39], (-N[(N[(N[(1.0 + N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), If[LessEqual[F, -3.6e-170], N[((-N[(x / B), $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], If[LessEqual[F, 1.35e+154], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e+224], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{+39}:\\
\;\;\;\;-\frac{1 + \cos B \cdot x}{\sin B \cdot F} \cdot F\\
\mathbf{elif}\;F \leq -3.6 \cdot 10^{-170}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left(2 + F \cdot F\right)}^{-0.5}}{B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{+224}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -2.30000000000000012e39Initial program 76.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f6451.2
Applied rewrites51.2%
if -2.30000000000000012e39 < F < -3.6000000000000003e-170Initial program 76.2%
Taylor expanded in B around 0
lower-/.f6449.2
Applied rewrites49.2%
if -3.6000000000000003e-170 < F < 1.35000000000000003e154Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied rewrites83.3%
metadata-evalN/A
metadata-evalN/A
lift-fma.f64N/A
lift-pow.f64N/A
sqr-powN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f6483.2
Applied rewrites83.2%
metadata-evalN/A
metadata-evalN/A
lift-fma.f64N/A
lift-pow.f64N/A
sqr-powN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f6483.2
Applied rewrites83.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
pow2N/A
lower-*.f64N/A
lift-sin.f6484.6
Applied rewrites84.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites70.1%
if 1.35000000000000003e154 < F < 2.3000000000000002e224Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
lower-/.f6430.6
Applied rewrites30.6%
if 2.3000000000000002e224 < F Initial program 76.2%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6417.0
Applied rewrites17.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* x (/ 1.0 (tan B)))))
(t_1 (+ t_0 (/ (* F (pow (+ 2.0 (* F F)) -0.5)) B)))
(t_2
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(t_3 (+ t_0 t_2)))
(if (<= t_3 -50000.0)
t_1
(if (<= t_3 10.0)
(+ (- (/ x B)) t_2)
(if (<= t_3 2e+268)
t_1
(/
(- (* (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (* (* F F) F))) (/ 1.0 F)) F) x)
B))))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B)));
double t_1 = t_0 + ((F * pow((2.0 + (F * F)), -0.5)) / B);
double t_2 = (F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0));
double t_3 = t_0 + t_2;
double tmp;
if (t_3 <= -50000.0) {
tmp = t_1;
} else if (t_3 <= 10.0) {
tmp = -(x / B) + t_2;
} else if (t_3 <= 2e+268) {
tmp = t_1;
} else {
tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = -(x * (1.0d0 / tan(b)))
t_1 = t_0 + ((f * ((2.0d0 + (f * f)) ** (-0.5d0))) / b)
t_2 = (f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0))
t_3 = t_0 + t_2
if (t_3 <= (-50000.0d0)) then
tmp = t_1
else if (t_3 <= 10.0d0) then
tmp = -(x / b) + t_2
else if (t_3 <= 2d+268) then
tmp = t_1
else
tmp = ((((0.5d0 * ((2.0d0 + (2.0d0 * x)) / ((f * f) * f))) - (1.0d0 / f)) * f) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / Math.tan(B)));
double t_1 = t_0 + ((F * Math.pow((2.0 + (F * F)), -0.5)) / B);
double t_2 = (F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0));
double t_3 = t_0 + t_2;
double tmp;
if (t_3 <= -50000.0) {
tmp = t_1;
} else if (t_3 <= 10.0) {
tmp = -(x / B) + t_2;
} else if (t_3 <= 2e+268) {
tmp = t_1;
} else {
tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = -(x * (1.0 / math.tan(B))) t_1 = t_0 + ((F * math.pow((2.0 + (F * F)), -0.5)) / B) t_2 = (F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)) t_3 = t_0 + t_2 tmp = 0 if t_3 <= -50000.0: tmp = t_1 elif t_3 <= 10.0: tmp = -(x / B) + t_2 elif t_3 <= 2e+268: tmp = t_1 else: tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B return tmp
function code(F, B, x) t_0 = Float64(-Float64(x * Float64(1.0 / tan(B)))) t_1 = Float64(t_0 + Float64(Float64(F * (Float64(2.0 + Float64(F * F)) ^ -0.5)) / B)) t_2 = Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)))) t_3 = Float64(t_0 + t_2) tmp = 0.0 if (t_3 <= -50000.0) tmp = t_1; elseif (t_3 <= 10.0) tmp = Float64(Float64(-Float64(x / B)) + t_2); elseif (t_3 <= 2e+268) tmp = t_1; else tmp = Float64(Float64(Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(Float64(F * F) * F))) - Float64(1.0 / F)) * F) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x * (1.0 / tan(B))); t_1 = t_0 + ((F * ((2.0 + (F * F)) ^ -0.5)) / B); t_2 = (F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0)); t_3 = t_0 + t_2; tmp = 0.0; if (t_3 <= -50000.0) tmp = t_1; elseif (t_3 <= 10.0) tmp = -(x / B) + t_2; elseif (t_3 <= 2e+268) tmp = t_1; else tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$1 = N[(t$95$0 + N[(N[(F * N[Power[N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(t$95$0 + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -50000.0], t$95$1, If[LessEqual[t$95$3, 10.0], N[((-N[(x / B), $MachinePrecision]) + t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 2e+268], t$95$1, N[(N[(N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -x \cdot \frac{1}{\tan B}\\
t_1 := t\_0 + \frac{F \cdot {\left(2 + F \cdot F\right)}^{-0.5}}{B}\\
t_2 := \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
t_3 := t\_0 + t\_2\\
\mathbf{if}\;t\_3 \leq -50000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 10:\\
\;\;\;\;\left(-\frac{x}{B}\right) + t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+268}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B}\\
\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)))))) < -5e4 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)))))) < 1.9999999999999999e268Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied rewrites83.3%
metadata-evalN/A
metadata-evalN/A
lift-fma.f64N/A
lift-pow.f64N/A
sqr-powN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f6483.2
Applied rewrites83.2%
metadata-evalN/A
metadata-evalN/A
lift-fma.f64N/A
lift-pow.f64N/A
sqr-powN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f6483.2
Applied rewrites83.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
pow2N/A
lower-*.f64N/A
lift-sin.f6484.6
Applied rewrites84.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites70.1%
if -5e4 < (+.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 76.2%
Taylor expanded in B around 0
lower-/.f6449.2
Applied rewrites49.2%
if 1.9999999999999999e268 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6422.3
Applied rewrites22.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+ (- (* x (/ 1.0 (tan B)))) (/ (* F (pow (+ 2.0 (* F F)) -0.5)) B))))
(if (<= x -2.6e-140)
t_0
(if (<= x 1.6e-123) (/ (* (pow (fma F F 2.0) -0.5) F) (sin B)) t_0))))
double code(double F, double B, double x) {
double t_0 = -(x * (1.0 / tan(B))) + ((F * pow((2.0 + (F * F)), -0.5)) / B);
double tmp;
if (x <= -2.6e-140) {
tmp = t_0;
} else if (x <= 1.6e-123) {
tmp = (pow(fma(F, F, 2.0), -0.5) * F) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F * (Float64(2.0 + Float64(F * F)) ^ -0.5)) / B)) tmp = 0.0 if (x <= -2.6e-140) tmp = t_0; elseif (x <= 1.6e-123) tmp = Float64(Float64((fma(F, F, 2.0) ^ -0.5) * F) / sin(B)); else tmp = t_0; 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[Power[N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e-140], t$95$0, If[LessEqual[x, 1.6e-123], N[(N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(-x \cdot \frac{1}{\tan B}\right) + \frac{F \cdot {\left(2 + F \cdot F\right)}^{-0.5}}{B}\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{-140}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-123}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.5999999999999998e-140 or 1.59999999999999989e-123 < x Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied rewrites83.3%
metadata-evalN/A
metadata-evalN/A
lift-fma.f64N/A
lift-pow.f64N/A
sqr-powN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f6483.2
Applied rewrites83.2%
metadata-evalN/A
metadata-evalN/A
lift-fma.f64N/A
lift-pow.f64N/A
sqr-powN/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lift-fma.f6483.2
Applied rewrites83.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
pow2N/A
lower-*.f64N/A
lift-sin.f6484.6
Applied rewrites84.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites70.1%
if -2.5999999999999998e-140 < x < 1.59999999999999989e-123Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-sin.f6430.3
Applied rewrites30.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (cos B) (/ x (sin B))))))
(if (<= x -1.55e-46)
t_0
(if (<= x 2.9e-88) (/ (* (pow (fma F F 2.0) -0.5) F) (sin B)) t_0))))
double code(double F, double B, double x) {
double t_0 = -(cos(B) * (x / sin(B)));
double tmp;
if (x <= -1.55e-46) {
tmp = t_0;
} else if (x <= 2.9e-88) {
tmp = (pow(fma(F, F, 2.0), -0.5) * F) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(cos(B) * Float64(x / sin(B)))) tmp = 0.0 if (x <= -1.55e-46) tmp = t_0; elseif (x <= 2.9e-88) tmp = Float64(Float64((fma(F, F, 2.0) ^ -0.5) * F) / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -1.55e-46], t$95$0, If[LessEqual[x, 2.9e-88], N[(N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\cos B \cdot \frac{x}{\sin B}\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-88}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.55e-46 or 2.9000000000000001e-88 < x Initial program 76.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6455.9
Applied rewrites55.9%
lift-/.f64N/A
lift-*.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-cos.f64N/A
lower-/.f64N/A
lift-sin.f6455.9
Applied rewrites55.9%
if -1.55e-46 < x < 2.9000000000000001e-88Initial program 76.2%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
metadata-evalN/A
metadata-evalN/A
lift-sin.f6430.3
Applied rewrites30.3%
(FPCore (F B x)
:precision binary64
(if (<= B 2.4e-8)
(- (/ (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) B) (/ x B))
(fma
(- x)
(/ 1.0 (tan B))
(* (/ F (* B (+ 1.0 (* -0.16666666666666666 (* B B))))) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.4e-8) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) / B) - (x / B);
} else {
tmp = fma(-x, (1.0 / tan(B)), ((F / (B * (1.0 + (-0.16666666666666666 * (B * B))))) * (-1.0 / F)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.4e-8) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) / B) - Float64(x / B)); else tmp = fma(Float64(-x), Float64(1.0 / tan(B)), Float64(Float64(F / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * Float64(B * B))))) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.4e-8], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{F}{B \cdot \left(1 + -0.16666666666666666 \cdot \left(B \cdot B\right)\right)} \cdot \frac{-1}{F}\right)\\
\end{array}
\end{array}
if B < 2.39999999999999998e-8Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
div-subN/A
lower--.f64N/A
Applied rewrites43.9%
if 2.39999999999999998e-8 < B Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.4
Applied rewrites48.4%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-tan.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6447.7
Applied rewrites47.7%
(FPCore (F B x) :precision binary64 (if (<= B 2.4e-8) (- (/ (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) B) (/ x B)) (fma (- x) (/ 1.0 (tan B)) (* (/ F B) (/ -1.0 F)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.4e-8) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) / B) - (x / B);
} else {
tmp = fma(-x, (1.0 / tan(B)), ((F / B) * (-1.0 / F)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.4e-8) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) / B) - Float64(x / B)); else tmp = fma(Float64(-x), Float64(1.0 / tan(B)), Float64(Float64(F / B) * Float64(-1.0 / F))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.4e-8], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[((-x) * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.4 \cdot 10^{-8}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{1}{\tan B}, \frac{F}{B} \cdot \frac{-1}{F}\right)\\
\end{array}
\end{array}
if B < 2.39999999999999998e-8Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
div-subN/A
lower--.f64N/A
Applied rewrites43.9%
if 2.39999999999999998e-8 < B Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f6448.4
Applied rewrites48.4%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lift-tan.f64N/A
lift-/.f6448.4
Applied rewrites48.4%
Taylor expanded in B around 0
lower-/.f6446.8
Applied rewrites46.8%
(FPCore (F B x) :precision binary64 (if (<= B 3.85) (- (/ (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) B) (/ x B)) (if (<= B 6.6e+242) (/ 1.0 (sin B)) (/ -1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.85) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) / B) - (x / B);
} else if (B <= 6.6e+242) {
tmp = 1.0 / sin(B);
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.85) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) / B) - Float64(x / B)); elseif (B <= 6.6e+242) tmp = Float64(1.0 / sin(B)); else tmp = Float64(-1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.85], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 6.6e+242], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.85:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F}{B} - \frac{x}{B}\\
\mathbf{elif}\;B \leq 6.6 \cdot 10^{+242}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if B < 3.85000000000000009Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
metadata-evalN/A
metadata-evalN/A
lift-/.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
div-subN/A
lower--.f64N/A
Applied rewrites43.9%
if 3.85000000000000009 < B < 6.60000000000000045e242Initial program 76.2%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6417.0
Applied rewrites17.0%
if 6.60000000000000045e242 < B Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.8
Applied rewrites17.8%
(FPCore (F B x) :precision binary64 (if (<= B 3.85) (/ (- (* (pow (+ (fma F F (+ x x)) 2.0) -0.5) F) x) B) (if (<= B 6.6e+242) (/ 1.0 (sin B)) (/ -1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.85) {
tmp = ((pow((fma(F, F, (x + x)) + 2.0), -0.5) * F) - x) / B;
} else if (B <= 6.6e+242) {
tmp = 1.0 / sin(B);
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.85) tmp = Float64(Float64(Float64((Float64(fma(F, F, Float64(x + x)) + 2.0) ^ -0.5) * F) - x) / B); elseif (B <= 6.6e+242) tmp = Float64(1.0 / sin(B)); else tmp = Float64(-1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.85], N[(N[(N[(N[Power[N[(N[(F * F + N[(x + x), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 6.6e+242], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.85:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, x + x\right) + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{elif}\;B \leq 6.6 \cdot 10^{+242}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if B < 3.85000000000000009Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
if 3.85000000000000009 < B < 6.60000000000000045e242Initial program 76.2%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6417.0
Applied rewrites17.0%
if 6.60000000000000045e242 < B Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.8
Applied rewrites17.8%
(FPCore (F B x)
:precision binary64
(if (<= F -3.6e-9)
(/ (- (* (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (* (* F F) F))) (/ 1.0 F)) F) x) B)
(if (<= F 520000000000.0)
(/ (- (* (pow (+ (* 2.0 x) 2.0) -0.5) F) x) B)
(if (<= F 2.3e+224) (/ (- (* (/ 1.0 F) F) x) B) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-9) {
tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
} else if (F <= 520000000000.0) {
tmp = ((pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
} else if (F <= 2.3e+224) {
tmp = (((1.0 / F) * F) - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.6d-9)) then
tmp = ((((0.5d0 * ((2.0d0 + (2.0d0 * x)) / ((f * f) * f))) - (1.0d0 / f)) * f) - x) / b
else if (f <= 520000000000.0d0) then
tmp = (((((2.0d0 * x) + 2.0d0) ** (-0.5d0)) * f) - x) / b
else if (f <= 2.3d+224) then
tmp = (((1.0d0 / f) * f) - x) / b
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-9) {
tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
} else if (F <= 520000000000.0) {
tmp = ((Math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
} else if (F <= 2.3e+224) {
tmp = (((1.0 / F) * F) - x) / B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.6e-9: tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B elif F <= 520000000000.0: tmp = ((math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B elif F <= 2.3e+224: tmp = (((1.0 / F) * F) - x) / B else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.6e-9) tmp = Float64(Float64(Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(Float64(F * F) * F))) - Float64(1.0 / F)) * F) - x) / B); elseif (F <= 520000000000.0) tmp = Float64(Float64(Float64((Float64(Float64(2.0 * x) + 2.0) ^ -0.5) * F) - x) / B); elseif (F <= 2.3e+224) tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.6e-9) tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B; elseif (F <= 520000000000.0) tmp = (((((2.0 * x) + 2.0) ^ -0.5) * F) - x) / B; elseif (F <= 2.3e+224) tmp = (((1.0 / F) * F) - x) / B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.6e-9], N[(N[(N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 520000000000.0], N[(N[(N[(N[Power[N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.3e+224], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 520000000000:\\
\;\;\;\;\frac{{\left(2 \cdot x + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{+224}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.6e-9Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6422.3
Applied rewrites22.3%
if -3.6e-9 < F < 5.2e11Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around 0
lower-*.f6429.2
Applied rewrites29.2%
if 5.2e11 < F < 2.3000000000000002e224Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
lower-/.f6430.6
Applied rewrites30.6%
if 2.3000000000000002e224 < F Initial program 76.2%
Taylor expanded in F around inf
lower-/.f64N/A
lift-sin.f6417.0
Applied rewrites17.0%
(FPCore (F B x)
:precision binary64
(if (<= F -3.6e-9)
(/ (- (* (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (* (* F F) F))) (/ 1.0 F)) F) x) B)
(if (<= F 520000000000.0)
(/ (- (* (pow (+ (* 2.0 x) 2.0) -0.5) F) x) B)
(/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-9) {
tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
} else if (F <= 520000000000.0) {
tmp = ((pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.6d-9)) then
tmp = ((((0.5d0 * ((2.0d0 + (2.0d0 * x)) / ((f * f) * f))) - (1.0d0 / f)) * f) - x) / b
else if (f <= 520000000000.0d0) then
tmp = (((((2.0d0 * x) + 2.0d0) ** (-0.5d0)) * f) - x) / b
else
tmp = (((1.0d0 / f) * f) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-9) {
tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B;
} else if (F <= 520000000000.0) {
tmp = ((Math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.6e-9: tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B elif F <= 520000000000.0: tmp = ((math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B else: tmp = (((1.0 / F) * F) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.6e-9) tmp = Float64(Float64(Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / Float64(Float64(F * F) * F))) - Float64(1.0 / F)) * F) - x) / B); elseif (F <= 520000000000.0) tmp = Float64(Float64(Float64((Float64(Float64(2.0 * x) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.6e-9) tmp = ((((0.5 * ((2.0 + (2.0 * x)) / ((F * F) * F))) - (1.0 / F)) * F) - x) / B; elseif (F <= 520000000000.0) tmp = (((((2.0 * x) + 2.0) ^ -0.5) * F) - x) / B; else tmp = (((1.0 / F) * F) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.6e-9], N[(N[(N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 520000000000.0], N[(N[(N[(N[Power[N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{\left(0.5 \cdot \frac{2 + 2 \cdot x}{\left(F \cdot F\right) \cdot F} - \frac{1}{F}\right) \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 520000000000:\\
\;\;\;\;\frac{{\left(2 \cdot x + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\end{array}
\end{array}
if F < -3.6e-9Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
unpow3N/A
pow2N/A
lower-*.f64N/A
pow2N/A
lower-*.f64N/A
lower-/.f6422.3
Applied rewrites22.3%
if -3.6e-9 < F < 5.2e11Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around 0
lower-*.f6429.2
Applied rewrites29.2%
if 5.2e11 < F Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
lower-/.f6430.6
Applied rewrites30.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.7)
(/ (- (* (/ -1.0 F) F) x) B)
(if (<= F 520000000000.0)
(/ (- (* (pow (+ (* 2.0 x) 2.0) -0.5) F) x) B)
(/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7) {
tmp = (((-1.0 / F) * F) - x) / B;
} else if (F <= 520000000000.0) {
tmp = ((pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.7d0)) then
tmp = ((((-1.0d0) / f) * f) - x) / b
else if (f <= 520000000000.0d0) then
tmp = (((((2.0d0 * x) + 2.0d0) ** (-0.5d0)) * f) - x) / b
else
tmp = (((1.0d0 / f) * f) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.7) {
tmp = (((-1.0 / F) * F) - x) / B;
} else if (F <= 520000000000.0) {
tmp = ((Math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.7: tmp = (((-1.0 / F) * F) - x) / B elif F <= 520000000000.0: tmp = ((math.pow(((2.0 * x) + 2.0), -0.5) * F) - x) / B else: tmp = (((1.0 / F) * F) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.7) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - x) / B); elseif (F <= 520000000000.0) tmp = Float64(Float64(Float64((Float64(Float64(2.0 * x) + 2.0) ^ -0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.7) tmp = (((-1.0 / F) * F) - x) / B; elseif (F <= 520000000000.0) tmp = (((((2.0 * x) + 2.0) ^ -0.5) * F) - x) / B; else tmp = (((1.0 / F) * F) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.7], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 520000000000.0], N[(N[(N[(N[Power[N[(N[(2.0 * x), $MachinePrecision] + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 520000000000:\\
\;\;\;\;\frac{{\left(2 \cdot x + 2\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\end{array}
\end{array}
if F < -2.7000000000000002Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around -inf
lower-/.f6430.2
Applied rewrites30.2%
if -2.7000000000000002 < F < 5.2e11Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around 0
lower-*.f6429.2
Applied rewrites29.2%
if 5.2e11 < F Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
lower-/.f6430.6
Applied rewrites30.6%
(FPCore (F B x) :precision binary64 (if (<= F -2.35e-33) (/ (- (* (/ -1.0 F) F) x) B) (if (<= F 2.4e-27) (/ (* -1.0 x) B) (/ (- (* (/ 1.0 F) F) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-33) {
tmp = (((-1.0 / F) * F) - x) / B;
} else if (F <= 2.4e-27) {
tmp = (-1.0 * x) / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.35d-33)) then
tmp = ((((-1.0d0) / f) * f) - x) / b
else if (f <= 2.4d-27) then
tmp = ((-1.0d0) * x) / b
else
tmp = (((1.0d0 / f) * f) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-33) {
tmp = (((-1.0 / F) * F) - x) / B;
} else if (F <= 2.4e-27) {
tmp = (-1.0 * x) / B;
} else {
tmp = (((1.0 / F) * F) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.35e-33: tmp = (((-1.0 / F) * F) - x) / B elif F <= 2.4e-27: tmp = (-1.0 * x) / B else: tmp = (((1.0 / F) * F) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.35e-33) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - x) / B); elseif (F <= 2.4e-27) tmp = Float64(Float64(-1.0 * x) / B); else tmp = Float64(Float64(Float64(Float64(1.0 / F) * F) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.35e-33) tmp = (((-1.0 / F) * F) - x) / B; elseif (F <= 2.4e-27) tmp = (-1.0 * x) / B; else tmp = (((1.0 / F) * F) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.35e-33], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.4e-27], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.35 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-27}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{F} \cdot F - x}{B}\\
\end{array}
\end{array}
if F < -2.3500000000000001e-33Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around -inf
lower-/.f6430.2
Applied rewrites30.2%
if -2.3500000000000001e-33 < F < 2.40000000000000002e-27Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around 0
lower-*.f6429.6
Applied rewrites29.6%
if 2.40000000000000002e-27 < F Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
lower-/.f6430.6
Applied rewrites30.6%
(FPCore (F B x) :precision binary64 (if (<= F -2.35e-33) (/ (- (* (/ -1.0 F) F) x) B) (/ (* -1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-33) {
tmp = (((-1.0 / F) * F) - x) / B;
} else {
tmp = (-1.0 * x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.35d-33)) then
tmp = ((((-1.0d0) / f) * f) - x) / b
else
tmp = ((-1.0d0) * x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.35e-33) {
tmp = (((-1.0 / F) * F) - x) / B;
} else {
tmp = (-1.0 * x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.35e-33: tmp = (((-1.0 / F) * F) - x) / B else: tmp = (-1.0 * x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.35e-33) tmp = Float64(Float64(Float64(Float64(-1.0 / F) * F) - x) / B); else tmp = Float64(Float64(-1.0 * x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.35e-33) tmp = (((-1.0 / F) * F) - x) / B; else tmp = (-1.0 * x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.35e-33], N[(N[(N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.35 \cdot 10^{-33}:\\
\;\;\;\;\frac{\frac{-1}{F} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot x}{B}\\
\end{array}
\end{array}
if F < -2.3500000000000001e-33Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around -inf
lower-/.f6430.2
Applied rewrites30.2%
if -2.3500000000000001e-33 < F Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around 0
lower-*.f6429.6
Applied rewrites29.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (* -1.0 x) B)))
(if (<= x -5.5e-57)
t_0
(if (<= x 1.5e-291) (/ -1.0 B) (if (<= x 1.8e-123) (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 * x) / B;
double tmp;
if (x <= -5.5e-57) {
tmp = t_0;
} else if (x <= 1.5e-291) {
tmp = -1.0 / B;
} else if (x <= 1.8e-123) {
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 <= (-5.5d-57)) then
tmp = t_0
else if (x <= 1.5d-291) then
tmp = (-1.0d0) / b
else if (x <= 1.8d-123) 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 <= -5.5e-57) {
tmp = t_0;
} else if (x <= 1.5e-291) {
tmp = -1.0 / B;
} else if (x <= 1.8e-123) {
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 <= -5.5e-57: tmp = t_0 elif x <= 1.5e-291: tmp = -1.0 / B elif x <= 1.8e-123: 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 <= -5.5e-57) tmp = t_0; elseif (x <= 1.5e-291) tmp = Float64(-1.0 / B); elseif (x <= 1.8e-123) 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 <= -5.5e-57) tmp = t_0; elseif (x <= 1.5e-291) tmp = -1.0 / B; elseif (x <= 1.8e-123) 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, -5.5e-57], t$95$0, If[LessEqual[x, 1.5e-291], N[(-1.0 / B), $MachinePrecision], If[LessEqual[x, 1.8e-123], 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 -5.5 \cdot 10^{-57}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-291}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-123}:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5.50000000000000011e-57 or 1.7999999999999998e-123 < x Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around 0
lower-*.f6429.6
Applied rewrites29.6%
if -5.50000000000000011e-57 < x < 1.5e-291Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.8
Applied rewrites17.8%
Taylor expanded in B around 0
lower-/.f6410.4
Applied rewrites10.4%
if 1.5e-291 < x < 1.7999999999999998e-123Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
Applied rewrites10.2%
(FPCore (F B x) :precision binary64 (if (<= F 1e-27) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1e-27) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1d-27) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1e-27) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1e-27: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1e-27) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1e-27) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1e-27], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 10^{-27}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 1e-27Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.8
Applied rewrites17.8%
Taylor expanded in B around 0
lower-/.f6410.4
Applied rewrites10.4%
if 1e-27 < F Initial program 76.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.9%
Taylor expanded in F around inf
Applied rewrites10.2%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 76.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lift-sin.f6417.8
Applied rewrites17.8%
Taylor expanded in B around 0
lower-/.f6410.4
Applied rewrites10.4%
herbie shell --seed 2025138
(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))))))