
(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)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 25 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)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -200000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 10000000.0)
(+
(/ 1.0 (/ (sin B) (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F)))
(* (/ -1.0 (tan B)) x))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -200000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 10000000.0) {
tmp = (1.0 / (sin(B) / (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F))) + ((-1.0 / tan(B)) * x);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -200000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 10000000.0) tmp = Float64(Float64(1.0 / Float64(sin(B) / Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F))) + Float64(Float64(-1.0 / tan(B)) * x)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -200000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 10000000.0], N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] / N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -200000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 10000000:\\
\;\;\;\;\frac{1}{\frac{\sin B}{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}} + \frac{-1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2e8Initial program 62.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.1%
Applied rewrites79.2%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -2e8 < F < 1e7Initial program 99.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.5
Applied rewrites99.5%
if 1e7 < F Initial program 57.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.6%
Applied rewrites74.6%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+56)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 125000000.0)
(fma
(pow (fma x 2.0 (fma F F 2.0)) -0.5)
(/ F (sin B))
(/ (- x) (tan B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4e+56) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 125000000.0) {
tmp = fma(pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (F / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -4e+56) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 125000000.0) tmp = fma((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4e+56], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 125000000.0], N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -4 \cdot 10^{+56}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 125000000:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.00000000000000037e56Initial program 59.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites77.4%
Applied rewrites77.5%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -4.00000000000000037e56 < F < 1.25e8Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
if 1.25e8 < F Initial program 57.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.6%
Applied rewrites74.6%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5e+81)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 125000000.0)
(fma
(/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))
F
(/ (- x) (tan B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5e+81) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 125000000.0) {
tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, (-x / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+81) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 125000000.0) tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+81], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 125000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+81}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 125000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.9999999999999998e81Initial program 56.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.9%
Applied rewrites75.0%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -4.9999999999999998e81 < F < 1.25e8Initial program 98.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.5%
if 1.25e8 < F Initial program 57.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.6%
Applied rewrites74.6%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.7e+154)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 10000000.0)
(- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.7e+154) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 10000000.0) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.7e+154) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 10000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.7e+154], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 10000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.7 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 10000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.69999999999999994e154Initial program 31.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites56.1%
Applied rewrites56.1%
Taylor expanded in F around -inf
Applied rewrites99.6%
if -3.69999999999999994e154 < F < 1e7Initial program 97.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.5%
if 1e7 < F Initial program 57.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.6%
Applied rewrites74.6%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -250000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ (/ F (sqrt (fma x 2.0 2.0))) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -250000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((F / sqrt(fma(x, 2.0, 2.0))) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -250000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, 2.0))) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -250000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -250000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.5e11Initial program 61.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites78.7%
Applied rewrites78.8%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -2.5e11 < F < 1.3999999999999999Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.5%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.5
Applied rewrites98.5%
if 1.3999999999999999 < F Initial program 59.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites75.9%
Applied rewrites76.0%
Taylor expanded in F around inf
Applied rewrites99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.2e+55)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.3e-102)
(fma
(* (- F) (pow (fma x 2.0 (fma F F 2.0)) -0.5))
(/ -1.0 B)
(/ (- x) (tan B)))
(if (<= F 12.8)
(- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.2e+55) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.3e-102) {
tmp = fma((-F * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)), (-1.0 / B), (-x / tan(B)));
} else if (F <= 12.8) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.2e+55) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.3e-102) tmp = fma(Float64(Float64(-F) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)), Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); elseif (F <= 12.8) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.2e+55], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.3e-102], N[(N[((-F) * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 12.8], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{+55}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-102}:\\
\;\;\;\;\mathsf{fma}\left(\left(-F\right) \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 12.8:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7.19999999999999975e55Initial program 59.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites77.8%
Applied rewrites77.9%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -7.19999999999999975e55 < F < 2.29999999999999987e-102Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6489.8
Applied rewrites89.8%
if 2.29999999999999987e-102 < F < 12.800000000000001Initial program 99.3%
Taylor expanded in B around 0
lower-/.f6489.0
Applied rewrites89.0%
Applied rewrites89.0%
if 12.800000000000001 < F Initial program 59.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites75.9%
Applied rewrites76.0%
Taylor expanded in F around inf
Applied rewrites99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.2e+55)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.3e-102)
(- (* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B)) t_0)
(if (<= F 12.8)
(- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.2e+55) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.3e-102) {
tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - t_0;
} else if (F <= 12.8) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.2e+55) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.3e-102) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - t_0); elseif (F <= 12.8) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.2e+55], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.3e-102], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 12.8], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{+55}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-102}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - t\_0\\
\mathbf{elif}\;F \leq 12.8:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7.19999999999999975e55Initial program 59.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites77.8%
Applied rewrites77.9%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -7.19999999999999975e55 < F < 2.29999999999999987e-102Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6489.8
Applied rewrites89.8%
if 2.29999999999999987e-102 < F < 12.800000000000001Initial program 99.3%
Taylor expanded in B around 0
lower-/.f6489.0
Applied rewrites89.0%
Applied rewrites89.0%
if 12.800000000000001 < F Initial program 59.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites75.9%
Applied rewrites76.0%
Taylor expanded in F around inf
Applied rewrites99.3%
Final simplification94.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7.2e+55)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.3e-102)
(- (* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B)) t_0)
(if (<= F 5.6e+63)
(- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))
(if (<= F 6.6e+216)
(- (/ 1.0 B) t_0)
(- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7.2e+55) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.3e-102) {
tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - t_0;
} else if (F <= 5.6e+63) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else if (F <= 6.6e+216) {
tmp = (1.0 / B) - t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7.2e+55) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.3e-102) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - t_0); elseif (F <= 5.6e+63) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); elseif (F <= 6.6e+216) tmp = Float64(Float64(1.0 / B) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.2e+55], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.3e-102], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 5.6e+63], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.6e+216], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7.2 \cdot 10^{+55}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.3 \cdot 10^{-102}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - t\_0\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{+63}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.6 \cdot 10^{+216}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -7.19999999999999975e55Initial program 59.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites77.8%
Applied rewrites77.9%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -7.19999999999999975e55 < F < 2.29999999999999987e-102Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6489.8
Applied rewrites89.8%
if 2.29999999999999987e-102 < F < 5.59999999999999974e63Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6487.1
Applied rewrites87.1%
Applied rewrites87.2%
if 5.59999999999999974e63 < F < 6.6e216Initial program 66.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites81.6%
Applied rewrites81.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6457.6
Applied rewrites57.6%
Taylor expanded in F around inf
Applied rewrites83.0%
if 6.6e216 < F Initial program 15.1%
Taylor expanded in B around 0
lower-/.f646.3
Applied rewrites6.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6486.0
Applied rewrites86.0%
Final simplification90.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma 2.0 x (fma F F 2.0)))) (t_1 (/ x (tan B))))
(if (<= F -9.5e+142)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2.15e-116)
(- (/ F (* t_0 B)) t_1)
(if (<= F 5.6e+63)
(- (/ (/ F t_0) (sin B)) (/ x B))
(if (<= F 6.6e+216)
(- (/ 1.0 B) t_1)
(- (/ 1.0 (sin B)) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0)));
double t_1 = x / tan(B);
double tmp;
if (F <= -9.5e+142) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.15e-116) {
tmp = (F / (t_0 * B)) - t_1;
} else if (F <= 5.6e+63) {
tmp = ((F / t_0) / sin(B)) - (x / B);
} else if (F <= 6.6e+216) {
tmp = (1.0 / B) - t_1;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -9.5e+142) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.15e-116) tmp = Float64(Float64(F / Float64(t_0 * B)) - t_1); elseif (F <= 5.6e+63) tmp = Float64(Float64(Float64(F / t_0) / sin(B)) - Float64(x / B)); elseif (F <= 6.6e+216) tmp = Float64(Float64(1.0 / B) - t_1); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -9.5e+142], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.15e-116], N[(N[(F / N[(t$95$0 * B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 5.6e+63], N[(N[(N[(F / t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.6e+216], N[(N[(1.0 / B), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -9.5 \cdot 10^{+142}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.15 \cdot 10^{-116}:\\
\;\;\;\;\frac{F}{t\_0 \cdot B} - t\_1\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{+63}:\\
\;\;\;\;\frac{\frac{F}{t\_0}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.6 \cdot 10^{+216}:\\
\;\;\;\;\frac{1}{B} - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -9.50000000000000001e142Initial program 36.4%
Taylor expanded in B around 0
lower-/.f6414.7
Applied rewrites14.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6476.8
Applied rewrites76.8%
if -9.50000000000000001e142 < F < 2.1499999999999999e-116Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6487.0
Applied rewrites87.0%
Applied rewrites87.8%
if 2.1499999999999999e-116 < F < 5.59999999999999974e63Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6488.1
Applied rewrites88.1%
Applied rewrites88.1%
if 5.59999999999999974e63 < F < 6.6e216Initial program 66.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites81.6%
Applied rewrites81.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6457.6
Applied rewrites57.6%
Taylor expanded in F around inf
Applied rewrites83.0%
if 6.6e216 < F Initial program 15.1%
Taylor expanded in B around 0
lower-/.f646.3
Applied rewrites6.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6486.0
Applied rewrites86.0%
Final simplification85.8%
(FPCore (F B x)
:precision binary64
(if (<= F -9.5e+142)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 920000.0)
(- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) B)) (/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.5e+142) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 920000.0) {
tmp = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9.5e+142) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 920000.0) tmp = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * B)) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9.5e+142], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 920000.0], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{+142}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 920000:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -9.50000000000000001e142Initial program 36.4%
Taylor expanded in B around 0
lower-/.f6414.7
Applied rewrites14.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6476.8
Applied rewrites76.8%
if -9.50000000000000001e142 < F < 9.2e5Initial program 98.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6484.4
Applied rewrites84.4%
Applied rewrites85.0%
if 9.2e5 < F Initial program 57.8%
Taylor expanded in B around 0
lower-/.f6436.4
Applied rewrites36.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6476.7
Applied rewrites76.7%
Final simplification81.8%
(FPCore (F B x) :precision binary64 (if (<= B 6.8e-9) (/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B) (- (* (/ 1.0 F) (/ F B)) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 6.8e-9) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = ((1.0 / F) * (F / B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 6.8e-9) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(1.0 / F) * Float64(F / B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 6.8e-9], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 6.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{F} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 6.7999999999999997e-9Initial program 78.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6461.9
Applied rewrites61.9%
if 6.7999999999999997e-9 < B Initial program 84.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites86.1%
Applied rewrites86.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6456.4
Applied rewrites56.4%
Taylor expanded in F around inf
Applied rewrites55.6%
Final simplification60.2%
(FPCore (F B x) :precision binary64 (if (<= B 6.8e-9) (/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 6.8e-9) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 6.8e-9) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 6.8e-9], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 6.8 \cdot 10^{-9}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 6.7999999999999997e-9Initial program 78.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6461.9
Applied rewrites61.9%
if 6.7999999999999997e-9 < B Initial program 84.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites86.1%
Applied rewrites86.2%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6456.4
Applied rewrites56.4%
Taylor expanded in F around inf
Applied rewrites54.3%
(FPCore (F B x)
:precision binary64
(if (<= B 0.112)
(-
(/
(*
(fma (* B B) (* 0.16666666666666666 F) F)
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))))
B)
(*
(/
(fma
(fma
(fma -0.0021164021164021165 (* B B) -0.022222222222222223)
(* B B)
-0.3333333333333333)
(* B B)
1.0)
B)
x))
(/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.112) {
tmp = ((fma((B * B), (0.16666666666666666 * F), F) * sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))))) / B) - ((fma(fma(fma(-0.0021164021164021165, (B * B), -0.022222222222222223), (B * B), -0.3333333333333333), (B * B), 1.0) / B) * x);
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.112) tmp = Float64(Float64(Float64(fma(Float64(B * B), Float64(0.16666666666666666 * F), F) * sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0))))) / B) - Float64(Float64(fma(fma(fma(-0.0021164021164021165, Float64(B * B), -0.022222222222222223), Float64(B * B), -0.3333333333333333), Float64(B * B), 1.0) / B) * x)); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.112], N[(N[(N[(N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - N[(N[(N[(N[(N[(-0.0021164021164021165 * N[(B * B), $MachinePrecision] + -0.022222222222222223), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.112:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0021164021164021165, B \cdot B, -0.022222222222222223\right), B \cdot B, -0.3333333333333333\right), B \cdot B, 1\right)}{B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 0.112000000000000002Initial program 79.1%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites67.3%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6462.0
Applied rewrites62.0%
if 0.112000000000000002 < B Initial program 83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites85.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6433.1
Applied rewrites33.1%
Taylor expanded in F around inf
Applied rewrites22.8%
Final simplification52.2%
(FPCore (F B x)
:precision binary64
(if (<= B 0.112)
(/
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* B B) (* 0.16666666666666666 F) F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.112) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma((B * B), (0.16666666666666666 * F), F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.112) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(Float64(B * B), Float64(0.16666666666666666 * F), F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.112], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.112:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 0.112000000000000002Initial program 79.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites62.1%
if 0.112000000000000002 < B Initial program 83.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites85.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6433.1
Applied rewrites33.1%
Taylor expanded in F around inf
Applied rewrites22.8%
(FPCore (F B x)
:precision binary64
(if (<= B 9e+16)
(/
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* B B) (* 0.16666666666666666 F) F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(/ -1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 9e+16) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma((B * B), (0.16666666666666666 * F), F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else {
tmp = -1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 9e+16) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(Float64(B * B), Float64(0.16666666666666666 * F), F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); else tmp = Float64(-1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 9e+16], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9 \cdot 10^{+16}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\end{array}
\end{array}
if B < 9e16Initial program 78.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites60.6%
if 9e16 < B Initial program 85.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6434.0
Applied rewrites34.0%
Taylor expanded in F around -inf
Applied rewrites13.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+183)
(/ (/ (- 1.0 (* x x)) (+ -1.0 x)) B)
(if (<= F 12.8)
(/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
(/ (fma (/ (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) 1.0) F) F (- x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+183) {
tmp = ((1.0 - (x * x)) / (-1.0 + x)) / B;
} else if (F <= 12.8) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = fma((fma((-0.5 / F), (fma(2.0, x, 2.0) / F), 1.0) / F), F, -x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+183) tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(-1.0 + x)) / B); elseif (F <= 12.8) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(fma(Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), 1.0) / F), F, Float64(-x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+183], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 12.8], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + 1.0), $MachinePrecision] / F), $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+183}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{-1 + x}}{B}\\
\mathbf{elif}\;F \leq 12.8:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right)}{F}, F, -x\right)}{B}\\
\end{array}
\end{array}
if F < -1.3e183Initial program 31.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6426.2
Applied rewrites26.2%
Taylor expanded in F around -inf
Applied rewrites48.2%
Applied rewrites48.7%
if -1.3e183 < F < 12.800000000000001Initial program 96.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6455.4
Applied rewrites55.4%
if 12.800000000000001 < F Initial program 59.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6437.2
Applied rewrites37.2%
Taylor expanded in F around inf
Applied rewrites45.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+183)
(/ (/ (- 1.0 (* x x)) (+ -1.0 x)) B)
(if (<= F 12.8)
(/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
(/ (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) (- 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+183) {
tmp = ((1.0 - (x * x)) / (-1.0 + x)) / B;
} else if (F <= 12.8) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = fma((-0.5 / F), (fma(2.0, x, 2.0) / F), (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+183) tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(-1.0 + x)) / B); elseif (F <= 12.8) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+183], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 12.8], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+183}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{-1 + x}}{B}\\
\mathbf{elif}\;F \leq 12.8:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.3e183Initial program 31.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6426.2
Applied rewrites26.2%
Taylor expanded in F around -inf
Applied rewrites48.2%
Applied rewrites48.7%
if -1.3e183 < F < 12.800000000000001Initial program 96.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6455.4
Applied rewrites55.4%
if 12.800000000000001 < F Initial program 59.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6437.2
Applied rewrites37.2%
Taylor expanded in F around inf
Applied rewrites45.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+183)
(/ (/ (- 1.0 (* x x)) (+ -1.0 x)) B)
(if (<= F 12.8)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/ (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) (- 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+183) {
tmp = ((1.0 - (x * x)) / (-1.0 + x)) / B;
} else if (F <= 12.8) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = fma((-0.5 / F), (fma(2.0, x, 2.0) / F), (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+183) tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(-1.0 + x)) / B); elseif (F <= 12.8) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+183], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 12.8], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+183}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{-1 + x}}{B}\\
\mathbf{elif}\;F \leq 12.8:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.3e183Initial program 31.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6426.2
Applied rewrites26.2%
Taylor expanded in F around -inf
Applied rewrites48.2%
Applied rewrites48.7%
if -1.3e183 < F < 12.800000000000001Initial program 96.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6455.4
Applied rewrites55.4%
Applied rewrites55.4%
Taylor expanded in x around 0
Applied rewrites55.4%
if 12.800000000000001 < F Initial program 59.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6437.2
Applied rewrites37.2%
Taylor expanded in F around inf
Applied rewrites45.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+183)
(/ (/ (- 1.0 (* x x)) (+ -1.0 x)) B)
(if (<= F 6600000.0)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/ (fma (/ 1.0 F) F (- x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+183) {
tmp = ((1.0 - (x * x)) / (-1.0 + x)) / B;
} else if (F <= 6600000.0) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = fma((1.0 / F), F, -x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+183) tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(-1.0 + x)) / B); elseif (F <= 6600000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(fma(Float64(1.0 / F), F, Float64(-x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+183], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6600000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+183}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{-1 + x}}{B}\\
\mathbf{elif}\;F \leq 6600000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, F, -x\right)}{B}\\
\end{array}
\end{array}
if F < -1.3e183Initial program 31.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6426.2
Applied rewrites26.2%
Taylor expanded in F around -inf
Applied rewrites48.2%
Applied rewrites48.7%
if -1.3e183 < F < 6.6e6Initial program 96.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6455.6
Applied rewrites55.6%
Applied rewrites55.6%
Taylor expanded in x around 0
Applied rewrites55.6%
if 6.6e6 < F Initial program 57.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6435.9
Applied rewrites35.9%
Taylor expanded in F around inf
Applied rewrites44.8%
(FPCore (F B x)
:precision binary64
(if (<= F -250000000000.0)
(/ (- -1.0 x) B)
(if (<= F 1.4)
(/ (- (/ F (sqrt (fma 2.0 x 2.0))) x) B)
(/ (fma (/ 1.0 F) F (- x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -250000000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4) {
tmp = ((F / sqrt(fma(2.0, x, 2.0))) - x) / B;
} else {
tmp = fma((1.0 / F), F, -x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -250000000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, 2.0))) - x) / B); else tmp = Float64(fma(Float64(1.0 / F), F, Float64(-x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -250000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -250000000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, F, -x\right)}{B}\\
\end{array}
\end{array}
if F < -2.5e11Initial program 61.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6440.4
Applied rewrites40.4%
Taylor expanded in F around -inf
Applied rewrites49.7%
if -2.5e11 < F < 1.3999999999999999Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6456.5
Applied rewrites56.5%
Applied rewrites56.4%
Taylor expanded in F around 0
Applied rewrites55.6%
if 1.3999999999999999 < F Initial program 59.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6437.2
Applied rewrites37.2%
Taylor expanded in F around inf
Applied rewrites45.4%
(FPCore (F B x) :precision binary64 (if (<= F -9e-91) (/ (- -1.0 x) B) (if (<= F 3.4e-31) (/ (- x) B) (/ (fma (/ 1.0 F) F (- x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-91) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-31) {
tmp = -x / B;
} else {
tmp = fma((1.0 / F), F, -x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e-91) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.4e-31) tmp = Float64(Float64(-x) / B); else tmp = Float64(fma(Float64(1.0 / F), F, Float64(-x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e-91], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-31], N[((-x) / B), $MachinePrecision], N[(N[(N[(1.0 / F), $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-91}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-31}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{1}{F}, F, -x\right)}{B}\\
\end{array}
\end{array}
if F < -8.99999999999999952e-91Initial program 72.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.1
Applied rewrites48.1%
Taylor expanded in F around -inf
Applied rewrites41.1%
if -8.99999999999999952e-91 < F < 3.4000000000000001e-31Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6454.1
Applied rewrites54.1%
Taylor expanded in F around 0
Applied rewrites37.6%
if 3.4000000000000001e-31 < F Initial program 64.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in F around inf
Applied rewrites41.6%
(FPCore (F B x) :precision binary64 (if (<= F -9e-91) (/ (- -1.0 x) B) (if (<= F 3.4e-31) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-91) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-31) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-9d-91)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.4d-31) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9e-91) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-31) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9e-91: tmp = (-1.0 - x) / B elif F <= 3.4e-31: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9e-91) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.4e-31) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9e-91) tmp = (-1.0 - x) / B; elseif (F <= 3.4e-31) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9e-91], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-31], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-91}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-31}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.99999999999999952e-91Initial program 72.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.1
Applied rewrites48.1%
Taylor expanded in F around -inf
Applied rewrites41.1%
if -8.99999999999999952e-91 < F < 3.4000000000000001e-31Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6454.1
Applied rewrites54.1%
Taylor expanded in F around 0
Applied rewrites37.6%
if 3.4000000000000001e-31 < F Initial program 64.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in F around inf
Applied rewrites41.6%
(FPCore (F B x) :precision binary64 (if (<= F -9e-91) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-91) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-9d-91)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9e-91) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9e-91: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9e-91) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9e-91) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9e-91], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-91}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -8.99999999999999952e-91Initial program 72.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.1
Applied rewrites48.1%
Taylor expanded in F around -inf
Applied rewrites41.1%
if -8.99999999999999952e-91 < F Initial program 83.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.5
Applied rewrites47.5%
Taylor expanded in F around 0
Applied rewrites30.7%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
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]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 80.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.7
Applied rewrites47.7%
Taylor expanded in F around 0
Applied rewrites29.3%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 80.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.7
Applied rewrites47.7%
Taylor expanded in F around -inf
Applied rewrites24.6%
Taylor expanded in x around 0
Applied rewrites7.5%
herbie shell --seed 2024267
(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))))))