
(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}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -3.7e+36)
(/ (- -1.0 t_0) (sin B))
(if (<= F 128000000.0)
(fma
(pow (fma 2.0 x (fma F F 2.0)) -0.5)
(/ F (sin B))
(/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -3.7e+36) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 128000000.0) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -3.7e+36) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 128000000.0) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -3.7e+36], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 128000000.0], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -3.7 \cdot 10^{+36}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 128000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -3.70000000000000029e36Initial program 53.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -3.70000000000000029e36 < F < 1.28e8Initial program 99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.6
Applied rewrites99.6%
Applied rewrites99.7%
if 1.28e8 < F Initial program 48.3%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.8e+17)
(/ (- -1.0 t_0) (sin B))
(if (<= F 108000000.0)
(fma
(/ 1.0 (sqrt (fma F F (fma 2.0 x 2.0))))
(/ F (sin B))
(/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.8e+17) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 108000000.0) {
tmp = fma((1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))), (F / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.8e+17) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 108000000.0) tmp = fma(Float64(1.0 / sqrt(fma(F, F, fma(2.0, x, 2.0)))), Float64(F / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.8e+17], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 108000000.0], N[(N[(1.0 / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.8 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 108000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.8e17Initial program 55.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -2.8e17 < F < 1.08e8Initial program 99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.7
Applied rewrites99.7%
Applied rewrites99.7%
lift-pow.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
pow2N/A
associate-+r+N/A
pow2N/A
metadata-evalN/A
sqrt-pow1N/A
unpow-1N/A
+-commutativeN/A
pow2N/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
lower-sqrt.f64N/A
Applied rewrites99.6%
if 1.08e8 < F Initial program 48.3%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (- (/ x B))))
(t_1 (* (cos B) x)))
(if (<= F -2.7e-15)
(/ (- -1.0 t_1) (sin B))
(if (<= F -4.2e-66)
t_0
(if (<= F 2.3e-175)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 39000.0) t_0 (/ (- 1.0 t_1) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), -(x / B));
double t_1 = cos(B) * x;
double tmp;
if (F <= -2.7e-15) {
tmp = (-1.0 - t_1) / sin(B);
} else if (F <= -4.2e-66) {
tmp = t_0;
} else if (F <= 2.3e-175) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 39000.0) {
tmp = t_0;
} else {
tmp = (1.0 - t_1) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(-Float64(x / B))) t_1 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.7e-15) tmp = Float64(Float64(-1.0 - t_1) / sin(B)); elseif (F <= -4.2e-66) tmp = t_0; elseif (F <= 2.3e-175) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 39000.0) tmp = t_0; else tmp = Float64(Float64(1.0 - t_1) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision]}, Block[{t$95$1 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.7e-15], N[(N[(-1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.2e-66], t$95$0, If[LessEqual[F, 2.3e-175], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 39000.0], t$95$0, N[(N[(1.0 - t$95$1), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, -\frac{x}{B}\right)\\
t_1 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 - t\_1}{\sin B}\\
\mathbf{elif}\;F \leq -4.2 \cdot 10^{-66}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-175}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 39000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_1}{\sin B}\\
\end{array}
\end{array}
if F < -2.70000000000000009e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
if -2.70000000000000009e-15 < F < -4.2000000000000001e-66 or 2.3e-175 < F < 39000Initial program 99.6%
Taylor expanded in B around 0
lower-/.f6481.2
Applied rewrites81.2%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
Applied rewrites81.2%
if -4.2000000000000001e-66 < F < 2.3e-175Initial program 99.6%
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.f6490.1
Applied rewrites90.1%
if 39000 < F Initial program 48.3%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification93.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.7e-15)
(/ (- -1.0 t_0) (sin B))
(if (<= F -1.3e-38)
(/ (* (sqrt 0.5) F) (sin B))
(if (<= F 1.05e-167)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 9000.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))
(/ (- 1.0 t_0) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.7e-15) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= -1.3e-38) {
tmp = (sqrt(0.5) * F) / sin(B);
} else if (F <= 1.05e-167) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 9000.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.7e-15) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= -1.3e-38) tmp = Float64(Float64(sqrt(0.5) * F) / sin(B)); elseif (F <= 1.05e-167) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 9000.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.7e-15], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-38], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-167], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9000.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-38}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 9000:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.70000000000000009e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
if -2.70000000000000009e-15 < F < -1.30000000000000005e-38Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6499.6
Applied rewrites99.6%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
sqrt-unprodN/A
lower-/.f64N/A
sqrt-unprodN/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
metadata-evalN/A
lift-sin.f6499.6
Applied rewrites99.6%
if -1.30000000000000005e-38 < F < 1.05000000000000009e-167Initial program 99.6%
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.f6488.8
Applied rewrites88.8%
if 1.05000000000000009e-167 < F < 9e3Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6463.4
Applied rewrites63.4%
if 9e3 < F Initial program 48.3%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Final simplification91.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1800000.0)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1.42e-36)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B) (/ (- x) (tan B)))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1800000.0) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1.42e-36) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / B), (-x / tan(B)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1800000.0) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1.42e-36) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / B), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1800000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.42e-36], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1800000:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -1.8e6Initial program 58.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
if -1.8e6 < F < 1.41999999999999996e-36Initial program 99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.6%
lift-*.f64N/A
lift-/.f64N/A
lift-tan.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lift-tan.f6499.7
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites86.9%
if 1.41999999999999996e-36 < F Initial program 52.3%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6496.1
Applied rewrites96.1%
Final simplification92.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.7e-15)
(/ (- -1.0 t_0) (sin B))
(if (<= F -1.3e-38)
(/ (* (sqrt 0.5) F) (sin B))
(if (<= F 1.05e-167)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 1.7e-13)
(* (sqrt 0.5) (/ F (sin B)))
(/ (- 1.0 t_0) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.7e-15) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= -1.3e-38) {
tmp = (sqrt(0.5) * F) / sin(B);
} else if (F <= 1.05e-167) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 1.7e-13) {
tmp = sqrt(0.5) * (F / sin(B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = cos(b) * x
if (f <= (-2.7d-15)) then
tmp = ((-1.0d0) - t_0) / sin(b)
else if (f <= (-1.3d-38)) then
tmp = (sqrt(0.5d0) * f) / sin(b)
else if (f <= 1.05d-167) then
tmp = (cos(b) * -x) / sin(b)
else if (f <= 1.7d-13) then
tmp = sqrt(0.5d0) * (f / sin(b))
else
tmp = (1.0d0 - t_0) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.cos(B) * x;
double tmp;
if (F <= -2.7e-15) {
tmp = (-1.0 - t_0) / Math.sin(B);
} else if (F <= -1.3e-38) {
tmp = (Math.sqrt(0.5) * F) / Math.sin(B);
} else if (F <= 1.05e-167) {
tmp = (Math.cos(B) * -x) / Math.sin(B);
} else if (F <= 1.7e-13) {
tmp = Math.sqrt(0.5) * (F / Math.sin(B));
} else {
tmp = (1.0 - t_0) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = math.cos(B) * x tmp = 0 if F <= -2.7e-15: tmp = (-1.0 - t_0) / math.sin(B) elif F <= -1.3e-38: tmp = (math.sqrt(0.5) * F) / math.sin(B) elif F <= 1.05e-167: tmp = (math.cos(B) * -x) / math.sin(B) elif F <= 1.7e-13: tmp = math.sqrt(0.5) * (F / math.sin(B)) else: tmp = (1.0 - t_0) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.7e-15) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= -1.3e-38) tmp = Float64(Float64(sqrt(0.5) * F) / sin(B)); elseif (F <= 1.05e-167) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 1.7e-13) tmp = Float64(sqrt(0.5) * Float64(F / sin(B))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = cos(B) * x; tmp = 0.0; if (F <= -2.7e-15) tmp = (-1.0 - t_0) / sin(B); elseif (F <= -1.3e-38) tmp = (sqrt(0.5) * F) / sin(B); elseif (F <= 1.05e-167) tmp = (cos(B) * -x) / sin(B); elseif (F <= 1.7e-13) tmp = sqrt(0.5) * (F / sin(B)); else tmp = (1.0 - t_0) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.7e-15], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-38], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-167], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-13], N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-38}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-13}:\\
\;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.70000000000000009e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
if -2.70000000000000009e-15 < F < -1.30000000000000005e-38Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6499.6
Applied rewrites99.6%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
sqrt-unprodN/A
lower-/.f64N/A
sqrt-unprodN/A
metadata-evalN/A
metadata-evalN/A
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
metadata-evalN/A
lift-sin.f6499.6
Applied rewrites99.6%
if -1.30000000000000005e-38 < F < 1.05000000000000009e-167Initial program 99.6%
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.f6488.8
Applied rewrites88.8%
if 1.05000000000000009e-167 < F < 1.70000000000000008e-13Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6462.9
Applied rewrites62.9%
Taylor expanded in F around 0
Applied rewrites62.9%
if 1.70000000000000008e-13 < F Initial program 50.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
Final simplification91.3%
(FPCore (F B x)
:precision binary64
(if (<= F -28500000000.0)
(/ (- -1.0 x) (sin B))
(if (<= F 1.05e-167)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 1.7e-13)
(* (sqrt 0.5) (/ F (sin B)))
(/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -28500000000.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.05e-167) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 1.7e-13) {
tmp = sqrt(0.5) * (F / sin(B));
} else {
tmp = (1.0 - (cos(B) * x)) / 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 <= (-28500000000.0d0)) then
tmp = ((-1.0d0) - x) / sin(b)
else if (f <= 1.05d-167) then
tmp = (cos(b) * -x) / sin(b)
else if (f <= 1.7d-13) then
tmp = sqrt(0.5d0) * (f / sin(b))
else
tmp = (1.0d0 - (cos(b) * x)) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -28500000000.0) {
tmp = (-1.0 - x) / Math.sin(B);
} else if (F <= 1.05e-167) {
tmp = (Math.cos(B) * -x) / Math.sin(B);
} else if (F <= 1.7e-13) {
tmp = Math.sqrt(0.5) * (F / Math.sin(B));
} else {
tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -28500000000.0: tmp = (-1.0 - x) / math.sin(B) elif F <= 1.05e-167: tmp = (math.cos(B) * -x) / math.sin(B) elif F <= 1.7e-13: tmp = math.sqrt(0.5) * (F / math.sin(B)) else: tmp = (1.0 - (math.cos(B) * x)) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -28500000000.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.05e-167) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 1.7e-13) tmp = Float64(sqrt(0.5) * Float64(F / sin(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -28500000000.0) tmp = (-1.0 - x) / sin(B); elseif (F <= 1.05e-167) tmp = (cos(B) * -x) / sin(B); elseif (F <= 1.7e-13) tmp = sqrt(0.5) * (F / sin(B)); else tmp = (1.0 - (cos(B) * x)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -28500000000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-167], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.7e-13], N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -28500000000:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-13}:\\
\;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.85e10Initial program 57.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites88.1%
if -2.85e10 < F < 1.05000000000000009e-167Initial program 99.6%
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.f6481.9
Applied rewrites81.9%
if 1.05000000000000009e-167 < F < 1.70000000000000008e-13Initial program 99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6462.9
Applied rewrites62.9%
Taylor expanded in F around 0
Applied rewrites62.9%
if 1.70000000000000008e-13 < F Initial program 50.4%
Taylor expanded in F around inf
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6498.4
Applied rewrites98.4%
Final simplification85.8%
(FPCore (F B x)
:precision binary64
(if (<= F -28500000000.0)
(/ (- -1.0 x) (sin B))
(if (<= F 1.05e-167)
(/ (* (cos B) (- x)) (sin B))
(if (<= F 1.06e+77)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(if (<= F 4e+166)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B)
(pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -28500000000.0) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.05e-167) {
tmp = (cos(B) * -x) / sin(B);
} else if (F <= 1.06e+77) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else if (F <= 4e+166) {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -28500000000.0) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.05e-167) tmp = Float64(Float64(cos(B) * Float64(-x)) / sin(B)); elseif (F <= 1.06e+77) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (F <= 4e+166) tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -28500000000.0], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-167], N[(N[(N[Cos[B], $MachinePrecision] * (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.06e+77], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e+166], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -28500000000:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-167}:\\
\;\;\;\;\frac{\cos B \cdot \left(-x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{+77}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if F < -2.85e10Initial program 57.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites88.1%
if -2.85e10 < F < 1.05000000000000009e-167Initial program 99.6%
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.f6481.9
Applied rewrites81.9%
if 1.05000000000000009e-167 < F < 1.06000000000000003e77Initial program 99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6465.7
Applied rewrites65.7%
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6465.6
Applied rewrites65.6%
if 1.06000000000000003e77 < F < 3.99999999999999976e166Initial program 71.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites60.1%
Taylor expanded in F around inf
lower--.f6460.2
Applied rewrites60.2%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6465.6
Applied rewrites65.6%
if 3.99999999999999976e166 < F Initial program 15.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f641.9
Applied rewrites1.9%
Taylor expanded in F around inf
inv-powN/A
lower-pow.f64N/A
lift-sin.f6467.5
Applied rewrites67.5%
Final simplification76.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2.5e-15)
(/ (- -1.0 x) (sin B))
(if (<= F 1.02e-167)
(- (* (/ F B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (/ x B))
(if (<= F 1.06e+77)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(if (<= F 4e+166)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B)
(pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-15) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.02e-167) {
tmp = ((F / B) * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) - (x / B);
} else if (F <= 1.06e+77) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else if (F <= 4e+166) {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-15) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.02e-167) tmp = Float64(Float64(Float64(F / B) * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 1.06e+77) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); elseif (F <= 4e+166) tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-15], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-167], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.06e+77], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4e+166], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-167}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{+77}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+166}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if F < -2.5e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Taylor expanded in B around 0
Applied rewrites81.7%
if -2.5e-15 < F < 1.0199999999999999e-167Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.6%
Applied rewrites49.6%
if 1.0199999999999999e-167 < F < 1.06000000000000003e77Initial program 99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6465.7
Applied rewrites65.7%
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6465.6
Applied rewrites65.6%
if 1.06000000000000003e77 < F < 3.99999999999999976e166Initial program 71.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites60.1%
Taylor expanded in F around inf
lower--.f6460.2
Applied rewrites60.2%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6465.6
Applied rewrites65.6%
if 3.99999999999999976e166 < F Initial program 15.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f641.9
Applied rewrites1.9%
Taylor expanded in F around inf
inv-powN/A
lower-pow.f64N/A
lift-sin.f6467.5
Applied rewrites67.5%
Final simplification64.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.5e-15)
(/ (- -1.0 x) (sin B))
(if (<= F 1.02e-167)
(- (* (/ F B) (pow (fma 2.0 x (fma F F 2.0)) -0.5)) (/ x B))
(if (<= F 1.06e+77)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-15) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.02e-167) {
tmp = ((F / B) * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)) - (x / B);
} else if (F <= 1.06e+77) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-15) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.02e-167) tmp = Float64(Float64(Float64(F / B) * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 1.06e+77) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-15], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-167], N[(N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.06e+77], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-167}:\\
\;\;\;\;\frac{F}{B} \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{+77}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -2.5e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Taylor expanded in B around 0
Applied rewrites81.7%
if -2.5e-15 < F < 1.0199999999999999e-167Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.6%
Applied rewrites49.6%
if 1.0199999999999999e-167 < F < 1.06000000000000003e77Initial program 99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6465.7
Applied rewrites65.7%
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6465.6
Applied rewrites65.6%
if 1.06000000000000003e77 < F Initial program 32.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.9%
Taylor expanded in F around inf
lower--.f6449.3
Applied rewrites49.3%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6451.1
Applied rewrites51.1%
Final simplification61.2%
(FPCore (F B x)
:precision binary64
(if (<= F -2.5e-15)
(/ (- -1.0 x) (sin B))
(if (<= F 3.5e-164)
(/ (- (* (sqrt 0.5) F) x) B)
(if (<= F 1.06e+77)
(* (/ 1.0 (sqrt (fma F F 2.0))) (/ F (sin B)))
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-15) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 3.5e-164) {
tmp = ((sqrt(0.5) * F) - x) / B;
} else if (F <= 1.06e+77) {
tmp = (1.0 / sqrt(fma(F, F, 2.0))) * (F / sin(B));
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-15) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 3.5e-164) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B); elseif (F <= 1.06e+77) tmp = Float64(Float64(1.0 / sqrt(fma(F, F, 2.0))) * Float64(F / sin(B))); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-15], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-164], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.06e+77], N[(N[(1.0 / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-164}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{elif}\;F \leq 1.06 \cdot 10^{+77}:\\
\;\;\;\;\frac{1}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -2.5e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Taylor expanded in B around 0
Applied rewrites81.7%
if -2.5e-15 < F < 3.5e-164Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6450.7
Applied rewrites50.7%
Taylor expanded in x around 0
Applied rewrites50.7%
if 3.5e-164 < F < 1.06000000000000003e77Initial program 99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
lift-sin.f64N/A
lift-/.f6464.3
Applied rewrites64.3%
lift-sqrt.f64N/A
lift-pow.f64N/A
lift-fma.f64N/A
unpow-1N/A
pow2N/A
+-commutativeN/A
sqrt-divN/A
metadata-evalN/A
lower-/.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
pow2N/A
lift-fma.f6464.2
Applied rewrites64.2%
if 1.06000000000000003e77 < F Initial program 32.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.9%
Taylor expanded in F around inf
lower--.f6449.3
Applied rewrites49.3%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6451.1
Applied rewrites51.1%
Final simplification61.2%
(FPCore (F B x)
:precision binary64
(if (<= F -2.5e-15)
(/ (- -1.0 x) (sin B))
(if (<= F 1.35e+37)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-15) {
tmp = (-1.0 - x) / sin(B);
} else if (F <= 1.35e+37) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-15) tmp = Float64(Float64(-1.0 - x) / sin(B)); elseif (F <= 1.35e+37) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-15], N[(N[(-1.0 - x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e+37], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1 - x}{\sin B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -2.5e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Taylor expanded in B around 0
Applied rewrites81.7%
if -2.5e-15 < F < 1.34999999999999993e37Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites48.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f6448.7
Applied rewrites48.7%
if 1.34999999999999993e37 < F Initial program 42.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.1%
Taylor expanded in F around inf
lower--.f6446.0
Applied rewrites46.0%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6447.5
Applied rewrites47.5%
Final simplification56.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.65e+66)
(/ -1.0 (sin B))
(if (<= F 1.35e+37)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.65e+66) {
tmp = -1.0 / sin(B);
} else if (F <= 1.35e+37) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.65e+66) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.35e+37) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.65e+66], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.35e+37], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.65 \cdot 10^{+66}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -1.6500000000000001e66Initial program 48.7%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
lower-/.f64N/A
lift-sin.f6467.5
Applied rewrites67.5%
if -1.6500000000000001e66 < F < 1.34999999999999993e37Initial program 98.8%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.1%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f6449.1
Applied rewrites49.1%
if 1.34999999999999993e37 < F Initial program 42.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.1%
Taylor expanded in F around inf
lower--.f6446.0
Applied rewrites46.0%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6447.5
Applied rewrites47.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2.7e-15)
(/ (- (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) 1.0) x) B)
(if (<= F 1.35e+37)
(/ (- (* (sqrt (/ 1.0 (fma 2.0 x (fma F F 2.0)))) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-15) {
tmp = ((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - 1.0) - x) / B;
} else if (F <= 1.35e+37) {
tmp = ((sqrt((1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.7e-15) tmp = Float64(Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - 1.0) - x) / B); elseif (F <= 1.35e+37) tmp = Float64(Float64(Float64(sqrt(Float64(1.0 / fma(2.0, x, fma(F, F, 2.0)))) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.7e-15], N[(N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.35e+37], N[(N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{+37}:\\
\;\;\;\;\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -2.70000000000000009e-15Initial program 61.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites35.6%
Taylor expanded in F around -inf
metadata-evalN/A
associate--r+N/A
lower--.f64N/A
Applied rewrites53.7%
if -2.70000000000000009e-15 < F < 1.34999999999999993e37Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites48.7%
lift-pow.f64N/A
lift-+.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
pow2N/A
+-commutativeN/A
inv-powN/A
+-commutativeN/A
associate-+r+N/A
pow2N/A
+-commutativeN/A
lower-/.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f6448.7
Applied rewrites48.7%
if 1.34999999999999993e37 < F Initial program 42.9%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.1%
Taylor expanded in F around inf
lower--.f6446.0
Applied rewrites46.0%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6447.5
Applied rewrites47.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2.7e-15)
(/ (- (- (* (/ (fma 2.0 x 2.0) (* F F)) 0.5) 1.0) x) B)
(if (<= F 205000000.0)
(/ (- (* (sqrt 0.5) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-15) {
tmp = ((((fma(2.0, x, 2.0) / (F * F)) * 0.5) - 1.0) - x) / B;
} else if (F <= 205000000.0) {
tmp = ((sqrt(0.5) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.7e-15) tmp = Float64(Float64(Float64(Float64(Float64(fma(2.0, x, 2.0) / Float64(F * F)) * 0.5) - 1.0) - x) / B); elseif (F <= 205000000.0) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.7e-15], N[(N[(N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] - 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 205000000.0], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;\frac{\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F} \cdot 0.5 - 1\right) - x}{B}\\
\mathbf{elif}\;F \leq 205000000:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -2.70000000000000009e-15Initial program 61.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites35.6%
Taylor expanded in F around -inf
metadata-evalN/A
associate--r+N/A
lower--.f64N/A
Applied rewrites53.7%
if -2.70000000000000009e-15 < F < 2.05e8Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.4%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6449.4
Applied rewrites49.4%
Taylor expanded in x around 0
Applied rewrites49.4%
if 2.05e8 < F Initial program 47.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.5%
Taylor expanded in F around inf
lower--.f6445.2
Applied rewrites45.2%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6446.6
Applied rewrites46.6%
(FPCore (F B x)
:precision binary64
(if (<= F -2.7e-15)
(/
(-
(*
(- (* -0.16666666666666666 x) (fma -0.5 x 0.16666666666666666))
(* B B))
(+ 1.0 x))
B)
(if (<= F 205000000.0)
(/ (- (* (sqrt 0.5) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-15) {
tmp = ((((-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666)) * (B * B)) - (1.0 + x)) / B;
} else if (F <= 205000000.0) {
tmp = ((sqrt(0.5) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.7e-15) tmp = Float64(Float64(Float64(Float64(Float64(-0.16666666666666666 * x) - fma(-0.5, x, 0.16666666666666666)) * Float64(B * B)) - Float64(1.0 + x)) / B); elseif (F <= 205000000.0) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.7e-15], N[(N[(N[(N[(N[(-0.16666666666666666 * x), $MachinePrecision] - N[(-0.5 * x + 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 205000000.0], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{-15}:\\
\;\;\;\;\frac{\left(-0.16666666666666666 \cdot x - \mathsf{fma}\left(-0.5, x, 0.16666666666666666\right)\right) \cdot \left(B \cdot B\right) - \left(1 + x\right)}{B}\\
\mathbf{elif}\;F \leq 205000000:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -2.70000000000000009e-15Initial program 61.4%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lift-sin.f6499.2
Applied rewrites99.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6452.7
Applied rewrites52.7%
if -2.70000000000000009e-15 < F < 2.05e8Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.4%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6449.4
Applied rewrites49.4%
Taylor expanded in x around 0
Applied rewrites49.4%
if 2.05e8 < F Initial program 47.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.5%
Taylor expanded in F around inf
lower--.f6445.2
Applied rewrites45.2%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6446.6
Applied rewrites46.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(/ (- -1.0 x) B)
(if (<= F 205000000.0)
(/ (- (* (sqrt 0.5) F) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 205000000.0) {
tmp = ((sqrt(0.5) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (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 <= (-1.4d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 205000000.0d0) then
tmp = ((sqrt(0.5d0) * f) - x) / b
else
tmp = ((1.0d0 - (x * x)) / (1.0d0 + x)) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 205000000.0) {
tmp = ((Math.sqrt(0.5) * F) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.4: tmp = (-1.0 - x) / B elif F <= 205000000.0: tmp = ((math.sqrt(0.5) * F) - x) / B else: tmp = ((1.0 - (x * x)) / (1.0 + x)) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 205000000.0) tmp = Float64(Float64(Float64(sqrt(0.5) * F) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.4) tmp = (-1.0 - x) / B; elseif (F <= 205000000.0) tmp = ((sqrt(0.5) * F) - x) / B; else tmp = ((1.0 - (x * x)) / (1.0 + x)) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 205000000.0], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 205000000:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 59.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.3%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6411.3
Applied rewrites11.3%
Taylor expanded in F around -inf
Applied rewrites55.2%
if -1.3999999999999999 < F < 2.05e8Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites48.2%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6448.2
Applied rewrites48.2%
Taylor expanded in x around 0
Applied rewrites48.2%
if 2.05e8 < F Initial program 47.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites32.5%
Taylor expanded in F around inf
lower--.f6445.2
Applied rewrites45.2%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
unpow2N/A
lower--.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f6446.6
Applied rewrites46.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.4) (/ (- -1.0 x) B) (if (<= F 1.75e-13) (/ (- (* (sqrt 0.5) F) x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.75e-13) {
tmp = ((sqrt(0.5) * 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 <= (-1.4d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.75d-13) then
tmp = ((sqrt(0.5d0) * 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 <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.75e-13) {
tmp = ((Math.sqrt(0.5) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.4: tmp = (-1.0 - x) / B elif F <= 1.75e-13: tmp = ((math.sqrt(0.5) * F) - x) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.75e-13) tmp = Float64(Float64(Float64(sqrt(0.5) * 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 <= -1.4) tmp = (-1.0 - x) / B; elseif (F <= 1.75e-13) tmp = ((sqrt(0.5) * F) - x) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.75e-13], N[(N[(N[(N[Sqrt[0.5], $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 -1.4:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{-13}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 59.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites37.3%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6411.3
Applied rewrites11.3%
Taylor expanded in F around -inf
Applied rewrites55.2%
if -1.3999999999999999 < F < 1.7500000000000001e-13Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.7%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6449.7
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites49.7%
if 1.7500000000000001e-13 < F Initial program 50.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites30.8%
Taylor expanded in F around inf
lower--.f6442.9
Applied rewrites42.9%
(FPCore (F B x) :precision binary64 (if (<= F -3.6e-59) (/ (- -1.0 x) B) (if (<= F 1.2e-63) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-59) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.2e-63) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.6d-59)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.2d-63) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.6e-59) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.2e-63) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.6e-59: tmp = (-1.0 - x) / B elif F <= 1.2e-63: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.6e-59) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.2e-63) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.6e-59) tmp = (-1.0 - x) / B; elseif (F <= 1.2e-63) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.6e-59], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.2e-63], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.6 \cdot 10^{-59}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{-63}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.6e-59Initial program 66.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites36.6%
Taylor expanded in F around 0
inv-powN/A
lower-pow.f64N/A
+-commutativeN/A
lower-fma.f6415.2
Applied rewrites15.2%
Taylor expanded in F around -inf
Applied rewrites47.8%
if -3.6e-59 < F < 1.2e-63Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.7%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6440.1
Applied rewrites40.1%
if 1.2e-63 < F Initial program 56.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.3%
Taylor expanded in F around inf
lower--.f6439.6
Applied rewrites39.6%
(FPCore (F B x) :precision binary64 (if (<= F 1.2e-63) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.2e-63) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1.2d-63) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1.2e-63) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.2e-63: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.2e-63) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1.2e-63) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.2e-63], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.2 \cdot 10^{-63}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 1.2e-63Initial program 85.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites45.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6431.7
Applied rewrites31.7%
if 1.2e-63 < F Initial program 56.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.3%
Taylor expanded in F around inf
lower--.f6439.6
Applied rewrites39.6%
(FPCore (F B x) :precision binary64 (if (<= F 2.05e-20) (/ (- x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.05e-20) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 2.05d-20) then
tmp = -x / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.05e-20) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.05e-20: tmp = -x / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.05e-20) tmp = Float64(Float64(-x) / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2.05e-20) tmp = -x / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.05e-20], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.05 \cdot 10^{-20}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 2.05e-20Initial program 86.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites45.5%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f6430.7
Applied rewrites30.7%
if 2.05e-20 < F Initial program 50.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites30.8%
Taylor expanded in F around inf
lower--.f6442.9
Applied rewrites42.9%
Taylor expanded in x around 0
Applied rewrites25.7%
(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 75.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites41.2%
Taylor expanded in F around inf
lower--.f6425.3
Applied rewrites25.3%
Taylor expanded in x around 0
Applied rewrites9.7%
herbie shell --seed 2025085
(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))))))