
(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 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
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
(if (<= F -145000000.0)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 5e+38)
(fma F (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -145000000.0) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 5e+38) {
tmp = fma(F, (pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -145000000.0) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 5e+38) tmp = fma(F, Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -145000000.0], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e+38], N[(F * N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -145000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.45e8Initial program 58.7%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -1.45e8 < F < 4.9999999999999997e38Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
if 4.9999999999999997e38 < F Initial program 50.5%
Taylor expanded in F around inf
associate-/l*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B)))
(t_1 (/ (- x) (* (fma 0.3333333333333333 (* B B) 1.0) B)))
(t_2 (fma F (/ (pow (sqrt (fma F F 2.0)) -1.0) (sin B)) t_1)))
(if (<= F -2.4e+111)
(fma F (/ -1.0 (* (fma (* (* B B) F) -0.16666666666666666 F) B)) t_0)
(if (<= F -6.1e-121)
t_2
(if (<= F 9.5e-223)
(fma
F
(* (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (pow B -1.0))
t_0)
(if (<= F 2e+125) t_2 (+ t_1 (pow (sin B) -1.0))))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = -x / (fma(0.3333333333333333, (B * B), 1.0) * B);
double t_2 = fma(F, (pow(sqrt(fma(F, F, 2.0)), -1.0) / sin(B)), t_1);
double tmp;
if (F <= -2.4e+111) {
tmp = fma(F, (-1.0 / (fma(((B * B) * F), -0.16666666666666666, F) * B)), t_0);
} else if (F <= -6.1e-121) {
tmp = t_2;
} else if (F <= 9.5e-223) {
tmp = fma(F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) * pow(B, -1.0)), t_0);
} else if (F <= 2e+125) {
tmp = t_2;
} else {
tmp = t_1 + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(Float64(-x) / Float64(fma(0.3333333333333333, Float64(B * B), 1.0) * B)) t_2 = fma(F, Float64((sqrt(fma(F, F, 2.0)) ^ -1.0) / sin(B)), t_1) tmp = 0.0 if (F <= -2.4e+111) tmp = fma(F, Float64(-1.0 / Float64(fma(Float64(Float64(B * B) * F), -0.16666666666666666, F) * B)), t_0); elseif (F <= -6.1e-121) tmp = t_2; elseif (F <= 9.5e-223) tmp = fma(F, Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) * (B ^ -1.0)), t_0); elseif (F <= 2e+125) tmp = t_2; else tmp = Float64(t_1 + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F * N[(N[Power[N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[F, -2.4e+111], N[(F * N[(-1.0 / N[(N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * -0.16666666666666666 + F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, -6.1e-121], t$95$2, If[LessEqual[F, 9.5e-223], N[(F * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 2e+125], t$95$2, N[(t$95$1 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{-x}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B}\\
t_2 := \mathsf{fma}\left(F, \frac{{\left(\sqrt{\mathsf{fma}\left(F, F, 2\right)}\right)}^{-1}}{\sin B}, t\_1\right)\\
\mathbf{if}\;F \leq -2.4 \cdot 10^{+111}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot F, -0.16666666666666666, F\right) \cdot B}, t\_0\right)\\
\mathbf{elif}\;F \leq -6.1 \cdot 10^{-121}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-223}:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot {B}^{-1}, t\_0\right)\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+125}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -2.40000000000000006e111Initial program 46.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites53.4%
Taylor expanded in F around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
Applied rewrites67.6%
if -2.40000000000000006e111 < F < -6.09999999999999978e-121 or 9.49999999999999992e-223 < F < 1.9999999999999998e125Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.5
Applied rewrites99.5%
Applied rewrites99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.2
Applied rewrites84.2%
if -6.09999999999999978e-121 < F < 9.49999999999999992e-223Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6493.5
Applied rewrites93.5%
if 1.9999999999999998e125 < F Initial program 36.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6476.0
Applied rewrites76.0%
Final simplification81.1%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-5)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 9.5e-223)
(fma
F
(* (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (pow B -1.0))
(/ (- x) (tan B)))
(if (<= F 35000.0)
(fma
F
(/ (pow (sqrt (fma F F 2.0)) -1.0) (sin B))
(/ (- x) (* (fma 0.3333333333333333 (* B B) 1.0) B)))
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-5) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 9.5e-223) {
tmp = fma(F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) * pow(B, -1.0)), (-x / tan(B)));
} else if (F <= 35000.0) {
tmp = fma(F, (pow(sqrt(fma(F, F, 2.0)), -1.0) / sin(B)), (-x / (fma(0.3333333333333333, (B * B), 1.0) * B)));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-5) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 9.5e-223) tmp = fma(F, Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) * (B ^ -1.0)), Float64(Float64(-x) / tan(B))); elseif (F <= 35000.0) tmp = fma(F, Float64((sqrt(fma(F, F, 2.0)) ^ -1.0) / sin(B)), Float64(Float64(-x) / Float64(fma(0.3333333333333333, Float64(B * B), 1.0) * B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-5], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e-223], N[(F * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 35000.0], N[(F * N[(N[Power[N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-223}:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot {B}^{-1}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 35000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\sqrt{\mathsf{fma}\left(F, F, 2\right)}\right)}^{-1}}{\sin B}, \frac{-x}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 59.8%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6498.4
Applied rewrites98.4%
if -6.9999999999999994e-5 < F < 9.49999999999999992e-223Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6488.2
Applied rewrites88.2%
if 9.49999999999999992e-223 < F < 35000Initial program 99.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.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%
Applied rewrites99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6489.9
Applied rewrites89.9%
if 35000 < F Initial program 54.8%
Taylor expanded in F around inf
associate-/l*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification95.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (* (fma 0.3333333333333333 (* B B) 1.0) B))))
(if (<= F -7e-5)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 9.5e-223)
(fma
F
(* (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (pow B -1.0))
(/ (- x) (tan B)))
(if (<= F 2e+125)
(fma F (/ (pow (sqrt (fma F F 2.0)) -1.0) (sin B)) t_0)
(+ t_0 (pow (sin B) -1.0)))))))
double code(double F, double B, double x) {
double t_0 = -x / (fma(0.3333333333333333, (B * B), 1.0) * B);
double tmp;
if (F <= -7e-5) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 9.5e-223) {
tmp = fma(F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) * pow(B, -1.0)), (-x / tan(B)));
} else if (F <= 2e+125) {
tmp = fma(F, (pow(sqrt(fma(F, F, 2.0)), -1.0) / sin(B)), t_0);
} else {
tmp = t_0 + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / Float64(fma(0.3333333333333333, Float64(B * B), 1.0) * B)) tmp = 0.0 if (F <= -7e-5) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 9.5e-223) tmp = fma(F, Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) * (B ^ -1.0)), Float64(Float64(-x) / tan(B))); elseif (F <= 2e+125) tmp = fma(F, Float64((sqrt(fma(F, F, 2.0)) ^ -1.0) / sin(B)), t_0); else tmp = Float64(t_0 + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7e-5], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e-223], N[(F * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+125], N[(F * N[(N[Power[N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision], -1.0], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(t$95$0 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B}\\
\mathbf{if}\;F \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-223}:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot {B}^{-1}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+125}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{{\left(\sqrt{\mathsf{fma}\left(F, F, 2\right)}\right)}^{-1}}{\sin B}, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 59.8%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6498.4
Applied rewrites98.4%
if -6.9999999999999994e-5 < F < 9.49999999999999992e-223Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6488.2
Applied rewrites88.2%
if 9.49999999999999992e-223 < F < 1.9999999999999998e125Initial program 97.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.5
Applied rewrites99.5%
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.9
Applied rewrites84.9%
if 1.9999999999999998e125 < F Initial program 36.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-/.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6476.0
Applied rewrites76.0%
Final simplification87.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -7.8e+136)
(fma F (/ -1.0 (* (fma (* (* B B) F) -0.16666666666666666 F) B)) t_0)
(if (<= F 3.7e-129)
(fma
F
(* (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (pow B -1.0))
t_0)
(if (<= F 5800000.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))
(+
(/ (- x) (* (fma 0.3333333333333333 (* B B) 1.0) B))
(pow (sin B) -1.0)))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -7.8e+136) {
tmp = fma(F, (-1.0 / (fma(((B * B) * F), -0.16666666666666666, F) * B)), t_0);
} else if (F <= 3.7e-129) {
tmp = fma(F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) * pow(B, -1.0)), t_0);
} else if (F <= 5800000.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
} else {
tmp = (-x / (fma(0.3333333333333333, (B * B), 1.0) * B)) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -7.8e+136) tmp = fma(F, Float64(-1.0 / Float64(fma(Float64(Float64(B * B) * F), -0.16666666666666666, F) * B)), t_0); elseif (F <= 3.7e-129) tmp = fma(F, Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) * (B ^ -1.0)), t_0); elseif (F <= 5800000.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); else tmp = Float64(Float64(Float64(-x) / Float64(fma(0.3333333333333333, Float64(B * B), 1.0) * B)) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7.8e+136], N[(F * N[(-1.0 / N[(N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * -0.16666666666666666 + F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 3.7e-129], N[(F * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 5800000.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -7.8 \cdot 10^{+136}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot F, -0.16666666666666666, F\right) \cdot B}, t\_0\right)\\
\mathbf{elif}\;F \leq 3.7 \cdot 10^{-129}:\\
\;\;\;\;\mathsf{fma}\left(F, \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}} \cdot {B}^{-1}, t\_0\right)\\
\mathbf{elif}\;F \leq 5800000:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -7.80000000000000038e136Initial program 40.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites45.8%
Taylor expanded in F around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
Applied rewrites62.3%
if -7.80000000000000038e136 < F < 3.7000000000000002e-129Initial program 96.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-/.f6480.6
Applied rewrites80.6%
if 3.7000000000000002e-129 < F < 5.8e6Initial program 99.3%
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.f6479.8
Applied rewrites79.8%
if 5.8e6 < F Initial program 54.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-/.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6476.3
Applied rewrites76.3%
Final simplification76.2%
(FPCore (F B x)
:precision binary64
(if (<= F -215000000.0)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 5e+38)
(fma F (/ (sqrt (pow (fma F F 2.0) -1.0)) (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -215000000.0) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 5e+38) {
tmp = fma(F, (sqrt(pow(fma(F, F, 2.0), -1.0)) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -215000000.0) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 5e+38) tmp = fma(F, Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -215000000.0], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e+38], N[(F * N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -215000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -2.15e8Initial program 58.7%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2.15e8 < F < 4.9999999999999997e38Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.5
Applied rewrites99.5%
if 4.9999999999999997e38 < F Initial program 50.5%
Taylor expanded in F around inf
associate-/l*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+56)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 5000000.0)
(/
(fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (* (- x) (cos B)))
(sin B))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+56) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 5000000.0) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, (-x * cos(B))) / sin(B);
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+56) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 5000000.0) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(Float64(-x) * cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+56], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5000000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + N[((-x) * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+56}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 5000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, \left(-x\right) \cdot \cos B\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.00000000000000009e56Initial program 52.6%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -1.00000000000000009e56 < F < 5e6Initial program 98.6%
Taylor expanded in B around inf
associate-/l*N/A
fp-cancel-sub-sign-invN/A
associate-*l/N/A
distribute-lft-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
Applied rewrites99.3%
if 5e6 < F Initial program 54.8%
Taylor expanded in F around inf
associate-/l*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))) (t_1 (- (/ x B))))
(if (<= F -9e+26)
(+ t_1 (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F 820.0)
(/
(fma
t_0
F
(-
(*
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B))
x))
B)
(+ t_1 (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0));
double t_1 = -(x / B);
double tmp;
if (F <= -9e+26) {
tmp = t_1 + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= 820.0) {
tmp = fma(t_0, F, ((fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)) * (B * B)) - x)) / B;
} else {
tmp = t_1 + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) t_1 = Float64(-Float64(x / B)) tmp = 0.0 if (F <= -9e+26) tmp = Float64(t_1 + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= 820.0) tmp = Float64(fma(t_0, F, Float64(Float64(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)) * Float64(B * B)) - x)) / B); else tmp = Float64(t_1 + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[F, -9e+26], N[(t$95$1 + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 820.0], N[(N[(t$95$0 * F + N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(t$95$1 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
t_1 := -\frac{x}{B}\\
\mathbf{if}\;F \leq -9 \cdot 10^{+26}:\\
\;\;\;\;t\_1 + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq 820:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_1 + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -8.99999999999999957e26Initial program 56.9%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.6%
Taylor expanded in F around -inf
Applied rewrites51.0%
Taylor expanded in B around 0
lower-/.f6439.6
Applied rewrites39.6%
if -8.99999999999999957e26 < F < 820Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6450.1
Applied rewrites50.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.2%
if 820 < F Initial program 54.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6476.2
Applied rewrites76.2%
Final simplification55.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(if (<= F -5e+18)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F 2.05e+124)
(/
(fma
t_0
F
(-
(*
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B))
x))
B)
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0));
double tmp;
if (F <= -5e+18) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= 2.05e+124) {
tmp = fma(t_0, F, ((fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)) * (B * B)) - x)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) tmp = 0.0 if (F <= -5e+18) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= 2.05e+124) tmp = Float64(fma(t_0, F, Float64(Float64(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)) * Float64(B * B)) - x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -5e+18], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.05e+124], N[(N[(t$95$0 * F + N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+18}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{+124}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5e18Initial program 58.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 rewrites29.8%
Taylor expanded in F around -inf
Applied rewrites49.5%
Taylor expanded in B around 0
lower-/.f6438.5
Applied rewrites38.5%
if -5e18 < F < 2.05000000000000001e124Initial program 98.6%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6449.5
Applied rewrites49.5%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.8%
if 2.05000000000000001e124 < F Initial program 37.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6434.7
Applied rewrites34.7%
Taylor expanded in F around inf
Applied rewrites46.5%
Final simplification46.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+135)
(fma
F
(/ -1.0 (* (fma (* (* B B) F) -0.16666666666666666 F) B))
(/ (- x) (tan B)))
(if (<= F 3.7e-129)
(fma
(/ -1.0 (tan B))
x
(/ (* (sqrt (pow (+ (fma x 2.0 (* F F)) 2.0) -1.0)) F) B))
(if (<= F 5800000.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))
(+
(/ (- x) (* (fma 0.3333333333333333 (* B B) 1.0) B))
(pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+135) {
tmp = fma(F, (-1.0 / (fma(((B * B) * F), -0.16666666666666666, F) * B)), (-x / tan(B)));
} else if (F <= 3.7e-129) {
tmp = fma((-1.0 / tan(B)), x, ((sqrt(pow((fma(x, 2.0, (F * F)) + 2.0), -1.0)) * F) / B));
} else if (F <= 5800000.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
} else {
tmp = (-x / (fma(0.3333333333333333, (B * B), 1.0) * B)) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+135) tmp = fma(F, Float64(-1.0 / Float64(fma(Float64(Float64(B * B) * F), -0.16666666666666666, F) * B)), Float64(Float64(-x) / tan(B))); elseif (F <= 3.7e-129) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(Float64(sqrt((Float64(fma(x, 2.0, Float64(F * F)) + 2.0) ^ -1.0)) * F) / B)); elseif (F <= 5800000.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); else tmp = Float64(Float64(Float64(-x) / Float64(fma(0.3333333333333333, Float64(B * B), 1.0) * B)) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+135], N[(F * N[(-1.0 / N[(N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * -0.16666666666666666 + F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.7e-129], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[Sqrt[N[Power[N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5800000.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{-1}{\mathsf{fma}\left(\left(B \cdot B\right) \cdot F, -0.16666666666666666, F\right) \cdot B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 3.7 \cdot 10^{-129}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{\sqrt{{\left(\mathsf{fma}\left(x, 2, F \cdot F\right) + 2\right)}^{-1}} \cdot F}{B}\right)\\
\mathbf{elif}\;F \leq 5800000:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.95000000000000016e135Initial program 41.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites47.0%
Taylor expanded in F around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
Applied rewrites63.1%
if -1.95000000000000016e135 < F < 3.7000000000000002e-129Initial program 96.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 rewrites64.6%
Taylor expanded in F around -inf
Applied rewrites29.2%
lift-+.f64N/A
Applied rewrites29.2%
Taylor expanded in B around 0
Applied rewrites80.3%
if 3.7000000000000002e-129 < F < 5.8e6Initial program 99.3%
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.f6479.8
Applied rewrites79.8%
if 5.8e6 < F Initial program 54.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-/.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6476.3
Applied rewrites76.3%
Final simplification76.2%
(FPCore (F B x)
:precision binary64
(if (<= F -7.0)
(/ (fma (- x) (cos B) -1.0) (sin B))
(if (<= F 1.4)
(fma F (/ (sqrt 0.5) (sin B)) (/ (- x) (tan B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.0) {
tmp = fma(-x, cos(B), -1.0) / sin(B);
} else if (F <= 1.4) {
tmp = fma(F, (sqrt(0.5) / sin(B)), (-x / tan(B)));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7.0) tmp = Float64(fma(Float64(-x), cos(B), -1.0) / sin(B)); elseif (F <= 1.4) tmp = fma(F, Float64(sqrt(0.5) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7.0], N[(N[((-x) * N[Cos[B], $MachinePrecision] + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $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[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, \cos B, -1\right)}{\sin B}\\
\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 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -7Initial program 58.7%
Taylor expanded in F around -inf
+-commutativeN/A
distribute-lft-inN/A
associate-*r/N/A
associate-*r/N/A
metadata-evalN/A
div-add-revN/A
lower-/.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -7 < F < 1.3999999999999999Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.5
Applied rewrites99.5%
Taylor expanded in F around 0
Applied rewrites98.9%
if 1.3999999999999999 < F Initial program 54.8%
Taylor expanded in F around inf
associate-/l*N/A
fp-cancel-sub-sign-invN/A
distribute-lft-neg-inN/A
associate-/l*N/A
mul-1-negN/A
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.4%
(FPCore (F B x) :precision binary64 (if (or (<= x -7.5e-78) (not (<= x 7.2e-12))) (+ (/ (- x) (tan B)) (pow B -1.0)) (* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -7.5e-78) || !(x <= 7.2e-12)) {
tmp = (-x / tan(B)) + pow(B, -1.0);
} else {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -7.5e-78) || !(x <= 7.2e-12)) tmp = Float64(Float64(Float64(-x) / tan(B)) + (B ^ -1.0)); else tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -7.5e-78], N[Not[LessEqual[x, 7.2e-12]], $MachinePrecision]], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{-78} \lor \neg \left(x \leq 7.2 \cdot 10^{-12}\right):\\
\;\;\;\;\frac{-x}{\tan B} + {B}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\end{array}
\end{array}
if x < -7.50000000000000041e-78 or 7.2e-12 < x Initial program 80.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6485.2
Applied rewrites85.2%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-/.f6485.3
Applied rewrites85.3%
Taylor expanded in B around 0
Applied rewrites86.1%
if -7.50000000000000041e-78 < x < 7.2e-12Initial program 68.9%
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.f6452.8
Applied rewrites52.8%
Final simplification68.0%
(FPCore (F B x)
:precision binary64
(if (<= B 0.14)
(+
(*
(- x)
(/
(fma
(- (* -0.022222222222222223 (* B B)) 0.3333333333333333)
(* B B)
1.0)
B))
(/
(*
(sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))
(fma (* 0.16666666666666666 F) (* B B) F))
B))
(+ (/ (- x) (tan B)) (pow B -1.0))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.14) {
tmp = (-x * (fma(((-0.022222222222222223 * (B * B)) - 0.3333333333333333), (B * B), 1.0) / B)) + ((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * fma((0.16666666666666666 * F), (B * B), F)) / B);
} else {
tmp = (-x / tan(B)) + pow(B, -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.14) tmp = Float64(Float64(Float64(-x) * Float64(fma(Float64(Float64(-0.022222222222222223 * Float64(B * B)) - 0.3333333333333333), Float64(B * B), 1.0) / B)) + Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B)); else tmp = Float64(Float64(Float64(-x) / tan(B)) + (B ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.14], N[(N[((-x) * N[(N[(N[(N[(-0.022222222222222223 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.14:\\
\;\;\;\;\left(-x\right) \cdot \frac{\mathsf{fma}\left(-0.022222222222222223 \cdot \left(B \cdot B\right) - 0.3333333333333333, B \cdot B, 1\right)}{B} + \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B} + {B}^{-1}\\
\end{array}
\end{array}
if B < 0.14000000000000001Initial program 73.3%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/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
lower--.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6453.5
Applied rewrites53.5%
if 0.14000000000000001 < B Initial program 76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6456.8
Applied rewrites56.8%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
distribute-neg-fracN/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-/.f6456.8
Applied rewrites56.8%
Taylor expanded in B around 0
Applied rewrites44.4%
Final simplification51.0%
(FPCore (F B x)
:precision binary64
(if (<= F -7.6e+18)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F 5.4e+100)
(+
(- (/ (fma (* (* B B) x) -0.3333333333333333 x) B))
(/
(*
(sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))
(fma (* 0.16666666666666666 F) (* B B) F))
B))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.6e+18) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= 5.4e+100) {
tmp = -(fma(((B * B) * x), -0.3333333333333333, x) / B) + ((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * fma((0.16666666666666666 * F), (B * B), F)) / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7.6e+18) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= 5.4e+100) tmp = Float64(Float64(-Float64(fma(Float64(Float64(B * B) * x), -0.3333333333333333, x) / B)) + Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * fma(Float64(0.16666666666666666 * F), Float64(B * B), F)) / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7.6e+18], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e+100], N[((-N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision] / B), $MachinePrecision]) + N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.6 \cdot 10^{+18}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{+100}:\\
\;\;\;\;\left(-\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, -0.3333333333333333, x\right)}{B}\right) + \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.6e18Initial program 57.5%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.2%
Taylor expanded in F around -inf
Applied rewrites50.2%
Taylor expanded in B around 0
lower-/.f6439.1
Applied rewrites39.1%
if -7.6e18 < F < 5.39999999999999997e100Initial program 98.6%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites61.6%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.4
Applied rewrites50.4%
if 5.39999999999999997e100 < F Initial program 42.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6433.6
Applied rewrites33.6%
Taylor expanded in F around inf
Applied rewrites44.5%
Final simplification46.0%
(FPCore (F B x)
:precision binary64
(if (<= F -7.6e+18)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F 5.4e+100)
(/
(-
(fma
(sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))
(fma (* 0.16666666666666666 F) (* B B) F)
(* (* 0.3333333333333333 (* B B)) x))
x)
B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.6e+18) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= 5.4e+100) {
tmp = (fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), fma((0.16666666666666666 * F), (B * B), F), ((0.3333333333333333 * (B * B)) * x)) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7.6e+18) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= 5.4e+100) tmp = Float64(Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), fma(Float64(0.16666666666666666 * F), Float64(B * B), F), Float64(Float64(0.3333333333333333 * Float64(B * B)) * x)) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7.6e+18], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e+100], N[(N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[(B * B), $MachinePrecision] + F), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.6 \cdot 10^{+18}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{+100}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, \mathsf{fma}\left(0.16666666666666666 \cdot F, B \cdot B, F\right), \left(0.3333333333333333 \cdot \left(B \cdot B\right)\right) \cdot x\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.6e18Initial program 57.5%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.2%
Taylor expanded in F around -inf
Applied rewrites50.2%
Taylor expanded in B around 0
lower-/.f6439.1
Applied rewrites39.1%
if -7.6e18 < F < 5.39999999999999997e100Initial program 98.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites50.3%
if 5.39999999999999997e100 < F Initial program 42.5%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6433.6
Applied rewrites33.6%
Taylor expanded in F around inf
Applied rewrites44.5%
Final simplification46.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (fma F F 2.0) -1.0))))
(if (<= F -8.8e+18)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F -8e-185)
(/ (* t_0 F) B)
(if (<= F 2.4e-164)
(/ (- x) B)
(if (<= F 32000000000.0) (* t_0 (/ F B)) (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow(fma(F, F, 2.0), -1.0));
double tmp;
if (F <= -8.8e+18) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= -8e-185) {
tmp = (t_0 * F) / B;
} else if (F <= 2.4e-164) {
tmp = -x / B;
} else if (F <= 32000000000.0) {
tmp = t_0 * (F / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((fma(F, F, 2.0) ^ -1.0)) tmp = 0.0 if (F <= -8.8e+18) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= -8e-185) tmp = Float64(Float64(t_0 * F) / B); elseif (F <= 2.4e-164) tmp = Float64(Float64(-x) / B); elseif (F <= 32000000000.0) tmp = Float64(t_0 * Float64(F / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -8.8e+18], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8e-185], N[(N[(t$95$0 * F), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.4e-164], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 32000000000.0], N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{+18}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq -8 \cdot 10^{-185}:\\
\;\;\;\;\frac{t\_0 \cdot F}{B}\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-164}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 32000000000:\\
\;\;\;\;t\_0 \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.8e18Initial program 56.9%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.6%
Taylor expanded in F around -inf
Applied rewrites51.0%
Taylor expanded in B around 0
lower-/.f6439.6
Applied rewrites39.6%
if -8.8e18 < F < -7.9999999999999999e-185Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6453.9
Applied rewrites53.9%
Taylor expanded in x around 0
Applied rewrites38.2%
if -7.9999999999999999e-185 < F < 2.39999999999999983e-164Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6447.3
Applied rewrites47.3%
Taylor expanded in F around 0
Applied rewrites39.6%
if 2.39999999999999983e-164 < F < 3.2e10Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6447.9
Applied rewrites47.9%
Taylor expanded in x around 0
Applied rewrites32.7%
if 3.2e10 < F Initial program 54.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6437.6
Applied rewrites37.6%
Taylor expanded in F around inf
Applied rewrites46.0%
Final simplification40.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (sqrt (pow (fma F F 2.0) -1.0)) (/ F B))))
(if (<= F -8.8e+18)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F -8e-185)
t_0
(if (<= F 2.4e-164)
(/ (- x) B)
(if (<= F 32000000000.0) t_0 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / B);
double tmp;
if (F <= -8.8e+18) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= -8e-185) {
tmp = t_0;
} else if (F <= 2.4e-164) {
tmp = -x / B;
} else if (F <= 32000000000.0) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / B)) tmp = 0.0 if (F <= -8.8e+18) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= -8e-185) tmp = t_0; elseif (F <= 2.4e-164) tmp = Float64(Float64(-x) / B); elseif (F <= 32000000000.0) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.8e+18], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8e-185], t$95$0, If[LessEqual[F, 2.4e-164], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 32000000000.0], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{B}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{+18}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq -8 \cdot 10^{-185}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-164}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 32000000000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.8e18Initial program 56.9%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.6%
Taylor expanded in F around -inf
Applied rewrites51.0%
Taylor expanded in B around 0
lower-/.f6439.6
Applied rewrites39.6%
if -8.8e18 < F < -7.9999999999999999e-185 or 2.39999999999999983e-164 < F < 3.2e10Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6451.4
Applied rewrites51.4%
Taylor expanded in x around 0
Applied rewrites35.9%
if -7.9999999999999999e-185 < F < 2.39999999999999983e-164Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6447.3
Applied rewrites47.3%
Taylor expanded in F around 0
Applied rewrites39.6%
if 3.2e10 < F Initial program 54.2%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6437.6
Applied rewrites37.6%
Taylor expanded in F around inf
Applied rewrites46.0%
Final simplification40.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.02e+121)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F 5000000.0)
(/ (- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.02e+121) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= 5000000.0) {
tmp = ((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.02e+121) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= 5000000.0) tmp = Float64(Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.02e+121], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5000000.0], N[(N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.02 \cdot 10^{+121}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq 5000000:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.02000000000000005e121Initial program 44.5%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites20.0%
Taylor expanded in F around -inf
Applied rewrites49.0%
Taylor expanded in B around 0
lower-/.f6436.8
Applied rewrites36.8%
if -1.02000000000000005e121 < F < 5e6Initial program 97.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6449.6
Applied rewrites49.6%
if 5e6 < F Initial program 54.8%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6437.2
Applied rewrites37.2%
Taylor expanded in F around inf
Applied rewrites45.5%
Final simplification46.0%
(FPCore (F B x)
:precision binary64
(if (<= F -3.3e+30)
(+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B))
(if (<= F 8e+25)
(/ (- (* (sqrt (pow (fma 2.0 x 2.0) -1.0)) F) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e+30) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / B);
} else if (F <= 8e+25) {
tmp = ((sqrt(pow(fma(2.0, x, 2.0), -1.0)) * F) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.3e+30) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / B)); elseif (F <= 8e+25) tmp = Float64(Float64(Float64(sqrt((fma(2.0, x, 2.0) ^ -1.0)) * F) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.3e+30], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e+25], N[(N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.3 \cdot 10^{+30}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{+25}:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}} \cdot F - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.30000000000000026e30Initial program 56.2%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites29.6%
Taylor expanded in F around -inf
Applied rewrites50.2%
Taylor expanded in B around 0
lower-/.f6440.1
Applied rewrites40.1%
if -3.30000000000000026e30 < F < 8.00000000000000072e25Initial program 99.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6449.3
Applied rewrites49.3%
Taylor expanded in F around 0
Applied rewrites49.1%
if 8.00000000000000072e25 < F Initial program 53.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6437.2
Applied rewrites37.2%
Taylor expanded in F around inf
Applied rewrites45.9%
Final simplification45.8%
(FPCore (F B x) :precision binary64 (if (<= F -8e-151) (+ (- (/ x B)) (/ (- (* -0.16666666666666666 (* B B)) 1.0) B)) (if (<= F 3.6e-162) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e-151) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / 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 <= (-8d-151)) then
tmp = -(x / b) + ((((-0.16666666666666666d0) * (b * b)) - 1.0d0) / 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 <= -8e-151) {
tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / 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 <= -8e-151: tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / 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 <= -8e-151) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(Float64(-0.16666666666666666 * Float64(B * B)) - 1.0) / 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 <= -8e-151) tmp = -(x / B) + (((-0.16666666666666666 * (B * B)) - 1.0) / 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, -8e-151], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] / B), $MachinePrecision]), $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 -8 \cdot 10^{-151}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{-0.16666666666666666 \cdot \left(B \cdot B\right) - 1}{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 < -7.9999999999999995e-151Initial program 69.0%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites39.6%
Taylor expanded in F around -inf
Applied rewrites44.7%
Taylor expanded in B around 0
lower-/.f6433.6
Applied rewrites33.6%
if -7.9999999999999995e-151 < F < 3.5999999999999998e-162Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.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
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6440.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites38.7%
(FPCore (F B x) :precision binary64 (if (<= F -5.45e-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 <= -5.45e-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 <= (-5.45d-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 <= -5.45e-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 <= -5.45e-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 <= -5.45e-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 <= -5.45e-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, -5.45e-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 -5.45 \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 < -5.45000000000000033e-151Initial program 69.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6432.4
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites33.4%
if -5.45000000000000033e-151 < F < 3.5999999999999998e-162Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.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
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6440.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites38.7%
(FPCore (F B x) :precision binary64 (if (<= F -5.45e-151) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.45e-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 <= (-5.45d-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 <= -5.45e-151) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.45e-151: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.45e-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 <= -5.45e-151) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.45e-151], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.45 \cdot 10^{-151}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -5.45000000000000033e-151Initial program 69.0%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6432.4
Applied rewrites32.4%
Taylor expanded in F around -inf
Applied rewrites33.4%
if -5.45000000000000033e-151 < F Initial program 77.4%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6444.1
Applied rewrites44.1%
Taylor expanded in F around 0
Applied rewrites29.9%
(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 74.3%
Taylor expanded in B around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.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.f6439.8
Applied rewrites39.8%
Taylor expanded in F around 0
Applied rewrites24.1%
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))))))