
(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]
\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)}
Herbie found 24 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]
\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)}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -6e+16)
(fma t_0 -1.0 t_1)
(if (<= F 5.8e-5)
(+
(- (/ (/ x (sin B)) (/ 1.0 (cos B))))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -6e+16) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5.8e-5) {
tmp = -((x / sin(B)) / (1.0 / cos(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -6e+16) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5.8e-5) tmp = Float64(Float64(-Float64(Float64(x / sin(B)) / Float64(1.0 / cos(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 = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6e+16], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e-5], N[((-N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(1.0 / N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;\left(-\frac{\frac{x}{\sin B}}{\frac{1}{\cos 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}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -6e16Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around -inf
Applied rewrites57.2%
if -6e16 < F < 5.8e-5Initial program 77.0%
lift-*.f64N/A
lift-/.f64N/A
mult-flip-revN/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
mult-flipN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-cos.f6477.1%
Applied rewrites77.1%
if 5.8e-5 < F Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -6e+16)
(fma t_0 -1.0 t_1)
(if (<= F 5.8e-5)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -6e+16) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5.8e-5) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -6e+16) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5.8e-5) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6e+16], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e-5], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -6 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -6e16Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around -inf
Applied rewrites57.2%
if -6e16 < F < 5.8e-5Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.0%
Applied rewrites77.2%
if 5.8e-5 < F Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.2e-5)
(fma t_0 -1.0 t_1)
(if (<= F 5.8e-5)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F (sin B))) (/ x (tan B)))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.2e-5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5.8e-5) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5.8e-5) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e-5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e-5], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.2e-5Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around -inf
Applied rewrites57.2%
if -1.2e-5 < F < 5.8e-5Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.0%
Applied rewrites77.2%
Taylor expanded in F around 0
Applied rewrites54.8%
if 5.8e-5 < F Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.35e-5)
(fma t_0 -1.0 t_1)
(if (<= F 4.5e-6)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.35e-5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 4.5e-6) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.35e-5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 4.5e-6) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35e-5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 4.5e-6], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.3499999999999999e-5Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around -inf
Applied rewrites57.2%
if -1.3499999999999999e-5 < F < 4.50000000000000011e-6Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.0%
Applied rewrites77.2%
Taylor expanded in B around 0
Applied rewrites63.1%
if 4.50000000000000011e-6 < F Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around inf
Applied rewrites56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -1.35e-5)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F 2.9e-5)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(fma t_0 1.0 (- (/ x B)))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -1.35e-5) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= 2.9e-5) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else {
tmp = fma(t_0, 1.0, -(x / B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -1.35e-5) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= 2.9e-5) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); else tmp = fma(t_0, 1.0, Float64(-Float64(x / B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.35e-5], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.9e-5], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + (-N[(x / B), $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, -\frac{x}{B}\right)\\
\end{array}
if F < -1.3499999999999999e-5Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites85.0%
Taylor expanded in F around -inf
Applied rewrites57.2%
if -1.3499999999999999e-5 < F < 2.9e-5Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.0%
Applied rewrites77.2%
Taylor expanded in B around 0
Applied rewrites63.1%
if 2.9e-5 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x B))))
(if (<= F -6.8e+16)
(fma t_0 -1.0 t_1)
(if (<= F 2.9e-5)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F B)) (/ x (tan B)))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / B);
double tmp;
if (F <= -6.8e+16) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 2.9e-5) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / tan(B));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -6.8e+16) tmp = fma(t_0, -1.0, t_1); elseif (F <= 2.9e-5) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / tan(B))); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -6.8e+16], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 2.9e-5], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -6.8 \cdot 10^{+16}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -6.8e16Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
Applied rewrites37.0%
if -6.8e16 < F < 2.9e-5Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.0%
Applied rewrites77.2%
Taylor expanded in B around 0
Applied rewrites63.1%
if 2.9e-5 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* -1.0 (/ (* x (cos B)) (sin B)))))
(if (<= x -82000000.0)
t_0
(if (<= x 85000000000.0)
(fma F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) (- (/ x B)))
t_0))))double code(double F, double B, double x) {
double t_0 = -1.0 * ((x * cos(B)) / sin(B));
double tmp;
if (x <= -82000000.0) {
tmp = t_0;
} else if (x <= 85000000000.0) {
tmp = fma(F, (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), -(x / B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 * Float64(Float64(x * cos(B)) / sin(B))) tmp = 0.0 if (x <= -82000000.0) tmp = t_0; elseif (x <= 85000000000.0) tmp = fma(F, Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(-Float64(x / B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -82000000.0], t$95$0, If[LessEqual[x, 85000000000.0], N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := -1 \cdot \frac{x \cdot \cos B}{\sin B}\\
\mathbf{if}\;x \leq -82000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 85000000000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, -\frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -8.2e7 or 8.5e10 < x Initial program 77.0%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6456.5%
Applied rewrites56.5%
if -8.2e7 < x < 8.5e10Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites56.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x B))))
(if (<= F -1.2e-5)
(fma t_0 -1.0 t_1)
(if (<= F 5.8e-5)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x B))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / B);
double tmp;
if (F <= -1.2e-5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5.8e-5) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / B);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5.8e-5) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B)); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.2e-5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e-5], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.2e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
Applied rewrites37.0%
if -1.2e-5 < F < 5.8e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.1%
Applied rewrites49.1%
if 5.8e-5 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x B))))
(if (<= F -1.2e-5)
(fma t_0 -1.0 t_1)
(if (<= F 5.8e-5)
(+ t_1 (* (/ (pow (fma 2.0 x 2.0) -0.5) (sin B)) F))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / B);
double tmp;
if (F <= -1.2e-5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5.8e-5) {
tmp = t_1 + ((pow(fma(2.0, x, 2.0), -0.5) / sin(B)) * F);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5.8e-5) tmp = Float64(t_1 + Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) / sin(B)) * F)); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.2e-5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e-5], N[(t$95$1 + N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;t\_1 + \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B} \cdot F\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.2e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
Applied rewrites37.0%
if -1.2e-5 < F < 5.8e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6435.6%
Applied rewrites35.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6435.6%
Applied rewrites35.6%
if 5.8e-5 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x B))))
(if (<= F -1.2e-5)
(fma t_0 -1.0 t_1)
(if (<= F 5.8e-5)
(- (* (pow (fma 2.0 x 2.0) -0.5) (/ F (sin B))) (/ x B))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / B);
double tmp;
if (F <= -1.2e-5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5.8e-5) {
tmp = (pow(fma(2.0, x, 2.0), -0.5) * (F / sin(B))) - (x / B);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5.8e-5) tmp = Float64(Float64((fma(2.0, x, 2.0) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B)); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.2e-5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e-5], N[(N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.2e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
Applied rewrites37.0%
if -1.2e-5 < F < 5.8e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6435.6%
Applied rewrites35.6%
metadata-eval35.6%
metadata-eval35.6%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
Applied rewrites34.9%
if 5.8e-5 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x B))))
(if (<= F -1.2e-5)
(fma t_0 -1.0 t_1)
(if (<= F 5.8e-5)
(+ t_1 (/ (* F (pow 2.0 -0.5)) (sin B)))
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / B);
double tmp;
if (F <= -1.2e-5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 5.8e-5) {
tmp = t_1 + ((F * pow(2.0, -0.5)) / sin(B));
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 5.8e-5) tmp = Float64(t_1 + Float64(Float64(F * (2.0 ^ -0.5)) / sin(B))); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.2e-5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 5.8e-5], N[(t$95$1 + N[(N[(F * N[Power[2.0, -0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-5}:\\
\;\;\;\;t\_1 + \frac{F \cdot {2}^{-0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.2e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
Applied rewrites37.0%
if -1.2e-5 < F < 5.8e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6435.6%
Applied rewrites35.6%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
metadata-evalN/A
metadata-eval36.7%
Applied rewrites36.7%
if 5.8e-5 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x B))))
(if (<= F -1.2e-5)
(fma t_0 -1.0 t_1)
(if (<= F 4.5e-6)
(fma (/ 1.0 B) (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) t_1)
(fma t_0 1.0 t_1)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / B);
double tmp;
if (F <= -1.2e-5) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 4.5e-6) {
tmp = fma((1.0 / B), (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(t_0, -1.0, t_1); elseif (F <= 4.5e-6) tmp = fma(Float64(1.0 / B), Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.2e-5], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 4.5e-6], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
if F < -1.2e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
Applied rewrites37.0%
if -1.2e-5 < F < 4.50000000000000011e-6Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in B around 0
lower-/.f6443.5%
Applied rewrites43.5%
if 4.50000000000000011e-6 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around inf
Applied rewrites35.9%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.85e-8)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) (fabs B))
(- (* (/ -1.0 F) (/ F (fabs B))) (/ x (tan (fabs B)))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 1.85e-8) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / fabs(B);
} else {
tmp = ((-1.0 / F) * (F / fabs(B))) - (x / tan(fabs(B)));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 1.85e-8) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / abs(B)); else tmp = Float64(Float64(Float64(-1.0 / F) * Float64(F / abs(B))) - Float64(x / tan(abs(B)))); end return Float64(copysign(1.0, B) * tmp) end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 1.85e-8], N[(N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x + N[Power[F, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 / F), $MachinePrecision] * N[(F / N[Abs[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 1.85 \cdot 10^{-8}:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{F} \cdot \frac{F}{\left|B\right|} - \frac{x}{\tan \left(\left|B\right|\right)}\\
\end{array}
if B < 1.85e-8Initial program 77.0%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites43.5%
if 1.85e-8 < B Initial program 77.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.0%
Applied rewrites77.2%
Taylor expanded in F around -inf
lower-/.f6449.4%
Applied rewrites49.4%
Taylor expanded in B around 0
lower-/.f6448.0%
Applied rewrites48.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= F -1.2e-5)
(fma (/ 1.0 (sin B)) -1.0 t_0)
(fma (/ 1.0 B) (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) t_0))))double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (F <= -1.2e-5) {
tmp = fma((1.0 / sin(B)), -1.0, t_0);
} else {
tmp = fma((1.0 / B), (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(Float64(1.0 / sin(B)), -1.0, t_0); else tmp = fma(Float64(1.0 / B), Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -1.2e-5], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * -1.0 + t$95$0), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$0), $MachinePrecision]]]
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, -1, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_0\right)\\
\end{array}
if F < -1.2e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
Applied rewrites37.0%
if -1.2e-5 < F Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in B around 0
lower-/.f6443.5%
Applied rewrites43.5%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.4e-5)
(fma
(/ 1.0 (fabs B))
(* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F)
(- (/ x (fabs B))))
(/ -1.0 (sin (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 1.4e-5) {
tmp = fma((1.0 / fabs(B)), (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F), -(x / fabs(B)));
} else {
tmp = -1.0 / sin(fabs(B));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 1.4e-5) tmp = fma(Float64(1.0 / abs(B)), Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F), Float64(-Float64(x / abs(B)))); else tmp = Float64(-1.0 / sin(abs(B))); end return Float64(copysign(1.0, B) * tmp) end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 1.4e-5], N[(N[(1.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + (-N[(x / N[Abs[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], N[(-1.0 / N[Sin[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 1.4 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\left|B\right|}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, -\frac{x}{\left|B\right|}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin \left(\left|B\right|\right)}\\
\end{array}
if B < 1.39999999999999998e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in B around 0
lower-/.f6443.5%
Applied rewrites43.5%
if 1.39999999999999998e-5 < B Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2e-5)
(fma
(/ (+ 1.0 (* 0.16666666666666666 (pow B 2.0))) B)
(* (/ -1.0 F) F)
(- (/ x B)))
(if (<= F 7.2e+140)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e-5) {
tmp = fma(((1.0 + (0.16666666666666666 * pow(B, 2.0))) / B), ((-1.0 / F) * F), -(x / B));
} else if (F <= 7.2e+140) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.2e-5) tmp = fma(Float64(Float64(1.0 + Float64(0.16666666666666666 * (B ^ 2.0))) / B), Float64(Float64(-1.0 / F) * F), Float64(-Float64(x / B))); elseif (F <= 7.2e+140) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.2e-5], N[(N[(N[(1.0 + N[(0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] * N[(N[(-1.0 / F), $MachinePrecision] * F), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 7.2e+140], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1 + 0.16666666666666666 \cdot {B}^{2}}{B}, \frac{-1}{F} \cdot F, -\frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{+140}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -1.2e-5Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites56.9%
Taylor expanded in F around -inf
lower-/.f6437.0%
Applied rewrites37.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6429.6%
Applied rewrites29.6%
if -1.2e-5 < F < 7.1999999999999999e140Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f6435.7%
Applied rewrites35.7%
if 7.1999999999999999e140 < F Initial program 77.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.1%
Applied rewrites16.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1020000000000.0)
(/ -1.0 (sin B))
(if (<= F 7.2e+140)
(- (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B)) (/ x B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -1020000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 7.2e+140) {
tmp = (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1020000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 7.2e+140) tmp = Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1020000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e+140], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1020000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{+140}:\\
\;\;\;\;{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -1.02e12Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
if -1.02e12 < F < 7.1999999999999999e140Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6449.1%
Applied rewrites49.1%
Taylor expanded in B around 0
lower-/.f6435.7%
Applied rewrites35.7%
if 7.1999999999999999e140 < F Initial program 77.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.1%
Applied rewrites16.1%
(FPCore (F B x)
:precision binary64
(if (<= F -23000000000.0)
(/ -1.0 (sin B))
(if (<= F 210.0)
(+ (- (/ x B)) (/ (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) B))
(/ 1.0 (sin B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -23000000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 210.0) {
tmp = -(x / B) + ((F * pow((2.0 + (2.0 * x)), -0.5)) / 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 <= (-23000000000.0d0)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 210.0d0) then
tmp = -(x / b) + ((f * ((2.0d0 + (2.0d0 * x)) ** (-0.5d0))) / 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 <= -23000000000.0) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 210.0) {
tmp = -(x / B) + ((F * Math.pow((2.0 + (2.0 * x)), -0.5)) / B);
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -23000000000.0: tmp = -1.0 / math.sin(B) elif F <= 210.0: tmp = -(x / B) + ((F * math.pow((2.0 + (2.0 * x)), -0.5)) / B) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -23000000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 210.0) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -23000000000.0) tmp = -1.0 / sin(B); elseif (F <= 210.0) tmp = -(x / B) + ((F * ((2.0 + (2.0 * x)) ^ -0.5)) / B); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -23000000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 210.0], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -23000000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 210:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -2.3e10Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
if -2.3e10 < F < 210Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6435.6%
Applied rewrites35.6%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval29.1%
Applied rewrites29.1%
if 210 < F Initial program 77.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.1%
Applied rewrites16.1%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= F -23000000000.0)
(/ -1.0 (sin (fabs B)))
(if (<= F 2.1e+80)
(+ (- (/ x (fabs B))) (/ (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) (fabs B)))
(fabs (/ -1.0 (fabs B)))))))double code(double F, double B, double x) {
double tmp;
if (F <= -23000000000.0) {
tmp = -1.0 / sin(fabs(B));
} else if (F <= 2.1e+80) {
tmp = -(x / fabs(B)) + ((F * pow((2.0 + (2.0 * x)), -0.5)) / fabs(B));
} else {
tmp = fabs((-1.0 / fabs(B)));
}
return copysign(1.0, B) * tmp;
}
public static double code(double F, double B, double x) {
double tmp;
if (F <= -23000000000.0) {
tmp = -1.0 / Math.sin(Math.abs(B));
} else if (F <= 2.1e+80) {
tmp = -(x / Math.abs(B)) + ((F * Math.pow((2.0 + (2.0 * x)), -0.5)) / Math.abs(B));
} else {
tmp = Math.abs((-1.0 / Math.abs(B)));
}
return Math.copySign(1.0, B) * tmp;
}
def code(F, B, x): tmp = 0 if F <= -23000000000.0: tmp = -1.0 / math.sin(math.fabs(B)) elif F <= 2.1e+80: tmp = -(x / math.fabs(B)) + ((F * math.pow((2.0 + (2.0 * x)), -0.5)) / math.fabs(B)) else: tmp = math.fabs((-1.0 / math.fabs(B))) return math.copysign(1.0, B) * tmp
function code(F, B, x) tmp = 0.0 if (F <= -23000000000.0) tmp = Float64(-1.0 / sin(abs(B))); elseif (F <= 2.1e+80) tmp = Float64(Float64(-Float64(x / abs(B))) + Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) / abs(B))); else tmp = abs(Float64(-1.0 / abs(B))); end return Float64(copysign(1.0, B) * tmp) end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -23000000000.0) tmp = -1.0 / sin(abs(B)); elseif (F <= 2.1e+80) tmp = -(x / abs(B)) + ((F * ((2.0 + (2.0 * x)) ^ -0.5)) / abs(B)); else tmp = abs((-1.0 / abs(B))); end tmp_2 = (sign(B) * abs(1.0)) * tmp; end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[F, -23000000000.0], N[(-1.0 / N[Sin[N[Abs[B], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e+80], N[((-N[(x / N[Abs[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-1.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;F \leq -23000000000:\\
\;\;\;\;\frac{-1}{\sin \left(\left|B\right|\right)}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{+80}:\\
\;\;\;\;\left(-\frac{x}{\left|B\right|}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{\left|B\right|}\right|\\
\end{array}
if F < -2.3e10Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
if -2.3e10 < F < 2.10000000000000001e80Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6435.6%
Applied rewrites35.6%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval29.1%
Applied rewrites29.1%
if 2.10000000000000001e80 < F Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.7%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f64N/A
lower-neg.f644.8%
Applied rewrites4.8%
lift-exp.f64N/A
exp-fabsN/A
lift-exp.f64N/A
lower-fabs.f644.8%
lift-exp.f64N/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
unpow-1N/A
metadata-evalN/A
lift-neg.f64N/A
frac-2neg-revN/A
lower-/.f649.8%
Applied rewrites9.8%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= F -70000000000000.0)
(/ (- (* -0.16666666666666666 (pow (fabs B) 2.0)) 1.0) (fabs B))
(if (<= F 2.1e+80)
(+ (- (/ x (fabs B))) (/ (* F (pow (+ 2.0 (* 2.0 x)) -0.5)) (fabs B)))
(fabs (/ -1.0 (fabs B)))))))double code(double F, double B, double x) {
double tmp;
if (F <= -70000000000000.0) {
tmp = ((-0.16666666666666666 * pow(fabs(B), 2.0)) - 1.0) / fabs(B);
} else if (F <= 2.1e+80) {
tmp = -(x / fabs(B)) + ((F * pow((2.0 + (2.0 * x)), -0.5)) / fabs(B));
} else {
tmp = fabs((-1.0 / fabs(B)));
}
return copysign(1.0, B) * tmp;
}
public static double code(double F, double B, double x) {
double tmp;
if (F <= -70000000000000.0) {
tmp = ((-0.16666666666666666 * Math.pow(Math.abs(B), 2.0)) - 1.0) / Math.abs(B);
} else if (F <= 2.1e+80) {
tmp = -(x / Math.abs(B)) + ((F * Math.pow((2.0 + (2.0 * x)), -0.5)) / Math.abs(B));
} else {
tmp = Math.abs((-1.0 / Math.abs(B)));
}
return Math.copySign(1.0, B) * tmp;
}
def code(F, B, x): tmp = 0 if F <= -70000000000000.0: tmp = ((-0.16666666666666666 * math.pow(math.fabs(B), 2.0)) - 1.0) / math.fabs(B) elif F <= 2.1e+80: tmp = -(x / math.fabs(B)) + ((F * math.pow((2.0 + (2.0 * x)), -0.5)) / math.fabs(B)) else: tmp = math.fabs((-1.0 / math.fabs(B))) return math.copysign(1.0, B) * tmp
function code(F, B, x) tmp = 0.0 if (F <= -70000000000000.0) tmp = Float64(Float64(Float64(-0.16666666666666666 * (abs(B) ^ 2.0)) - 1.0) / abs(B)); elseif (F <= 2.1e+80) tmp = Float64(Float64(-Float64(x / abs(B))) + Float64(Float64(F * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5)) / abs(B))); else tmp = abs(Float64(-1.0 / abs(B))); end return Float64(copysign(1.0, B) * tmp) end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -70000000000000.0) tmp = ((-0.16666666666666666 * (abs(B) ^ 2.0)) - 1.0) / abs(B); elseif (F <= 2.1e+80) tmp = -(x / abs(B)) + ((F * ((2.0 + (2.0 * x)) ^ -0.5)) / abs(B)); else tmp = abs((-1.0 / abs(B))); end tmp_2 = (sign(B) * abs(1.0)) * tmp; end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[F, -70000000000000.0], N[(N[(N[(-0.16666666666666666 * N[Power[N[Abs[B], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e+80], N[((-N[(x / N[Abs[B], $MachinePrecision]), $MachinePrecision]) + N[(N[(F * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-1.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;F \leq -70000000000000:\\
\;\;\;\;\frac{-0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2} - 1}{\left|B\right|}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{+80}:\\
\;\;\;\;\left(-\frac{x}{\left|B\right|}\right) + \frac{F \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{\left|B\right|}\right|\\
\end{array}
if F < -7e13Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6410.4%
Applied rewrites10.4%
if -7e13 < F < 2.10000000000000001e80Initial program 77.0%
Taylor expanded in B around 0
lower-/.f6449.1%
Applied rewrites49.1%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6435.6%
Applied rewrites35.6%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval29.1%
Applied rewrites29.1%
if 2.10000000000000001e80 < F Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.7%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f64N/A
lower-neg.f644.8%
Applied rewrites4.8%
lift-exp.f64N/A
exp-fabsN/A
lift-exp.f64N/A
lower-fabs.f644.8%
lift-exp.f64N/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
unpow-1N/A
metadata-evalN/A
lift-neg.f64N/A
frac-2neg-revN/A
lower-/.f649.8%
Applied rewrites9.8%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= F 2.6e-35)
(/ -1.0 (* (fabs B) (+ 1.0 (* -0.16666666666666666 (pow (fabs B) 2.0)))))
(fabs (/ -1.0 (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (F <= 2.6e-35) {
tmp = -1.0 / (fabs(B) * (1.0 + (-0.16666666666666666 * pow(fabs(B), 2.0))));
} else {
tmp = fabs((-1.0 / fabs(B)));
}
return copysign(1.0, B) * tmp;
}
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.6e-35) {
tmp = -1.0 / (Math.abs(B) * (1.0 + (-0.16666666666666666 * Math.pow(Math.abs(B), 2.0))));
} else {
tmp = Math.abs((-1.0 / Math.abs(B)));
}
return Math.copySign(1.0, B) * tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.6e-35: tmp = -1.0 / (math.fabs(B) * (1.0 + (-0.16666666666666666 * math.pow(math.fabs(B), 2.0)))) else: tmp = math.fabs((-1.0 / math.fabs(B))) return math.copysign(1.0, B) * tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.6e-35) tmp = Float64(-1.0 / Float64(abs(B) * Float64(1.0 + Float64(-0.16666666666666666 * (abs(B) ^ 2.0))))); else tmp = abs(Float64(-1.0 / abs(B))); end return Float64(copysign(1.0, B) * tmp) end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2.6e-35) tmp = -1.0 / (abs(B) * (1.0 + (-0.16666666666666666 * (abs(B) ^ 2.0)))); else tmp = abs((-1.0 / abs(B))); end tmp_2 = (sign(B) * abs(1.0)) * tmp; end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[F, 2.6e-35], N[(-1.0 / N[(N[Abs[B], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Power[N[Abs[B], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Abs[N[(-1.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;F \leq 2.6 \cdot 10^{-35}:\\
\;\;\;\;\frac{-1}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{\left|B\right|}\right|\\
\end{array}
if F < 2.60000000000000005e-35Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6410.6%
Applied rewrites10.6%
if 2.60000000000000005e-35 < F Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.7%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f64N/A
lower-neg.f644.8%
Applied rewrites4.8%
lift-exp.f64N/A
exp-fabsN/A
lift-exp.f64N/A
lower-fabs.f644.8%
lift-exp.f64N/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
unpow-1N/A
metadata-evalN/A
lift-neg.f64N/A
frac-2neg-revN/A
lower-/.f649.8%
Applied rewrites9.8%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= F 2.6e-35)
(/ (- (* -0.16666666666666666 (pow (fabs B) 2.0)) 1.0) (fabs B))
(fabs (/ -1.0 (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (F <= 2.6e-35) {
tmp = ((-0.16666666666666666 * pow(fabs(B), 2.0)) - 1.0) / fabs(B);
} else {
tmp = fabs((-1.0 / fabs(B)));
}
return copysign(1.0, B) * tmp;
}
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.6e-35) {
tmp = ((-0.16666666666666666 * Math.pow(Math.abs(B), 2.0)) - 1.0) / Math.abs(B);
} else {
tmp = Math.abs((-1.0 / Math.abs(B)));
}
return Math.copySign(1.0, B) * tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.6e-35: tmp = ((-0.16666666666666666 * math.pow(math.fabs(B), 2.0)) - 1.0) / math.fabs(B) else: tmp = math.fabs((-1.0 / math.fabs(B))) return math.copysign(1.0, B) * tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.6e-35) tmp = Float64(Float64(Float64(-0.16666666666666666 * (abs(B) ^ 2.0)) - 1.0) / abs(B)); else tmp = abs(Float64(-1.0 / abs(B))); end return Float64(copysign(1.0, B) * tmp) end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 2.6e-35) tmp = ((-0.16666666666666666 * (abs(B) ^ 2.0)) - 1.0) / abs(B); else tmp = abs((-1.0 / abs(B))); end tmp_2 = (sign(B) * abs(1.0)) * tmp; end
code[F_, B_, x_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[F, 2.6e-35], N[(N[(N[(-0.16666666666666666 * N[Power[N[Abs[B], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[Abs[N[(-1.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;F \leq 2.6 \cdot 10^{-35}:\\
\;\;\;\;\frac{-0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2} - 1}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1}{\left|B\right|}\right|\\
\end{array}
if F < 2.60000000000000005e-35Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-pow.f6410.4%
Applied rewrites10.4%
if 2.60000000000000005e-35 < F Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.7%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f64N/A
lower-neg.f644.8%
Applied rewrites4.8%
lift-exp.f64N/A
exp-fabsN/A
lift-exp.f64N/A
lower-fabs.f644.8%
lift-exp.f64N/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
unpow-1N/A
metadata-evalN/A
lift-neg.f64N/A
frac-2neg-revN/A
lower-/.f649.8%
Applied rewrites9.8%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ -1.0 (fabs B)))) (* (copysign 1.0 B) (if (<= F 1.08e-13) t_0 (fabs t_0)))))
double code(double F, double B, double x) {
double t_0 = -1.0 / fabs(B);
double tmp;
if (F <= 1.08e-13) {
tmp = t_0;
} else {
tmp = fabs(t_0);
}
return copysign(1.0, B) * tmp;
}
public static double code(double F, double B, double x) {
double t_0 = -1.0 / Math.abs(B);
double tmp;
if (F <= 1.08e-13) {
tmp = t_0;
} else {
tmp = Math.abs(t_0);
}
return Math.copySign(1.0, B) * tmp;
}
def code(F, B, x): t_0 = -1.0 / math.fabs(B) tmp = 0 if F <= 1.08e-13: tmp = t_0 else: tmp = math.fabs(t_0) return math.copysign(1.0, B) * tmp
function code(F, B, x) t_0 = Float64(-1.0 / abs(B)) tmp = 0.0 if (F <= 1.08e-13) tmp = t_0; else tmp = abs(t_0); end return Float64(copysign(1.0, B) * tmp) end
function tmp_2 = code(F, B, x) t_0 = -1.0 / abs(B); tmp = 0.0; if (F <= 1.08e-13) tmp = t_0; else tmp = abs(t_0); end tmp_2 = (sign(B) * abs(1.0)) * tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Abs[B], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[F, 1.08e-13], t$95$0, N[Abs[t$95$0], $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{-1}{\left|B\right|}\\
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;F \leq 1.08 \cdot 10^{-13}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\left|t\_0\right|\\
\end{array}
\end{array}
if F < 1.0799999999999999e-13Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.7%
if 1.0799999999999999e-13 < F Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.7%
lift-/.f64N/A
frac-2negN/A
metadata-evalN/A
inv-powN/A
pow-to-expN/A
lower-unsound-exp.f64N/A
lower-unsound-*.f64N/A
lower-unsound-log.f64N/A
lower-neg.f644.8%
Applied rewrites4.8%
lift-exp.f64N/A
exp-fabsN/A
lift-exp.f64N/A
lower-fabs.f644.8%
lift-exp.f64N/A
lift-*.f64N/A
lift-log.f64N/A
exp-to-powN/A
unpow-1N/A
metadata-evalN/A
lift-neg.f64N/A
frac-2neg-revN/A
lower-/.f649.8%
Applied rewrites9.8%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\frac{-1}{B}
Initial program 77.0%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.8%
Applied rewrites17.8%
Taylor expanded in B around 0
Applied rewrites10.7%
herbie shell --seed 2025187
(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))))))