
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\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 (/ (- x) (tan B))))
(if (<= F -245000.0)
(fma
F
(/ (- (* 0.5 (/ (+ 2.0 (* 2.0 x)) (pow F 3.0))) (/ 1.0 F)) (sin B))
t_0)
(if (<= F 1.15e+22)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) t_0)
(/ (fma (/ 1.0 F) (/ F (cos B)) (* (- x) 1.0)) (tan B))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -245000.0) {
tmp = fma(F, (((0.5 * ((2.0 + (2.0 * x)) / pow(F, 3.0))) - (1.0 / F)) / sin(B)), t_0);
} else if (F <= 1.15e+22) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), t_0);
} else {
tmp = fma((1.0 / F), (F / cos(B)), (-x * 1.0)) / tan(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -245000.0) tmp = fma(F, Float64(Float64(Float64(0.5 * Float64(Float64(2.0 + Float64(2.0 * x)) / (F ^ 3.0))) - Float64(1.0 / F)) / sin(B)), t_0); elseif (F <= 1.15e+22) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), t_0); else tmp = Float64(fma(Float64(1.0 / F), Float64(F / cos(B)), Float64(Float64(-x) * 1.0)) / tan(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -245000.0], N[(F * N[(N[(N[(0.5 * N[(N[(2.0 + N[(2.0 * x), $MachinePrecision]), $MachinePrecision] / N[Power[F, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(1.0 / F), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e+22], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -245000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{0.5 \cdot \frac{2 + 2 \cdot x}{{F}^{3}} - \frac{1}{F}}{\sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, \frac{F}{\cos B}, \left(-x\right) \cdot 1\right)}{\tan B}\\
\end{array}
if F < -245000Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6441.0
Applied rewrites41.0%
if -245000 < F < 1.1500000000000001e22Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6477.2
Applied rewrites77.4%
if 1.1500000000000001e22 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-/.f64N/A
lower-cos.f6485.6
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -2e+64)
(fma F (/ -1.0 (* F (sin B))) t_0)
(if (<= F 1.15e+22)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B)) t_0)
(/ (fma (/ 1.0 F) (/ F (cos B)) (* (- x) 1.0)) (tan B))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -2e+64) {
tmp = fma(F, (-1.0 / (F * sin(B))), t_0);
} else if (F <= 1.15e+22) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / sin(B)), t_0);
} else {
tmp = fma((1.0 / F), (F / cos(B)), (-x * 1.0)) / tan(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2e+64) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), t_0); elseif (F <= 1.15e+22) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), t_0); else tmp = Float64(fma(Float64(1.0 / F), Float64(F / cos(B)), Float64(Float64(-x) * 1.0)) / tan(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+64], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e+22], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{+22}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, \frac{F}{\cos B}, \left(-x\right) \cdot 1\right)}{\tan B}\\
\end{array}
if F < -2.00000000000000004e64Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -2.00000000000000004e64 < F < 1.1500000000000001e22Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6477.2
Applied rewrites77.4%
if 1.1500000000000001e22 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-/.f64N/A
lower-cos.f6485.6
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -2e+144)
(fma F (/ -1.0 (* F (sin B))) t_0)
(if (<= F 370000.0)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) t_0)
(/ (fma (/ 1.0 F) (/ F (cos B)) (* (- x) 1.0)) (tan B))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -2e+144) {
tmp = fma(F, (-1.0 / (F * sin(B))), t_0);
} else if (F <= 370000.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), t_0);
} else {
tmp = fma((1.0 / F), (F / cos(B)), (-x * 1.0)) / tan(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2e+144) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), t_0); elseif (F <= 370000.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), t_0); else tmp = Float64(fma(Float64(1.0 / F), Float64(F / cos(B)), Float64(Float64(-x) * 1.0)) / tan(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+144], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 370000.0], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 370000:\\
\;\;\;\;\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\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, \frac{F}{\cos B}, \left(-x\right) \cdot 1\right)}{\tan B}\\
\end{array}
if F < -2.00000000000000005e144Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -2.00000000000000005e144 < F < 3.7e5Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
if 3.7e5 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-/.f64N/A
lower-cos.f6485.6
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+64)
(fma F (/ -1.0 (* F (sin B))) (/ (- x) (tan B)))
(if (<= F 1.15e+22)
(- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (sin B))) (/ x (tan B)))
(/ (fma (/ 1.0 F) (/ F (cos B)) (* (- x) 1.0)) (tan B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -2e+64) {
tmp = fma(F, (-1.0 / (F * sin(B))), (-x / tan(B)));
} else if (F <= 1.15e+22) {
tmp = (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * (F / sin(B))) - (x / tan(B));
} else {
tmp = fma((1.0 / F), (F / cos(B)), (-x * 1.0)) / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+64) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), Float64(Float64(-x) / tan(B))); elseif (F <= 1.15e+22) tmp = Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / tan(B))); else tmp = Float64(fma(Float64(1.0 / F), Float64(F / cos(B)), Float64(Float64(-x) * 1.0)) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+64], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e+22], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{+22}:\\
\;\;\;\;{\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}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, \frac{F}{\cos B}, \left(-x\right) \cdot 1\right)}{\tan B}\\
\end{array}
if F < -2.00000000000000004e64Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -2.00000000000000004e64 < F < 1.1500000000000001e22Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
sub-flip-reverseN/A
lower--.f6477.2
Applied rewrites77.4%
if 1.1500000000000001e22 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-/.f64N/A
lower-cos.f6485.6
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -0.00065)
(fma F (/ -1.0 (* F (sin B))) t_0)
(if (<= F 7e-52)
(fma F (/ (pow (fma 2.0 x 2.0) -0.5) (sin B)) t_0)
(/ (fma (/ 1.0 F) (/ F (cos B)) (* (- x) 1.0)) (tan B))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -0.00065) {
tmp = fma(F, (-1.0 / (F * sin(B))), t_0);
} else if (F <= 7e-52) {
tmp = fma(F, (pow(fma(2.0, x, 2.0), -0.5) / sin(B)), t_0);
} else {
tmp = fma((1.0 / F), (F / cos(B)), (-x * 1.0)) / tan(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.00065) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), t_0); elseif (F <= 7e-52) tmp = fma(F, Float64((fma(2.0, x, 2.0) ^ -0.5) / sin(B)), t_0); else tmp = Float64(fma(Float64(1.0 / F), Float64(F / cos(B)), Float64(Float64(-x) * 1.0)) / tan(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00065], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 7e-52], N[(F * N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.00065:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-52}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}}{\sin B}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, \frac{F}{\cos B}, \left(-x\right) \cdot 1\right)}{\tan B}\\
\end{array}
if F < -6.4999999999999997e-4Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -6.4999999999999997e-4 < F < 7.0000000000000001e-52Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around 0
Applied rewrites56.0%
if 7.0000000000000001e-52 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-/.f64N/A
lower-cos.f6485.6
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -0.006)
(fma F (/ -1.0 (* F (sin B))) t_0)
(if (<= F 370000.0)
(fma
F
(/
(pow (fma 2.0 x (fma F F 2.0)) -0.5)
(* B (+ 1.0 (* -0.16666666666666666 (pow B 2.0)))))
t_0)
(/ (fma (/ 1.0 F) (/ F (cos B)) (* (- x) 1.0)) (tan B))))))double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -0.006) {
tmp = fma(F, (-1.0 / (F * sin(B))), t_0);
} else if (F <= 370000.0) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / (B * (1.0 + (-0.16666666666666666 * pow(B, 2.0))))), t_0);
} else {
tmp = fma((1.0 / F), (F / cos(B)), (-x * 1.0)) / tan(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.006) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), t_0); elseif (F <= 370000.0) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / Float64(B * Float64(1.0 + Float64(-0.16666666666666666 * (B ^ 2.0))))), t_0); else tmp = Float64(fma(Float64(1.0 / F), Float64(F / cos(B)), Float64(Float64(-x) * 1.0)) / tan(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.006], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 370000.0], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[(B * N[(1.0 + N[(-0.16666666666666666 * N[Power[B, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.006:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, t\_0\right)\\
\mathbf{elif}\;F \leq 370000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{B \cdot \left(1 + -0.16666666666666666 \cdot {B}^{2}\right)}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, \frac{F}{\cos B}, \left(-x\right) \cdot 1\right)}{\tan B}\\
\end{array}
if F < -0.0060000000000000001Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -0.0060000000000000001 < F < 3.7e5Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6470.6
Applied rewrites70.6%
if 3.7e5 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-/.f64N/A
lower-cos.f6485.6
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(if (<= F -0.006)
(fma F (/ -1.0 (* F (sin B))) (/ (- x) (tan B)))
(if (<= F 370000.0)
(-
(*
(/
(pow (fma 2.0 x (fma F F 2.0)) -0.5)
(* (fma (* B B) -0.16666666666666666 1.0) B))
F)
(/ x (tan B)))
(/ (fma (/ 1.0 F) (/ F (cos B)) (* (- x) 1.0)) (tan B)))))double code(double F, double B, double x) {
double tmp;
if (F <= -0.006) {
tmp = fma(F, (-1.0 / (F * sin(B))), (-x / tan(B)));
} else if (F <= 370000.0) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / (fma((B * B), -0.16666666666666666, 1.0) * B)) * F) - (x / tan(B));
} else {
tmp = fma((1.0 / F), (F / cos(B)), (-x * 1.0)) / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.006) tmp = fma(F, Float64(-1.0 / Float64(F * sin(B))), Float64(Float64(-x) / tan(B))); elseif (F <= 370000.0) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / Float64(fma(Float64(B * B), -0.16666666666666666, 1.0) * B)) * F) - Float64(x / tan(B))); else tmp = Float64(fma(Float64(1.0 / F), Float64(F / cos(B)), Float64(Float64(-x) * 1.0)) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.006], N[(F * N[(-1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 370000.0], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[(N[(N[(B * B), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / N[Cos[B], $MachinePrecision]), $MachinePrecision] + N[((-x) * 1.0), $MachinePrecision]), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;F \leq -0.006:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{F \cdot \sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 370000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\mathsf{fma}\left(B \cdot B, -0.16666666666666666, 1\right) \cdot B} \cdot F - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, \frac{F}{\cos B}, \left(-x\right) \cdot 1\right)}{\tan B}\\
\end{array}
if F < -0.0060000000000000001Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -0.0060000000000000001 < F < 3.7e5Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6470.6
Applied rewrites70.6%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites70.6%
if 3.7e5 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-/.f64N/A
lower-cos.f6485.6
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f6455.9
Applied rewrites55.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -0.006)
(fma F (/ -1.0 t_0) t_1)
(if (<= F 370000.0)
(-
(*
(/
(pow (fma 2.0 x (fma F F 2.0)) -0.5)
(* (fma (* B B) -0.16666666666666666 1.0) B))
F)
(/ x (tan B)))
(fma F (/ 1.0 t_0) t_1)))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -0.006) {
tmp = fma(F, (-1.0 / t_0), t_1);
} else if (F <= 370000.0) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / (fma((B * B), -0.16666666666666666, 1.0) * B)) * F) - (x / tan(B));
} else {
tmp = fma(F, (1.0 / t_0), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.006) tmp = fma(F, Float64(-1.0 / t_0), t_1); elseif (F <= 370000.0) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / Float64(fma(Float64(B * B), -0.16666666666666666, 1.0) * B)) * F) - Float64(x / tan(B))); else tmp = fma(F, Float64(1.0 / t_0), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.006], N[(F * N[(-1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 370000.0], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[(N[(N[(B * B), $MachinePrecision] * -0.16666666666666666 + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * F), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.006:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{t\_0}, t\_1\right)\\
\mathbf{elif}\;F \leq 370000:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\mathsf{fma}\left(B \cdot B, -0.16666666666666666, 1\right) \cdot B} \cdot F - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_0}, t\_1\right)\\
\end{array}
if F < -0.0060000000000000001Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -0.0060000000000000001 < F < 3.7e5Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6470.6
Applied rewrites70.6%
lift-fma.f64N/A
add-flipN/A
lower--.f64N/A
Applied rewrites70.6%
if 3.7e5 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4
Applied rewrites52.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -0.00065)
(fma F (/ -1.0 t_0) t_1)
(if (<= F 370000.0)
(fma (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B) t_1)
(fma F (/ 1.0 t_0) t_1)))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -0.00065) {
tmp = fma(F, (-1.0 / t_0), t_1);
} else if (F <= 370000.0) {
tmp = fma(pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (F / B), t_1);
} else {
tmp = fma(F, (1.0 / t_0), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.00065) tmp = fma(F, Float64(-1.0 / t_0), t_1); elseif (F <= 370000.0) tmp = fma((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(F / B), t_1); else tmp = fma(F, Float64(1.0 / t_0), t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00065], N[(F * N[(-1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 370000.0], N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision] + t$95$1), $MachinePrecision], N[(F * N[(1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.00065:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{t\_0}, t\_1\right)\\
\mathbf{elif}\;F \leq 370000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{B}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_0}, t\_1\right)\\
\end{array}
if F < -6.4999999999999997e-4Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -6.4999999999999997e-4 < F < 3.7e5Initial program 77.2%
Taylor expanded in B around 0
lower-/.f6462.3
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites62.4%
if 3.7e5 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6452.4
Applied rewrites52.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B))) (t_1 (/ (- x) (tan B))))
(if (<= F -0.00065)
(fma F (/ -1.0 t_0) t_1)
(if (<= F 1550000000.0)
(fma (pow (fma x 2.0 (fma F F 2.0)) -0.5) (/ F B) t_1)
(fma F (/ 1.0 t_0) (* -1.0 (/ x B)))))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = -x / tan(B);
double tmp;
if (F <= -0.00065) {
tmp = fma(F, (-1.0 / t_0), t_1);
} else if (F <= 1550000000.0) {
tmp = fma(pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (F / B), t_1);
} else {
tmp = fma(F, (1.0 / t_0), (-1.0 * (x / B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -0.00065) tmp = fma(F, Float64(-1.0 / t_0), t_1); elseif (F <= 1550000000.0) tmp = fma((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(F / B), t_1); else tmp = fma(F, Float64(1.0 / t_0), Float64(-1.0 * Float64(x / B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.00065], N[(F * N[(-1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 1550000000.0], N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision] + t$95$1), $MachinePrecision], N[(F * N[(1.0 / t$95$0), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -0.00065:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{t\_0}, t\_1\right)\\
\mathbf{elif}\;F \leq 1550000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{B}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_0}, -1 \cdot \frac{x}{B}\right)\\
\end{array}
if F < -6.4999999999999997e-4Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6454.6
Applied rewrites54.6%
if -6.4999999999999997e-4 < F < 1.55e9Initial program 77.2%
Taylor expanded in B around 0
lower-/.f6462.3
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites62.4%
if 1.55e9 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.7
Applied rewrites58.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6433.2
Applied rewrites33.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (sin B)))
(t_1 (* -1.0 (/ x B)))
(t_2 (fma F (/ -1.0 t_0) t_1)))
(if (<= F -4.5e+227)
t_2
(if (<= F -1.4e+146)
(/ (* -1.0 x) (tan B))
(if (<= F -0.0152)
t_2
(if (<= F 1.3e-15)
(fma (pow (fma x 2.0 2.0) -0.5) (/ F B) (/ (- x) (tan B)))
(fma F (/ 1.0 t_0) t_1)))))))double code(double F, double B, double x) {
double t_0 = F * sin(B);
double t_1 = -1.0 * (x / B);
double t_2 = fma(F, (-1.0 / t_0), t_1);
double tmp;
if (F <= -4.5e+227) {
tmp = t_2;
} else if (F <= -1.4e+146) {
tmp = (-1.0 * x) / tan(B);
} else if (F <= -0.0152) {
tmp = t_2;
} else if (F <= 1.3e-15) {
tmp = fma(pow(fma(x, 2.0, 2.0), -0.5), (F / B), (-x / tan(B)));
} else {
tmp = fma(F, (1.0 / t_0), t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F * sin(B)) t_1 = Float64(-1.0 * Float64(x / B)) t_2 = fma(F, Float64(-1.0 / t_0), t_1) tmp = 0.0 if (F <= -4.5e+227) tmp = t_2; elseif (F <= -1.4e+146) tmp = Float64(Float64(-1.0 * x) / tan(B)); elseif (F <= -0.0152) tmp = t_2; elseif (F <= 1.3e-15) tmp = fma((fma(x, 2.0, 2.0) ^ -0.5), Float64(F / B), Float64(Float64(-x) / tan(B))); else tmp = fma(F, Float64(1.0 / t_0), t_1); 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[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F * N[(-1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[F, -4.5e+227], t$95$2, If[LessEqual[F, -1.4e+146], N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -0.0152], t$95$2, If[LessEqual[F, 1.3e-15], N[(N[Power[N[(x * 2.0 + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F * N[(1.0 / t$95$0), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_0 := F \cdot \sin B\\
t_1 := -1 \cdot \frac{x}{B}\\
t_2 := \mathsf{fma}\left(F, \frac{-1}{t\_0}, t\_1\right)\\
\mathbf{if}\;F \leq -4.5 \cdot 10^{+227}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq -1.4 \cdot 10^{+146}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan B}\\
\mathbf{elif}\;F \leq -0.0152:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, 2\right)\right)}^{-0.5}, \frac{F}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{1}{t\_0}, t\_1\right)\\
\end{array}
if F < -4.5e227 or -1.4e146 < F < -0.0152Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.7
Applied rewrites58.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6435.4
Applied rewrites35.4%
if -4.5e227 < F < -1.4e146Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-*.f6456.0
Applied rewrites56.0%
if -0.0152 < F < 1.30000000000000002e-15Initial program 77.2%
Taylor expanded in B around 0
lower-/.f6462.3
Applied rewrites62.3%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites62.4%
Taylor expanded in F around 0
Applied rewrites48.7%
if 1.30000000000000002e-15 < F Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.7
Applied rewrites58.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-*.f64N/A
lower-sin.f6433.2
Applied rewrites33.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (* -1.0 x) (tan B))))
(if (<= x -4.5e-29)
t_0
(if (<= x 3.5e-22)
(fma
F
(/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B))
(* -1.0 (/ x B)))
t_0))))double code(double F, double B, double x) {
double t_0 = (-1.0 * x) / tan(B);
double tmp;
if (x <= -4.5e-29) {
tmp = t_0;
} else if (x <= 3.5e-22) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-1.0 * (x / B)));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-1.0 * x) / tan(B)) tmp = 0.0 if (x <= -4.5e-29) tmp = t_0; elseif (x <= 3.5e-22) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(-1.0 * Float64(x / B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 * x), $MachinePrecision] / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e-29], t$95$0, If[LessEqual[x, 3.5e-22], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(x / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \frac{-1 \cdot x}{\tan B}\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-22}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, -1 \cdot \frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if x < -4.4999999999999998e-29 or 3.50000000000000005e-22 < x Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-*.f6456.0
Applied rewrites56.0%
if -4.4999999999999998e-29 < x < 3.50000000000000005e-22Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.7
Applied rewrites58.7%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 0.038)
(fma
F
(/
(pow (fma 2.0 x (fma F F 2.0)) -0.5)
(* (fabs B) (+ 1.0 (* -0.16666666666666666 (pow (fabs B) 2.0)))))
(* -1.0 (/ x (fabs B))))
(/ (* -1.0 x) (tan (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 0.038) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / (fabs(B) * (1.0 + (-0.16666666666666666 * pow(fabs(B), 2.0))))), (-1.0 * (x / fabs(B))));
} else {
tmp = (-1.0 * x) / tan(fabs(B));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 0.038) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / Float64(abs(B) * Float64(1.0 + Float64(-0.16666666666666666 * (abs(B) ^ 2.0))))), Float64(-1.0 * Float64(x / abs(B)))); else tmp = Float64(Float64(-1.0 * 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], 0.038], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / 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[(-1.0 * N[(x / N[Abs[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / 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 0.038:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\left|B\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|B\right|\right)}^{2}\right)}, -1 \cdot \frac{x}{\left|B\right|}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan \left(\left|B\right|\right)}\\
\end{array}
if B < 0.0379999999999999991Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f6458.7
Applied rewrites58.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-pow.f6444.3
Applied rewrites44.3%
if 0.0379999999999999991 < B Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-*.f6456.0
Applied rewrites56.0%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 0.038)
(/ (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) x) (fabs B))
(/ (* -1.0 x) (tan (fabs B))))))double code(double F, double B, double x) {
double tmp;
if (fabs(B) <= 0.038) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) - x) / fabs(B);
} else {
tmp = (-1.0 * x) / tan(fabs(B));
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) tmp = 0.0 if (abs(B) <= 0.038) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) - x) / abs(B)); else tmp = Float64(Float64(-1.0 * 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], 0.038], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / 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 0.038:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 \cdot x}{\tan \left(\left|B\right|\right)}\\
\end{array}
if B < 0.0379999999999999991Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
metadata-evalN/A
Applied rewrites44.3%
if 0.0379999999999999991 < B Initial program 77.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites85.6%
lift-fma.f64N/A
lift-/.f64N/A
add-to-fractionN/A
div-addN/A
mult-flipN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites77.3%
Taylor expanded in F around 0
lower-*.f6456.0
Applied rewrites56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sin (fabs B))))
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.5e-9)
(/ (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) x) (fabs B))
(if (<= (fabs B) 8.6e+74) (/ -1.0 t_0) (/ 1.0 t_0))))))double code(double F, double B, double x) {
double t_0 = sin(fabs(B));
double tmp;
if (fabs(B) <= 1.5e-9) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) - x) / fabs(B);
} else if (fabs(B) <= 8.6e+74) {
tmp = -1.0 / t_0;
} else {
tmp = 1.0 / t_0;
}
return copysign(1.0, B) * tmp;
}
function code(F, B, x) t_0 = sin(abs(B)) tmp = 0.0 if (abs(B) <= 1.5e-9) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) - x) / abs(B)); elseif (abs(B) <= 8.6e+74) tmp = Float64(-1.0 / t_0); else tmp = Float64(1.0 / t_0); end return Float64(copysign(1.0, B) * tmp) end
code[F_, B_, x_] := Block[{t$95$0 = N[Sin[N[Abs[B], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[B]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[B], $MachinePrecision], 1.5e-9], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[Abs[B], $MachinePrecision], 8.6e+74], N[(-1.0 / t$95$0), $MachinePrecision], N[(1.0 / t$95$0), $MachinePrecision]]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \sin \left(\left|B\right|\right)\\
\mathsf{copysign}\left(1, B\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|B\right| \leq 1.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\left|B\right|}\\
\mathbf{elif}\;\left|B\right| \leq 8.6 \cdot 10^{+74}:\\
\;\;\;\;\frac{-1}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{t\_0}\\
\end{array}
\end{array}
if B < 1.49999999999999999e-9Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
metadata-evalN/A
Applied rewrites44.3%
if 1.49999999999999999e-9 < B < 8.60000000000000001e74Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.3
Applied rewrites17.3%
if 8.60000000000000001e74 < B Initial program 77.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6417.0
Applied rewrites17.0%
(FPCore (F B x)
:precision binary64
(*
(copysign 1.0 B)
(if (<= (fabs B) 1.5e-9)
(/ (- (* (pow (fma 2.0 x (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.5e-9) {
tmp = ((pow(fma(2.0, x, 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.5e-9) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) - 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.5e-9], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / N[Abs[B], $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.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{\left|B\right|}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin \left(\left|B\right|\right)}\\
\end{array}
if B < 1.49999999999999999e-9Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
metadata-evalN/A
Applied rewrites44.3%
if 1.49999999999999999e-9 < B Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.3
Applied rewrites17.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (* B F))) (t_1 (/ x (* B F))))
(if (<= F -2.5e+154)
(* -1.0 (* F (+ t_0 t_1)))
(if (<= F 1.2e+152)
(/ (- (* (pow (fma 2.0 x (fma F F 2.0)) -0.5) F) x) B)
(* F (fma -1.0 t_1 t_0))))))double code(double F, double B, double x) {
double t_0 = 1.0 / (B * F);
double t_1 = x / (B * F);
double tmp;
if (F <= -2.5e+154) {
tmp = -1.0 * (F * (t_0 + t_1));
} else if (F <= 1.2e+152) {
tmp = ((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) * F) - x) / B;
} else {
tmp = F * fma(-1.0, t_1, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / Float64(B * F)) t_1 = Float64(x / Float64(B * F)) tmp = 0.0 if (F <= -2.5e+154) tmp = Float64(-1.0 * Float64(F * Float64(t_0 + t_1))); elseif (F <= 1.2e+152) tmp = Float64(Float64(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) * F) - x) / B); else tmp = Float64(F * fma(-1.0, t_1, t_0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.5e+154], N[(-1.0 * N[(F * N[(t$95$0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.2e+152], N[(N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(F * N[(-1.0 * t$95$1 + t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{B \cdot F}\\
t_1 := \frac{x}{B \cdot F}\\
\mathbf{if}\;F \leq -2.5 \cdot 10^{+154}:\\
\;\;\;\;-1 \cdot \left(F \cdot \left(t\_0 + t\_1\right)\right)\\
\mathbf{elif}\;F \leq 1.2 \cdot 10^{+152}:\\
\;\;\;\;\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, t\_1, t\_0\right)\\
\end{array}
if F < -2.50000000000000002e154Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6427.4
Applied rewrites27.4%
if -2.50000000000000002e154 < F < 1.2e152Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
metadata-evalN/A
Applied rewrites44.3%
if 1.2e152 < F Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6425.0
Applied rewrites25.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (* B F))) (t_1 (/ x (* B F))))
(if (<= F -1900000.0)
(* -1.0 (* F (+ t_0 t_1)))
(if (<= F 2.3e-26)
(fma (pow (fma 2.0 x 2.0) -0.5) (/ F B) (/ (- x) B))
(* F (fma -1.0 t_1 t_0))))))double code(double F, double B, double x) {
double t_0 = 1.0 / (B * F);
double t_1 = x / (B * F);
double tmp;
if (F <= -1900000.0) {
tmp = -1.0 * (F * (t_0 + t_1));
} else if (F <= 2.3e-26) {
tmp = fma(pow(fma(2.0, x, 2.0), -0.5), (F / B), (-x / B));
} else {
tmp = F * fma(-1.0, t_1, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / Float64(B * F)) t_1 = Float64(x / Float64(B * F)) tmp = 0.0 if (F <= -1900000.0) tmp = Float64(-1.0 * Float64(F * Float64(t_0 + t_1))); elseif (F <= 2.3e-26) tmp = fma((fma(2.0, x, 2.0) ^ -0.5), Float64(F / B), Float64(Float64(-x) / B)); else tmp = Float64(F * fma(-1.0, t_1, t_0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1900000.0], N[(-1.0 * N[(F * N[(t$95$0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.3e-26], N[(N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(F * N[(-1.0 * t$95$1 + t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{B \cdot F}\\
t_1 := \frac{x}{B \cdot F}\\
\mathbf{if}\;F \leq -1900000:\\
\;\;\;\;-1 \cdot \left(F \cdot \left(t\_0 + t\_1\right)\right)\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-26}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-0.5}, \frac{F}{B}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, t\_1, t\_0\right)\\
\end{array}
if F < -1.9e6Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6427.4
Applied rewrites27.4%
if -1.9e6 < F < 2.30000000000000009e-26Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around 0
Applied rewrites28.5%
if 2.30000000000000009e-26 < F Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6425.0
Applied rewrites25.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (* B F))) (t_1 (/ x (* B F))))
(if (<= F -0.017)
(* -1.0 (* F (+ t_0 t_1)))
(if (<= F 1.3e-23) (/ (- x) B) (* F (fma -1.0 t_1 t_0))))))double code(double F, double B, double x) {
double t_0 = 1.0 / (B * F);
double t_1 = x / (B * F);
double tmp;
if (F <= -0.017) {
tmp = -1.0 * (F * (t_0 + t_1));
} else if (F <= 1.3e-23) {
tmp = -x / B;
} else {
tmp = F * fma(-1.0, t_1, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / Float64(B * F)) t_1 = Float64(x / Float64(B * F)) tmp = 0.0 if (F <= -0.017) tmp = Float64(-1.0 * Float64(F * Float64(t_0 + t_1))); elseif (F <= 1.3e-23) tmp = Float64(Float64(-x) / B); else tmp = Float64(F * fma(-1.0, t_1, t_0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.017], N[(-1.0 * N[(F * N[(t$95$0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e-23], N[((-x) / B), $MachinePrecision], N[(F * N[(-1.0 * t$95$1 + t$95$0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \frac{1}{B \cdot F}\\
t_1 := \frac{x}{B \cdot F}\\
\mathbf{if}\;F \leq -0.017:\\
\;\;\;\;-1 \cdot \left(F \cdot \left(t\_0 + t\_1\right)\right)\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{-23}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, t\_1, t\_0\right)\\
\end{array}
if F < -0.017000000000000001Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6427.4
Applied rewrites27.4%
if -0.017000000000000001 < F < 1.3e-23Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6429.7
Applied rewrites29.7%
if 1.3e-23 < F Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6425.0
Applied rewrites25.0%
(FPCore (F B x) :precision binary64 (if (<= F 1.3e-23) (/ (- x) B) (* F (fma -1.0 (/ x (* B F)) (/ 1.0 (* B F))))))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.3e-23) {
tmp = -x / B;
} else {
tmp = F * fma(-1.0, (x / (B * F)), (1.0 / (B * F)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 1.3e-23) tmp = Float64(Float64(-x) / B); else tmp = Float64(F * fma(-1.0, Float64(x / Float64(B * F)), Float64(1.0 / Float64(B * F)))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 1.3e-23], N[((-x) / B), $MachinePrecision], N[(F * N[(-1.0 * N[(x / N[(B * F), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(B * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq 1.3 \cdot 10^{-23}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \mathsf{fma}\left(-1, \frac{x}{B \cdot F}, \frac{1}{B \cdot F}\right)\\
\end{array}
if F < 1.3e-23Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6429.7
Applied rewrites29.7%
if 1.3e-23 < F Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6425.0
Applied rewrites25.0%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / 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 = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\frac{-x}{B}
Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Taylor expanded in F around 0
lower-*.f64N/A
lower-/.f6429.7
Applied rewrites29.7%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-/.f6429.7
Applied rewrites29.7%
(FPCore (F B x) :precision binary64 (if (<= F 1100.0) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1100.0) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(f, b, x)
use fmin_fmax_functions
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1100.0d0) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1100.0) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1100.0: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1100.0) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1100.0) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1100.0], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;F \leq 1100:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
if F < 1100Initial program 77.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6417.3
Applied rewrites17.3%
Taylor expanded in B around 0
Applied rewrites10.4%
if 1100 < F Initial program 77.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around inf
lower-/.f6410.0
Applied rewrites10.0%
(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.2%
lift-pow.f64N/A
sqr-powN/A
lower-unsound-*.f64N/A
lower-unsound-pow.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-unsound-/.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-unsound-pow.f64N/A
Applied rewrites77.2%
Taylor expanded in B around 0
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
lower-/.f64N/A
Applied rewrites44.3%
Applied rewrites36.1%
Taylor expanded in F around inf
lower-/.f6410.0
Applied rewrites10.0%
herbie shell --seed 2025175
(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))))))