
(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 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
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 -2e+139)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 4.9e+38)
(- (/ F (* (sqrt (fma F F 2.0)) (sin B))) t_0)
(- (/ 1.0 (sin B)) (* (/ x (sin B)) (cos B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+139) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 4.9e+38) {
tmp = (F / (sqrt(fma(F, F, 2.0)) * sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((x / sin(B)) * cos(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+139) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 4.9e+38) tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x / sin(B)) * cos(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+139], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4.9e+38], N[(N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+139}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 4.9 \cdot 10^{+38}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\sin B} \cdot \cos B\\
\end{array}
\end{array}
if F < -2.00000000000000007e139Initial program 40.2%
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 rewrites45.8%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites45.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -2.00000000000000007e139 < F < 4.90000000000000002e38Initial program 96.8%
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%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
if 4.90000000000000002e38 < F Initial program 50.5%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+139)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 100000000.0)
(- (/ F (* (sqrt (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 <= -2e+139) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 100000000.0) {
tmp = (F / (sqrt(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 <= -2e+139) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 100000000.0) tmp = Float64(Float64(F / Float64(sqrt(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, -2e+139], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $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 -2 \cdot 10^{+139}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.00000000000000007e139Initial program 40.2%
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 rewrites45.8%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites45.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -2.00000000000000007e139 < F < 1e8Initial program 96.6%
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%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
if 1e8 < F Initial program 54.8%
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 rewrites71.0%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites71.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.65e+17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(fma F (/ (sqrt 0.5) (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 <= -1.65e+17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = fma(F, (sqrt(0.5) / 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 <= -1.65e+17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = fma(F, Float64(sqrt(0.5) / 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, -1.65e+17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / 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 -1.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.65e17Initial program 58.1%
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 rewrites66.8%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites66.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -1.65e17 < F < 1.3999999999999999Initial program 99.3%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.3
Applied rewrites99.3%
Taylor expanded in F around 0
Applied rewrites98.7%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites98.9%
if 1.3999999999999999 < F Initial program 54.8%
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 rewrites71.0%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites71.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7e-5)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 9.5e-223)
(-
(* (/ F (* (fma -0.16666666666666666 (* B B) 1.0) B)) (sqrt 0.5))
(* (/ 1.0 (tan B)) x))
(if (<= F 98000.0)
(- (/ F (* (sqrt (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 <= -7e-5) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 9.5e-223) {
tmp = ((F / (fma(-0.16666666666666666, (B * B), 1.0) * B)) * sqrt(0.5)) - ((1.0 / tan(B)) * x);
} else if (F <= 98000.0) {
tmp = (F / (sqrt(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 <= -7e-5) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 9.5e-223) tmp = Float64(Float64(Float64(F / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) * sqrt(0.5)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 98000.0) tmp = Float64(Float64(F / Float64(sqrt(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, -7e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9.5e-223], N[(N[(N[(F / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 98000.0], N[(N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $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 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-223}:\\
\;\;\;\;\frac{F}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \cdot \sqrt{0.5} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 98000:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 59.8%
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 rewrites68.1%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites68.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.5
Applied rewrites98.5%
if -6.9999999999999994e-5 < F < 9.49999999999999992e-223Initial program 99.4%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.4
Applied rewrites99.4%
Taylor expanded in F around 0
Applied rewrites99.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6488.6
Applied rewrites88.6%
if 9.49999999999999992e-223 < F < 98000Initial program 99.2%
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.3%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6489.5
Applied rewrites89.5%
if 98000 < F Initial program 54.8%
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 rewrites71.0%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites71.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification95.0%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-5)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 9.5e-223)
(-
(* (/ F (* (fma -0.16666666666666666 (* B B) 1.0) B)) (sqrt 0.5))
(* (/ 1.0 (tan B)) x))
(if (<= F 1e+26)
(- (/ F (* (sqrt (fma F F 2.0)) (sin B))) (/ x B))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-5) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 9.5e-223) {
tmp = ((F / (fma(-0.16666666666666666, (B * B), 1.0) * B)) * sqrt(0.5)) - ((1.0 / tan(B)) * x);
} else if (F <= 1e+26) {
tmp = (F / (sqrt(fma(F, F, 2.0)) * sin(B))) - (x / B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-5) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 9.5e-223) tmp = Float64(Float64(Float64(F / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) * sqrt(0.5)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 1e+26) tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e-223], N[(N[(N[(F / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+26], N[(N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $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 -7 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-223}:\\
\;\;\;\;\frac{F}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} \cdot \sqrt{0.5} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 10^{+26}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 59.8%
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 rewrites68.1%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites68.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.5
Applied rewrites98.5%
if -6.9999999999999994e-5 < F < 9.49999999999999992e-223Initial program 99.4%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.4
Applied rewrites99.4%
Taylor expanded in F around 0
Applied rewrites99.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6488.6
Applied rewrites88.6%
if 9.49999999999999992e-223 < F < 1.00000000000000005e26Initial program 99.3%
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.4%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6488.2
Applied rewrites88.2%
if 1.00000000000000005e26 < F Initial program 53.0%
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 rewrites69.9%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites69.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6476.4
Applied rewrites76.4%
Final simplification87.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ F (* (sqrt (+ (fma 2.0 x (* F F)) 2.0)) B)) (/ x (tan B)))))
(if (<= x -1.45e-85)
t_0
(if (<= x 0.036)
(- (/ F (* (sqrt (fma F F 2.0)) (sin B))) (/ x B))
t_0))))
double code(double F, double B, double x) {
double t_0 = (F / (sqrt((fma(2.0, x, (F * F)) + 2.0)) * B)) - (x / tan(B));
double tmp;
if (x <= -1.45e-85) {
tmp = t_0;
} else if (x <= 0.036) {
tmp = (F / (sqrt(fma(F, F, 2.0)) * sin(B))) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / Float64(sqrt(Float64(fma(2.0, x, Float64(F * F)) + 2.0)) * B)) - Float64(x / tan(B))) tmp = 0.0 if (x <= -1.45e-85) tmp = t_0; elseif (x <= 0.036) tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[(N[Sqrt[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e-85], t$95$0, If[LessEqual[x, 0.036], N[(N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(2, x, F \cdot F\right) + 2} \cdot B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-85}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.036:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.4500000000000001e-85 or 0.0359999999999999973 < x Initial program 78.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 rewrites89.0%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites89.0%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6485.8
Applied rewrites85.8%
if -1.4500000000000001e-85 < x < 0.0359999999999999973Initial program 70.2%
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 rewrites75.3%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites75.4%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6475.4
Applied rewrites75.4%
Taylor expanded in B around 0
lower-/.f6468.2
Applied rewrites68.2%
Final simplification76.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= x -2.05e-79)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) t_0)
(if (<= x 11200.0)
(- (/ F (* (sqrt (fma F F 2.0)) (sin B))) (/ x B))
(- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (x <= -2.05e-79) {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - t_0;
} else if (x <= 11200.0) {
tmp = (F / (sqrt(fma(F, F, 2.0)) * sin(B))) - (x / B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (x <= -2.05e-79) tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - t_0); elseif (x <= 11200.0) tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e-79], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 11200.0], N[(N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{-79}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - t\_0\\
\mathbf{elif}\;x \leq 11200:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if x < -2.04999999999999997e-79Initial program 70.4%
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 rewrites82.3%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites82.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6468.4
Applied rewrites68.4%
Taylor expanded in B around 0
Applied rewrites73.0%
if -2.04999999999999997e-79 < x < 11200Initial program 68.7%
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 rewrites73.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites73.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6473.7
Applied rewrites73.7%
Taylor expanded in B around 0
lower-/.f6466.4
Applied rewrites66.4%
if 11200 < x Initial program 90.0%
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.7%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites99.0%
Final simplification75.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= x -1.7e-79)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) t_0)
(if (<= x 9e-13)
(* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0))))
(- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (x <= -1.7e-79) {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - t_0;
} else if (x <= 9e-13) {
tmp = (F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0)));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (x <= -1.7e-79) tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - t_0); elseif (x <= 9e-13) tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0)))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e-79], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[x, 9e-13], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{-79}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - t\_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-13}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if x < -1.69999999999999988e-79Initial program 70.4%
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 rewrites82.3%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites82.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6468.4
Applied rewrites68.4%
Taylor expanded in B around 0
Applied rewrites73.0%
if -1.69999999999999988e-79 < x < 9e-13Initial program 69.4%
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.f6453.1
Applied rewrites53.1%
if 9e-13 < x Initial program 87.7%
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 rewrites96.9%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites96.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6498.8
Applied rewrites98.8%
Taylor expanded in B around 0
Applied rewrites95.3%
Final simplification68.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))))
(if (<= B 0.21)
(/
(fma
(fma
t_0
(fma (* (* B B) F) 0.019444444444444445 (* 0.16666666666666666 F))
(* (fma 0.022222222222222223 (* B B) 0.3333333333333333) x))
(* B B)
(fma t_0 F (- x)))
B)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))));
double tmp;
if (B <= 0.21) {
tmp = fma(fma(t_0, fma(((B * B) * F), 0.019444444444444445, (0.16666666666666666 * F)), (fma(0.022222222222222223, (B * B), 0.3333333333333333) * x)), (B * B), fma(t_0, F, -x)) / B;
} else {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) tmp = 0.0 if (B <= 0.21) tmp = Float64(fma(fma(t_0, fma(Float64(Float64(B * B) * F), 0.019444444444444445, Float64(0.16666666666666666 * F)), Float64(fma(0.022222222222222223, Float64(B * B), 0.3333333333333333) * x)), Float64(B * B), fma(t_0, F, Float64(-x))) / B); else tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.21], N[(N[(N[(t$95$0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.019444444444444445 + N[(0.16666666666666666 * F), $MachinePrecision]), $MachinePrecision] + N[(N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.21:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_0, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.019444444444444445, 0.16666666666666666 \cdot F\right), \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right) \cdot x\right), B \cdot B, \mathsf{fma}\left(t\_0, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.209999999999999992Initial program 73.3%
Taylor expanded in B around 0
Applied rewrites53.7%
if 0.209999999999999992 < B Initial program 76.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 rewrites77.1%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites77.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6456.8
Applied rewrites56.8%
Taylor expanded in B around 0
Applied rewrites46.6%
Final simplification51.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))))
(if (<= B 0.21)
(/
(fma
(fma
t_0
(fma (* (* B B) F) 0.019444444444444445 (* 0.16666666666666666 F))
(* (fma 0.022222222222222223 (* B B) 0.3333333333333333) x))
(* B B)
(fma t_0 F (- x)))
B)
(- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))));
double tmp;
if (B <= 0.21) {
tmp = fma(fma(t_0, fma(((B * B) * F), 0.019444444444444445, (0.16666666666666666 * F)), (fma(0.022222222222222223, (B * B), 0.3333333333333333) * x)), (B * B), fma(t_0, F, -x)) / B;
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) tmp = 0.0 if (B <= 0.21) tmp = Float64(fma(fma(t_0, fma(Float64(Float64(B * B) * F), 0.019444444444444445, Float64(0.16666666666666666 * F)), Float64(fma(0.022222222222222223, Float64(B * B), 0.3333333333333333) * x)), Float64(B * B), fma(t_0, F, Float64(-x))) / B); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.21], N[(N[(N[(t$95$0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.019444444444444445 + N[(0.16666666666666666 * F), $MachinePrecision]), $MachinePrecision] + N[(N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.21:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_0, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.019444444444444445, 0.16666666666666666 \cdot F\right), \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right) \cdot x\right), B \cdot B, \mathsf{fma}\left(t\_0, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.209999999999999992Initial program 73.3%
Taylor expanded in B around 0
Applied rewrites53.7%
if 0.209999999999999992 < B Initial program 76.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 rewrites77.1%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites77.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6456.8
Applied rewrites56.8%
Taylor expanded in B around 0
Applied rewrites44.4%
Final simplification51.1%
(FPCore (F B x)
:precision binary64
(if (<= B 0.21)
(-
(/
(*
(fma (* B B) (* 0.16666666666666666 F) F)
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))))
B)
(*
(/
(fma (fma -0.022222222222222223 (* B B) -0.3333333333333333) (* B B) 1.0)
B)
x))
(- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.21) {
tmp = ((fma((B * B), (0.16666666666666666 * F), F) * sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))))) / B) - ((fma(fma(-0.022222222222222223, (B * B), -0.3333333333333333), (B * B), 1.0) / B) * x);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.21) 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(-0.022222222222222223, Float64(B * B), -0.3333333333333333), Float64(B * B), 1.0) / B) * x)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.21], 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[(-0.022222222222222223 * N[(B * B), $MachinePrecision] + -0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision] * x), $MachinePrecision]), $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 0.21:\\
\;\;\;\;\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(-0.022222222222222223, B \cdot B, -0.3333333333333333\right), B \cdot B, 1\right)}{B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.209999999999999992Initial program 73.3%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites58.6%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6453.5
Applied rewrites53.5%
if 0.209999999999999992 < B Initial program 76.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 rewrites77.1%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites77.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6456.8
Applied rewrites56.8%
Taylor expanded in B around 0
Applied rewrites44.4%
Final simplification51.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
(if (<= F -5.5e+17)
(/ (- -1.0 x) B)
(if (<= F 3e+122)
(/
(fma
t_0
F
(fma
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B)
(- x)))
B)
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double tmp;
if (F <= -5.5e+17) {
tmp = (-1.0 - x) / B;
} else if (F <= 3e+122) {
tmp = fma(t_0, F, fma(fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)), (B * B), -x)) / B;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) tmp = 0.0 if (F <= -5.5e+17) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3e+122) tmp = Float64(fma(t_0, F, fma(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)), Float64(B * B), Float64(-x))) / B); else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -5.5e+17], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3e+122], N[(N[(t$95$0 * F + N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
\mathbf{if}\;F \leq -5.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{+122}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right), B \cdot B, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.5e17Initial program 58.1%
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.f6425.6
Applied rewrites25.6%
Taylor expanded in F around -inf
Applied rewrites38.2%
if -5.5e17 < F < 2.99999999999999986e122Initial program 98.6%
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%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites49.8%
if 2.99999999999999986e122 < F Initial program 37.4%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites33.0%
Taylor expanded in F around inf
Applied rewrites53.6%
Taylor expanded in B around 0
lower-/.f6446.6
Applied rewrites46.6%
Final simplification46.0%
(FPCore (F B x)
:precision binary64
(if (<= F -5.5e+17)
(/ (- -1.0 x) B)
(if (<= F 3.1e+98)
(/
(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)
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.5e+17) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.1e+98) {
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 = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.5e+17) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.1e+98) 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(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.5e+17], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.1e+98], 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[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{+98}:\\
\;\;\;\;\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{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.5e17Initial program 58.1%
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.f6425.6
Applied rewrites25.6%
Taylor expanded in F around -inf
Applied rewrites38.2%
if -5.5e17 < F < 3.10000000000000019e98Initial program 98.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.7%
if 3.10000000000000019e98 < F Initial program 42.5%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites32.0%
Taylor expanded in F around inf
Applied rewrites51.0%
Taylor expanded in B around 0
lower-/.f6444.6
Applied rewrites44.6%
Final simplification45.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma F F 2.0)))))
(if (<= F -8.8e+18)
(/ (- -1.0 x) B)
(if (<= F -8.5e-185)
(/ (* t_0 F) B)
(if (<= F 2.4e-163)
(/ (- x) B)
(if (<= F 700.0)
(* (/ F B) t_0)
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(F, F, 2.0)));
double tmp;
if (F <= -8.8e+18) {
tmp = (-1.0 - x) / B;
} else if (F <= -8.5e-185) {
tmp = (t_0 * F) / B;
} else if (F <= 2.4e-163) {
tmp = -x / B;
} else if (F <= 700.0) {
tmp = (F / B) * t_0;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(F, F, 2.0))) tmp = 0.0 if (F <= -8.8e+18) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -8.5e-185) tmp = Float64(Float64(t_0 * F) / B); elseif (F <= 2.4e-163) tmp = Float64(Float64(-x) / B); elseif (F <= 700.0) tmp = Float64(Float64(F / B) * t_0); else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -8.8e+18], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -8.5e-185], N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.4e-163], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 700.0], N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -8.5 \cdot 10^{-185}:\\
\;\;\;\;\frac{t\_0 \cdot F}{B}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-163}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 700:\\
\;\;\;\;\frac{F}{B} \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -8.8e18Initial program 56.9%
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.3
Applied rewrites26.3%
Taylor expanded in F around -inf
Applied rewrites39.3%
if -8.8e18 < F < -8.5000000000000001e-185Initial program 99.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.f6453.9
Applied rewrites53.9%
Taylor expanded in x around 0
Applied rewrites38.2%
if -8.5000000000000001e-185 < F < 2.4000000000000001e-163Initial program 99.4%
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.3
Applied rewrites47.3%
Taylor expanded in F around 0
Applied rewrites39.6%
if 2.4000000000000001e-163 < F < 700Initial program 99.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.f6449.6
Applied rewrites49.6%
Taylor expanded in x around 0
Applied rewrites33.8%
if 700 < F Initial program 54.8%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in F around inf
Applied rewrites52.8%
Taylor expanded in B around 0
lower-/.f6445.7
Applied rewrites45.7%
Final simplification40.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F B) (sqrt (/ 1.0 (fma F F 2.0))))))
(if (<= F -8.8e+18)
(/ (- -1.0 x) B)
(if (<= F -8.5e-185)
t_0
(if (<= F 2.4e-163)
(/ (- x) B)
(if (<= F 700.0)
t_0
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B))))))))
double code(double F, double B, double x) {
double t_0 = (F / B) * sqrt((1.0 / fma(F, F, 2.0)));
double tmp;
if (F <= -8.8e+18) {
tmp = (-1.0 - x) / B;
} else if (F <= -8.5e-185) {
tmp = t_0;
} else if (F <= 2.4e-163) {
tmp = -x / B;
} else if (F <= 700.0) {
tmp = t_0;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, 2.0)))) tmp = 0.0 if (F <= -8.8e+18) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -8.5e-185) tmp = t_0; elseif (F <= 2.4e-163) tmp = Float64(Float64(-x) / B); elseif (F <= 700.0) tmp = t_0; else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.8e+18], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -8.5e-185], t$95$0, If[LessEqual[F, 2.4e-163], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 700.0], t$95$0, N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{+18}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -8.5 \cdot 10^{-185}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-163}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 700:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -8.8e18Initial program 56.9%
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.3
Applied rewrites26.3%
Taylor expanded in F around -inf
Applied rewrites39.3%
if -8.8e18 < F < -8.5000000000000001e-185 or 2.4000000000000001e-163 < F < 700Initial program 99.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.f6452.1
Applied rewrites52.1%
Taylor expanded in x around 0
Applied rewrites36.4%
if -8.5000000000000001e-185 < F < 2.4000000000000001e-163Initial program 99.4%
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.3
Applied rewrites47.3%
Taylor expanded in F around 0
Applied rewrites39.6%
if 700 < F Initial program 54.8%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in F around inf
Applied rewrites52.8%
Taylor expanded in B around 0
lower-/.f6445.7
Applied rewrites45.7%
Final simplification40.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+154)
(/ (- -1.0 x) B)
(if (<= F 2900000000.0)
(/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+154) {
tmp = (-1.0 - x) / B;
} else if (F <= 2900000000.0) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+154) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2900000000.0) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+154], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2900000000.0], 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[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2900000000:\\
\;\;\;\;\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(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.00000000000000004e154Initial program 34.0%
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.f6415.9
Applied rewrites15.9%
Taylor expanded in F around -inf
Applied rewrites38.9%
if -1.00000000000000004e154 < F < 2.9e9Initial program 96.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.f6447.9
Applied rewrites47.9%
if 2.9e9 < F Initial program 54.8%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in F around inf
Applied rewrites52.8%
Taylor expanded in B around 0
lower-/.f6445.7
Applied rewrites45.7%
Final simplification45.9%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-5)
(/ (- -1.0 x) B)
(if (<= F 2900000000.0)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= 2900000000.0) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2900000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2900000000.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2900000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 59.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.f6424.7
Applied rewrites24.7%
Taylor expanded in F around -inf
Applied rewrites36.8%
if -6.9999999999999994e-5 < F < 2.9e9Initial program 99.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.f6452.3
Applied rewrites52.3%
Applied rewrites52.4%
if 2.9e9 < F Initial program 54.8%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.1%
Taylor expanded in F around inf
Applied rewrites52.8%
Taylor expanded in B around 0
lower-/.f6445.7
Applied rewrites45.7%
Final simplification45.9%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-5)
(/ (- -1.0 x) B)
(if (<= F 8e+25)
(/ (fma (sqrt (/ 1.0 (fma 2.0 x 2.0))) F (- x)) B)
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= 8e+25) {
tmp = fma(sqrt((1.0 / fma(2.0, x, 2.0))), F, -x) / B;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8e+25) tmp = Float64(fma(sqrt(Float64(1.0 / fma(2.0, x, 2.0))), F, Float64(-x)) / B); else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e+25], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+25}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 59.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.f6424.7
Applied rewrites24.7%
Taylor expanded in F around -inf
Applied rewrites36.8%
if -6.9999999999999994e-5 < F < 8.00000000000000072e25Initial program 99.4%
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.f6451.9
Applied rewrites51.9%
Taylor expanded in F around 0
Applied rewrites51.7%
if 8.00000000000000072e25 < F Initial program 53.0%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites36.0%
Taylor expanded in F around inf
Applied rewrites53.4%
Taylor expanded in B around 0
lower-/.f6446.0
Applied rewrites46.0%
Final simplification45.8%
(FPCore (F B x)
:precision binary64
(if (<= F -3.9e-151)
(/ (- -1.0 x) B)
(if (<= F 1e-9)
(/ (- x) B)
(- (/ (fma (* B B) 0.16666666666666666 1.0) B) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.9e-151) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-9) {
tmp = -x / B;
} else {
tmp = (fma((B * B), 0.16666666666666666, 1.0) / B) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.9e-151) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1e-9) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(fma(Float64(B * B), 0.16666666666666666, 1.0) / B) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.9e-151], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e-9], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.9 \cdot 10^{-151}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 10^{-9}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right)}{B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.90000000000000007e-151Initial program 69.0%
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.f6432.4
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites33.4%
if -3.90000000000000007e-151 < F < 1.00000000000000006e-9Initial program 99.4%
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.f6449.7
Applied rewrites49.7%
Taylor expanded in F around 0
Applied rewrites31.2%
if 1.00000000000000006e-9 < F Initial program 55.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites37.6%
Taylor expanded in F around inf
Applied rewrites51.8%
Taylor expanded in B around 0
lower-/.f6444.8
Applied rewrites44.8%
Final simplification36.4%
(FPCore (F B x) :precision binary64 (if (<= F -3.9e-151) (/ (- -1.0 x) B) (if (<= F 3.6e-162) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.9e-151) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e-162) {
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 <= (-3.9d-151)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.6d-162) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.9e-151) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e-162) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.9e-151: tmp = (-1.0 - x) / B elif F <= 3.6e-162: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.9e-151) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.6e-162) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.9e-151) tmp = (-1.0 - x) / B; elseif (F <= 3.6e-162) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.9e-151], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e-162], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.9 \cdot 10^{-151}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-162}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.90000000000000007e-151Initial program 69.0%
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.f6432.4
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites33.4%
if -3.90000000000000007e-151 < F < 3.5999999999999998e-162Initial program 99.4%
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.f6451.5
Applied rewrites51.5%
Taylor expanded in F around 0
Applied rewrites36.9%
if 3.5999999999999998e-162 < F Initial program 65.4%
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.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites38.7%
(FPCore (F B x) :precision binary64 (if (<= F -3.9e-151) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.9e-151) {
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 <= (-3.9d-151)) 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 <= -3.9e-151) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.9e-151: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.9e-151) 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 <= -3.9e-151) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.9e-151], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.9 \cdot 10^{-151}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -3.90000000000000007e-151Initial program 69.0%
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.f6432.4
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites33.4%
if -3.90000000000000007e-151 < F Initial program 77.4%
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.f6444.1
Applied rewrites44.1%
Taylor expanded in F around 0
Applied rewrites29.9%
(FPCore (F B x) :precision binary64 (if (<= F -1.7e+32) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.7e+32) {
tmp = -1.0 / 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 <= (-1.7d+32)) then
tmp = (-1.0d0) / 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 <= -1.7e+32) {
tmp = -1.0 / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.7e+32: tmp = -1.0 / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.7e+32) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.7e+32) tmp = -1.0 / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.7e+32], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.7 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.69999999999999989e32Initial program 54.9%
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.f6425.8
Applied rewrites25.8%
Taylor expanded in F around -inf
Applied rewrites39.5%
Taylor expanded in x around 0
Applied rewrites29.7%
if -1.69999999999999989e32 < F Initial program 80.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.f6444.5
Applied rewrites44.5%
Taylor expanded in F around 0
Applied rewrites28.0%
(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 74.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.f6439.8
Applied rewrites39.8%
Taylor expanded in F around -inf
Applied rewrites25.5%
Taylor expanded in x around 0
Applied rewrites10.2%
(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(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 74.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.f6439.8
Applied rewrites39.8%
Taylor expanded in F around 0
Applied rewrites24.1%
Applied rewrites9.2%
Applied rewrites2.9%
herbie shell --seed 2024332
(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))))))