
(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 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]
\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 (* F (sin B))) (t_1 (/ 1.0 (sin B))) (t_2 (/ (- x) (tan B))))
(if (<= F -1.1e+70)
(fma t_1 -1.0 t_2)
(if (<= F 2e+117)
(fma t_1 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) t_2)
(* F (fma -1.0 (/ (* x (cos B)) t_0) (/ 1.0 t_0)))))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = 1.0 / sin(B);
double t_2 = -x / tan(B);
double tmp;
if (F <= -1.1e+70) {
tmp = fma(t_1, -1.0, t_2);
} else if (F <= 2e+117) {
tmp = fma(t_1, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F), t_2);
} else {
tmp = F * fma(-1.0, ((x * cos(B)) / t_0), (1.0 / t_0));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(1.0 / sin(B)) t_2 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.1e+70) tmp = fma(t_1, -1.0, t_2); elseif (F <= 2e+117) tmp = fma(t_1, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F), t_2); else tmp = Float64(F * fma(-1.0, Float64(Float64(x * cos(B)) / t_0), Float64(1.0 / t_0))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.1e+70], N[(t$95$1 * -1.0 + t$95$2), $MachinePrecision], If[LessEqual[F, 2e+117], N[(t$95$1 * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$2), $MachinePrecision], N[(F * N[(-1.0 * N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] + N[(1.0 / t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := \frac{1}{\sin B}\\
t_2 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.1 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, -1, t\_2\right)\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x \cdot \cos B}{t\_0}, \frac{1}{t\_0}\right)\\
\end{array}
if F < -1.1e70Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -1.1e70 < F < 2.0000000000000001e117Initial program 77.5%
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.7%
if 2.0000000000000001e117 < F Initial program 77.5%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-*.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6447.9%
Applied rewrites47.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -1.1e+70)
(fma t_0 -1.0 t_1)
(if (<= F 1.5e+236)
(fma t_0 (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) t_1)
t_0))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -1.1e+70) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 1.5e+236) {
tmp = fma(t_0, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F), t_1);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -1.1e+70) tmp = fma(t_0, -1.0, t_1); elseif (F <= 1.5e+236) tmp = fma(t_0, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F), t_1); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.1e+70], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.5e+236], N[(t$95$0 * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -1.1 \cdot 10^{+70}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+236}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -1.1e70Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -1.1e70 < F < 1.4999999999999999e236Initial program 77.5%
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.7%
if 1.4999999999999999e236 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -2.2e+20)
(fma t_0 -1.0 t_1)
(if (<= F 1.5e+236)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_1)
t_0))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -2.2e+20) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 1.5e+236) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_1);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2.2e+20) tmp = fma(t_0, -1.0, t_1); elseif (F <= 1.5e+236) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_1); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.2e+20], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 1.5e+236], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+236}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -2.2e20Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -2.2e20 < F < 1.4999999999999999e236Initial program 77.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.7%
if 1.4999999999999999e236 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -3.2e+101)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F 2.9e+149)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(if (<= F 1.5e+236) (* (/ (- x) (sin B)) (cos B)) t_0)))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -3.2e+101) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= 2.9e+149) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
} else if (F <= 1.5e+236) {
tmp = (-x / sin(B)) * cos(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -3.2e+101) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= 2.9e+149) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); elseif (F <= 1.5e+236) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.2e+101], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.9e+149], 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], If[LessEqual[F, 1.5e+236], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -3.2 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{+149}:\\
\;\;\;\;{\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{elif}\;F \leq 1.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -3.20000000000000005e101Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -3.20000000000000005e101 < F < 2.9000000000000002e149Initial program 77.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.5%
Applied rewrites77.7%
if 2.9000000000000002e149 < F < 1.4999999999999999e236Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if 1.4999999999999999e236 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -2.05e-22)
(fma t_0 -1.0 t_1)
(if (<= F 3e-10)
(fma F (/ (pow (fma x 2.0 2.0) -0.5) (sin B)) t_1)
(if (<= F 1.8e+112)
(*
(/ 1.0 (/ 1.0 (fma (pow (fma x 2.0 (fma F F 2.0)) -0.5) F (- x))))
t_0)
(if (<= F 1.5e+236) (* (/ (- x) (sin B)) (cos B)) t_0))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -2.05e-22) {
tmp = fma(t_0, -1.0, t_1);
} else if (F <= 3e-10) {
tmp = fma(F, (pow(fma(x, 2.0, 2.0), -0.5) / sin(B)), t_1);
} else if (F <= 1.8e+112) {
tmp = (1.0 / (1.0 / fma(pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), F, -x))) * t_0;
} else if (F <= 1.5e+236) {
tmp = (-x / sin(B)) * cos(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2.05e-22) tmp = fma(t_0, -1.0, t_1); elseif (F <= 3e-10) tmp = fma(F, Float64((fma(x, 2.0, 2.0) ^ -0.5) / sin(B)), t_1); elseif (F <= 1.8e+112) tmp = Float64(Float64(1.0 / Float64(1.0 / fma((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), F, Float64(-x)))) * t_0); elseif (F <= 1.5e+236) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.05e-22], N[(t$95$0 * -1.0 + t$95$1), $MachinePrecision], If[LessEqual[F, 3e-10], N[(F * N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 1.8e+112], N[(N[(1.0 / N[(1.0 / N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[F, 1.5e+236], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2.05 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, t\_1\right)\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}}{\sin B}, t\_1\right)\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+112}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -x\right)}} \cdot t\_0\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -2.05e-22Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -2.05e-22 < F < 3e-10Initial program 77.5%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval55.5%
Applied rewrites55.5%
Applied rewrites56.9%
if 3e-10 < F < 1.8e112Initial program 77.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
mult-flipN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites60.0%
if 1.8e112 < F < 1.4999999999999999e236Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if 1.4999999999999999e236 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -2.05e-22)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F 3e-10)
(/ (- (* (pow (fma x 2.0 2.0) -0.5) F) (* (cos B) x)) (sin B))
(if (<= F 1.8e+112)
(*
(/ 1.0 (/ 1.0 (fma (pow (fma x 2.0 (fma F F 2.0)) -0.5) F (- x))))
t_0)
(if (<= F 1.5e+236) (* (/ (- x) (sin B)) (cos B)) t_0))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -2.05e-22) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= 3e-10) {
tmp = ((pow(fma(x, 2.0, 2.0), -0.5) * F) - (cos(B) * x)) / sin(B);
} else if (F <= 1.8e+112) {
tmp = (1.0 / (1.0 / fma(pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), F, -x))) * t_0;
} else if (F <= 1.5e+236) {
tmp = (-x / sin(B)) * cos(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -2.05e-22) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= 3e-10) tmp = Float64(Float64(Float64((fma(x, 2.0, 2.0) ^ -0.5) * F) - Float64(cos(B) * x)) / sin(B)); elseif (F <= 1.8e+112) tmp = Float64(Float64(1.0 / Float64(1.0 / fma((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), F, Float64(-x)))) * t_0); elseif (F <= 1.5e+236) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.05e-22], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3e-10], N[(N[(N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+112], N[(N[(1.0 / N[(1.0 / N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[F, 1.5e+236], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -2.05 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-10}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5} \cdot F - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+112}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -x\right)}} \cdot t\_0\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -2.05e-22Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -2.05e-22 < F < 3e-10Initial program 77.5%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval55.5%
Applied rewrites55.5%
Applied rewrites56.5%
if 3e-10 < F < 1.8e112Initial program 77.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
mult-flipN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites60.0%
if 1.8e112 < F < 1.4999999999999999e236Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if 1.4999999999999999e236 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -7.2e+19)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F -3.4e-100)
(+
(- (/ x B))
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F 1.3e-192)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) (pow (+ 2.0 (* 2.0 x)) -0.5)))
(if (<= F 1.8e+112)
(/
1.0
(/
(sin B)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (* -1.0 x))))
(if (<= F 1.5e+236) (* (/ (- x) (sin B)) (cos B)) t_0)))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -7.2e+19) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= -3.4e-100) {
tmp = -(x / B) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
} else if (F <= 1.3e-192) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * pow((2.0 + (2.0 * x)), -0.5));
} else if (F <= 1.8e+112) {
tmp = 1.0 / (sin(B) / fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, (-1.0 * x)));
} else if (F <= 1.5e+236) {
tmp = (-x / sin(B)) * cos(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -7.2e+19) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= -3.4e-100) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))); elseif (F <= 1.3e-192) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * (Float64(2.0 + Float64(2.0 * x)) ^ -0.5))); elseif (F <= 1.8e+112) tmp = Float64(1.0 / Float64(sin(B) / fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-1.0 * x)))); elseif (F <= 1.5e+236) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.2e+19], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.4e-100], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e-192], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * N[Power[N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+112], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+236], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq -3.4 \cdot 10^{-100}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-192}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot {\left(2 + 2 \cdot x\right)}^{-0.5}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+112}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -1 \cdot x\right)}}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -7.2e19Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -7.2e19 < F < -3.39999999999999976e-100Initial program 77.5%
Taylor expanded in B around 0
lower-/.f6449.9%
Applied rewrites49.9%
if -3.39999999999999976e-100 < F < 1.3000000000000001e-192Initial program 77.5%
Taylor expanded in F around 0
metadata-evalN/A
metadata-evalN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-*.f64N/A
metadata-evalN/A
metadata-eval55.5%
Applied rewrites55.5%
Taylor expanded in B around 0
Applied rewrites50.2%
if 1.3000000000000001e-192 < F < 1.8e112Initial program 77.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if 1.8e112 < F < 1.4999999999999999e236Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if 1.4999999999999999e236 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B)))
(t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0)))))
(if (<= F -7.2e+19)
(fma t_0 -1.0 (/ (- x) (tan B)))
(if (<= F -3.4e-100)
(+ (- (/ x B)) (* (/ F (sin B)) t_1))
(if (<= F 1.3e-192)
(+ (- (* x (/ 1.0 (tan B)))) (* (/ F B) t_1))
(if (<= F 1.8e+112)
(/
1.0
(/
(sin B)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (* -1.0 x))))
(if (<= F 1.5e+236) (* (/ (- x) (sin B)) (cos B)) t_0)))))))double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0));
double tmp;
if (F <= -7.2e+19) {
tmp = fma(t_0, -1.0, (-x / tan(B)));
} else if (F <= -3.4e-100) {
tmp = -(x / B) + ((F / sin(B)) * t_1);
} else if (F <= 1.3e-192) {
tmp = -(x * (1.0 / tan(B))) + ((F / B) * t_1);
} else if (F <= 1.8e+112) {
tmp = 1.0 / (sin(B) / fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, (-1.0 * x)));
} else if (F <= 1.5e+236) {
tmp = (-x / sin(B)) * cos(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0)) tmp = 0.0 if (F <= -7.2e+19) tmp = fma(t_0, -1.0, Float64(Float64(-x) / tan(B))); elseif (F <= -3.4e-100) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * t_1)); elseif (F <= 1.3e-192) tmp = Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / B) * t_1)); elseif (F <= 1.8e+112) tmp = Float64(1.0 / Float64(sin(B) / fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-1.0 * x)))); elseif (F <= 1.5e+236) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]}, If[LessEqual[F, -7.2e+19], N[(t$95$0 * -1.0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.4e-100], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e-192], N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / B), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e+112], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+236], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{+19}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, -1, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq -3.4 \cdot 10^{-100}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot t\_1\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-192}:\\
\;\;\;\;\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{B} \cdot t\_1\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+112}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -1 \cdot x\right)}}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+236}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if F < -7.2e19Initial program 77.5%
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.7%
Taylor expanded in F around -inf
Applied rewrites56.7%
if -7.2e19 < F < -3.39999999999999976e-100Initial program 77.5%
Taylor expanded in B around 0
lower-/.f6449.9%
Applied rewrites49.9%
if -3.39999999999999976e-100 < F < 1.3000000000000001e-192Initial program 77.5%
Taylor expanded in B around 0
lower-/.f6463.4%
Applied rewrites63.4%
if 1.3000000000000001e-192 < F < 1.8e112Initial program 77.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if 1.8e112 < F < 1.4999999999999999e236Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if 1.4999999999999999e236 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x)
:precision binary64
(if (<= x -1.7e-61)
(* (/ (- x) (sin B)) (cos B))
(if (<= x 5e-78)
(*
(/ 1.0 (/ 1.0 (fma (pow (fma x 2.0 (fma F F 2.0)) -0.5) F (- x))))
(/ 1.0 (sin B)))
(/ (- x) (tan B)))))double code(double F, double B, double x) {
double tmp;
if (x <= -1.7e-61) {
tmp = (-x / sin(B)) * cos(B);
} else if (x <= 5e-78) {
tmp = (1.0 / (1.0 / fma(pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), F, -x))) * (1.0 / sin(B));
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.7e-61) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); elseif (x <= 5e-78) tmp = Float64(Float64(1.0 / Float64(1.0 / fma((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), F, Float64(-x)))) * Float64(1.0 / sin(B))); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.7e-61], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-78], N[(N[(1.0 / N[(1.0 / N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-78}:\\
\;\;\;\;\frac{1}{\frac{1}{\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -x\right)}} \cdot \frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
if x < -1.6999999999999999e-61Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if -1.6999999999999999e-61 < x < 4.9999999999999996e-78Initial program 77.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
lift-/.f64N/A
lift-/.f64N/A
metadata-evalN/A
mult-flipN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
Applied rewrites60.0%
if 4.9999999999999996e-78 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
(FPCore (F B x)
:precision binary64
(if (<= x -1.7e-61)
(* (/ (- x) (sin B)) (cos B))
(if (<= x 5e-78)
(/
1.0
(/ (sin B) (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (* -1.0 x))))
(/ (- x) (tan B)))))double code(double F, double B, double x) {
double tmp;
if (x <= -1.7e-61) {
tmp = (-x / sin(B)) * cos(B);
} else if (x <= 5e-78) {
tmp = 1.0 / (sin(B) / fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, (-1.0 * x)));
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.7e-61) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); elseif (x <= 5e-78) tmp = Float64(1.0 / Float64(sin(B) / fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-1.0 * x)))); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.7e-61], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-78], N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-78}:\\
\;\;\;\;\frac{1}{\frac{\sin B}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -1 \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
if x < -1.6999999999999999e-61Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if -1.6999999999999999e-61 < x < 4.9999999999999996e-78Initial program 77.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
if 4.9999999999999996e-78 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
(FPCore (F B x)
:precision binary64
(if (<= x -1.7e-61)
(* (/ (- x) (sin B)) (cos B))
(if (<= x 5e-78)
(* (/ 1.0 (sin B)) (* (pow (fma F F 2.0) -0.5) F))
(/ (- x) (tan B)))))double code(double F, double B, double x) {
double tmp;
if (x <= -1.7e-61) {
tmp = (-x / sin(B)) * cos(B);
} else if (x <= 5e-78) {
tmp = (1.0 / sin(B)) * (pow(fma(F, F, 2.0), -0.5) * F);
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -1.7e-61) tmp = Float64(Float64(Float64(-x) / sin(B)) * cos(B)); elseif (x <= 5e-78) tmp = Float64(Float64(1.0 / sin(B)) * Float64((fma(F, F, 2.0) ^ -0.5) * F)); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -1.7e-61], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e-78], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{\sin B} \cdot \cos B\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-78}:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot F\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
if x < -1.6999999999999999e-61Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
lift-tan.f64N/A
lift-/.f64N/A
tan-quotN/A
lift-sin.f64N/A
lift-cos.f64N/A
associate-/r/N/A
lower-*.f64N/A
lower-/.f6457.0%
Applied rewrites57.0%
if -1.6999999999999999e-61 < x < 4.9999999999999996e-78Initial program 77.5%
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.7%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6430.3%
Applied rewrites30.3%
lift-/.f64N/A
mult-flipN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f6430.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6430.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
lift-fma.f6430.3%
Applied rewrites30.3%
if 4.9999999999999996e-78 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -1.7e-61)
t_0
(if (<= x 5e-78)
(* (/ 1.0 (sin B)) (* (pow (fma F F 2.0) -0.5) F))
t_0))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -1.7e-61) {
tmp = t_0;
} else if (x <= 5e-78) {
tmp = (1.0 / sin(B)) * (pow(fma(F, F, 2.0), -0.5) * F);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (x <= -1.7e-61) tmp = t_0; elseif (x <= 5e-78) tmp = Float64(Float64(1.0 / sin(B)) * Float64((fma(F, F, 2.0) ^ -0.5) * F)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e-61], t$95$0, If[LessEqual[x, 5e-78], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-61}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-78}:\\
\;\;\;\;\frac{1}{\sin B} \cdot \left({\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5} \cdot F\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1.6999999999999999e-61 or 4.9999999999999996e-78 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
if -1.6999999999999999e-61 < x < 4.9999999999999996e-78Initial program 77.5%
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.7%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6430.3%
Applied rewrites30.3%
lift-/.f64N/A
mult-flipN/A
lift-sin.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-sin.f64N/A
lower-/.f6430.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6430.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
lift-fma.f6430.3%
Applied rewrites30.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -1.7e-61)
t_0
(if (<= x 5e-78) (* (/ (pow (fma F F 2.0) -0.5) (sin B)) F) t_0))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -1.7e-61) {
tmp = t_0;
} else if (x <= 5e-78) {
tmp = (pow(fma(F, F, 2.0), -0.5) / sin(B)) * F;
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (x <= -1.7e-61) tmp = t_0; elseif (x <= 5e-78) tmp = Float64(Float64((fma(F, F, 2.0) ^ -0.5) / sin(B)) * F); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e-61], t$95$0, If[LessEqual[x, 5e-78], N[(N[(N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-61}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-78}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{\sin B} \cdot F\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1.6999999999999999e-61 or 4.9999999999999996e-78 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
if -1.6999999999999999e-61 < x < 4.9999999999999996e-78Initial program 77.5%
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.7%
Taylor expanded in x around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
lower-pow.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-sin.f6430.3%
Applied rewrites30.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6430.3%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
pow2N/A
lift-fma.f6430.3%
Applied rewrites30.3%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.4e-11)
(/ (- (* F (pow (+ 2.0 (fma 2.0 x (pow F 2.0))) -0.5)) x) (fabs B))
(/ (- x) (tan (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 1.4e-11) {
tmp = ((F * pow((2.0 + fma(2.0, x, pow(F, 2.0))), -0.5)) - x) / fabs(B);
} else {
tmp = -x / tan(fabs(B));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 1.4e-11) tmp = Float64(Float64(Float64(F * (Float64(2.0 + fma(2.0, x, (F ^ 2.0))) ^ -0.5)) - x) / abs(B)); else tmp = Float64(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.4e-11], 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[((-x) / N[Tan[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^{-11}:\\
\;\;\;\;\frac{F \cdot {\left(2 + \mathsf{fma}\left(2, x, {F}^{2}\right)\right)}^{-0.5} - x}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan \left(\left|B\right|\right)}\\
\end{array}
if B < 1.4e-11Initial program 77.5%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.7%
if 1.4e-11 < B Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.4e-11)
(/
1.0
(/ (fabs B) (fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) F (* -1.0 x))))
(/ (- x) (tan (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 1.4e-11) {
tmp = 1.0 / (fabs(B) / fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), F, (-1.0 * x)));
} else {
tmp = -x / tan(fabs(B));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 1.4e-11) tmp = Float64(1.0 / Float64(abs(B) / fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), F, Float64(-1.0 * x)))); else tmp = Float64(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.4e-11], N[(1.0 / N[(N[Abs[B], $MachinePrecision] / N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F + N[(-1.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[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^{-11}:\\
\;\;\;\;\frac{1}{\frac{\left|B\right|}{\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, F, -1 \cdot x\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan \left(\left|B\right|\right)}\\
\end{array}
if B < 1.4e-11Initial program 77.5%
lift-+.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
add-to-fractionN/A
div-flipN/A
lower-unsound-/.f64N/A
lower-unsound-/.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f6460.0%
Applied rewrites60.0%
Taylor expanded in B around 0
Applied rewrites44.6%
if 1.4e-11 < B Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -1e-245)
t_0
(if (<= x 5.2e-227)
(/ 1.0 (sin B))
(if (<= x 6.8e-78) (/ -1.0 (sin B)) t_0)))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -1e-245) {
tmp = t_0;
} else if (x <= 5.2e-227) {
tmp = 1.0 / sin(B);
} else if (x <= 6.8e-78) {
tmp = -1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -x / tan(b)
if (x <= (-1d-245)) then
tmp = t_0
else if (x <= 5.2d-227) then
tmp = 1.0d0 / sin(b)
else if (x <= 6.8d-78) then
tmp = (-1.0d0) / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / Math.tan(B);
double tmp;
if (x <= -1e-245) {
tmp = t_0;
} else if (x <= 5.2e-227) {
tmp = 1.0 / Math.sin(B);
} else if (x <= 6.8e-78) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if x <= -1e-245: tmp = t_0 elif x <= 5.2e-227: tmp = 1.0 / math.sin(B) elif x <= 6.8e-78: tmp = -1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (x <= -1e-245) tmp = t_0; elseif (x <= 5.2e-227) tmp = Float64(1.0 / sin(B)); elseif (x <= 6.8e-78) tmp = Float64(-1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (x <= -1e-245) tmp = t_0; elseif (x <= 5.2e-227) tmp = 1.0 / sin(B); elseif (x <= 6.8e-78) tmp = -1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e-245], t$95$0, If[LessEqual[x, 5.2e-227], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.8e-78], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-245}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-227}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -9.9999999999999993e-246 or 6.80000000000000023e-78 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Applied rewrites57.0%
if -9.9999999999999993e-246 < x < 5.20000000000000023e-227Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
if 5.20000000000000023e-227 < x < 6.80000000000000023e-78Initial program 77.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.1%
Applied rewrites17.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.75e+22) (/ -1.0 (sin B)) (if (<= F 3.1e-43) (* -1.0 (/ x (sin B))) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.75e+22) {
tmp = -1.0 / sin(B);
} else if (F <= 3.1e-43) {
tmp = -1.0 * (x / sin(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 <= (-1.75d+22)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 3.1d-43) then
tmp = (-1.0d0) * (x / sin(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 <= -1.75e+22) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 3.1e-43) {
tmp = -1.0 * (x / Math.sin(B));
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.75e+22: tmp = -1.0 / math.sin(B) elif F <= 3.1e-43: tmp = -1.0 * (x / math.sin(B)) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.75e+22) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3.1e-43) tmp = Float64(-1.0 * Float64(x / sin(B))); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.75e+22) tmp = -1.0 / sin(B); elseif (F <= 3.1e-43) tmp = -1.0 * (x / sin(B)); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.75e+22], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-43], N[(-1.0 * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.75 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-43}:\\
\;\;\;\;-1 \cdot \frac{x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -1.75e22Initial program 77.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.1%
Applied rewrites17.1%
if -1.75e22 < F < 3.0999999999999999e-43Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Taylor expanded in B around 0
Applied rewrites32.3%
if 3.0999999999999999e-43 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.75e+22) (/ -1.0 (sin B)) (if (<= F 3.1e-43) (- (/ x B)) (/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.75e+22) {
tmp = -1.0 / sin(B);
} else if (F <= 3.1e-43) {
tmp = -(x / B);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.75d+22)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 3.1d-43) then
tmp = -(x / b)
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.75e+22) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 3.1e-43) {
tmp = -(x / B);
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.75e+22: tmp = -1.0 / math.sin(B) elif F <= 3.1e-43: tmp = -(x / B) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.75e+22) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3.1e-43) tmp = Float64(-Float64(x / B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.75e+22) tmp = -1.0 / sin(B); elseif (F <= 3.1e-43) tmp = -(x / B); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.75e+22], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-43], (-N[(x / B), $MachinePrecision]), N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -1.75 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-43}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
if F < -1.75e22Initial program 77.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.1%
Applied rewrites17.1%
if -1.75e22 < F < 3.0999999999999999e-43Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Taylor expanded in B around 0
lower-/.f6430.0%
Applied rewrites30.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6430.0%
Applied rewrites30.0%
if 3.0999999999999999e-43 < F Initial program 77.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6416.3%
Applied rewrites16.3%
(FPCore (F B x) :precision binary64 (let* ((t_0 (- (/ x B)))) (if (<= x -3.9e-81) t_0 (if (<= x 3.8e-15) (/ -1.0 (sin B)) t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -3.9e-81) {
tmp = t_0;
} else if (x <= 3.8e-15) {
tmp = -1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -(x / b)
if (x <= (-3.9d-81)) then
tmp = t_0
else if (x <= 3.8d-15) then
tmp = (-1.0d0) / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -3.9e-81) {
tmp = t_0;
} else if (x <= 3.8e-15) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -(x / B) tmp = 0 if x <= -3.9e-81: tmp = t_0 elif x <= 3.8e-15: tmp = -1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (x <= -3.9e-81) tmp = t_0; elseif (x <= 3.8e-15) tmp = Float64(-1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x / B); tmp = 0.0; if (x <= -3.9e-81) tmp = t_0; elseif (x <= 3.8e-15) tmp = -1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[x, -3.9e-81], t$95$0, If[LessEqual[x, 3.8e-15], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;x \leq -3.9 \cdot 10^{-81}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -3.89999999999999985e-81 or 3.8000000000000002e-15 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Taylor expanded in B around 0
lower-/.f6430.0%
Applied rewrites30.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6430.0%
Applied rewrites30.0%
if -3.89999999999999985e-81 < x < 3.8000000000000002e-15Initial program 77.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.1%
Applied rewrites17.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x B))))
(if (<= x -1.1e-142)
t_0
(if (<= x 1.4e-75)
(/ -1.0 (* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
t_0))))double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -1.1e-142) {
tmp = t_0;
} else if (x <= 1.4e-75) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))));
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -(x / b)
if (x <= (-1.1d-142)) then
tmp = t_0
else if (x <= 1.4d-75) then
tmp = (-1.0d0) / (b * (1.0d0 + ((-0.16666666666666666d0) * (b ** 2.0d0))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -1.1e-142) {
tmp = t_0;
} else if (x <= 1.4e-75) {
tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * Math.pow(B, 2.0))));
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -(x / B) tmp = 0 if x <= -1.1e-142: tmp = t_0 elif x <= 1.4e-75: tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * math.pow(B, 2.0)))) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (x <= -1.1e-142) tmp = t_0; elseif (x <= 1.4e-75) tmp = Float64(-1.0 / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x / B); tmp = 0.0; if (x <= -1.1e-142) tmp = t_0; elseif (x <= 1.4e-75) tmp = -1.0 / (B * (1.0 + (-0.16666666666666666 * (B ^ 2.0)))); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[x, -1.1e-142], t$95$0, If[LessEqual[x, 1.4e-75], N[(-1.0 / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;x \leq -1.1 \cdot 10^{-142}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-75}:\\
\;\;\;\;\frac{-1}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -1.10000000000000008e-142 or 1.39999999999999999e-75 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Taylor expanded in B around 0
lower-/.f6430.0%
Applied rewrites30.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6430.0%
Applied rewrites30.0%
if -1.10000000000000008e-142 < x < 1.39999999999999999e-75Initial program 77.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.1%
Applied rewrites17.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6410.6%
Applied rewrites10.6%
(FPCore (F B x) :precision binary64 (let* ((t_0 (- (/ x B)))) (if (<= x -3.6e-81) t_0 (if (<= x 6.8e-78) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -3.6e-81) {
tmp = t_0;
} else if (x <= 6.8e-78) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -(x / b)
if (x <= (-3.6d-81)) then
tmp = t_0
else if (x <= 6.8d-78) then
tmp = (-1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -3.6e-81) {
tmp = t_0;
} else if (x <= 6.8e-78) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -(x / B) tmp = 0 if x <= -3.6e-81: tmp = t_0 elif x <= 6.8e-78: tmp = -1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (x <= -3.6e-81) tmp = t_0; elseif (x <= 6.8e-78) tmp = Float64(-1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x / B); tmp = 0.0; if (x <= -3.6e-81) tmp = t_0; elseif (x <= 6.8e-78) tmp = -1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[x, -3.6e-81], t$95$0, If[LessEqual[x, 6.8e-78], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-81}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -3.5999999999999999e-81 or 6.80000000000000023e-78 < x Initial program 77.5%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.0%
Applied rewrites57.0%
Taylor expanded in B around 0
lower-/.f6430.0%
Applied rewrites30.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6430.0%
Applied rewrites30.0%
if -3.5999999999999999e-81 < x < 6.80000000000000023e-78Initial program 77.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.1%
Applied rewrites17.1%
Taylor expanded in B around 0
Applied rewrites10.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]
\frac{-1}{B}
Initial program 77.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.1%
Applied rewrites17.1%
Taylor expanded in B around 0
Applied rewrites10.7%
herbie shell --seed 2025181
(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))))))