
(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
(let* ((t_0 (/ x (tan B))))
(if (<= F -102000000.0)
(- (/ -1.0 (sin B)) (/ (* x (cos B)) (sin B)))
(if (<= F 7e-11)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) 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 <= -102000000.0) {
tmp = (-1.0 / sin(B)) - ((x * cos(B)) / sin(B));
} else if (F <= 7e-11) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - 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 <= -102000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); elseif (F <= 7e-11) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - 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, -102000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-11], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $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 -102000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-11}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.02e8Initial program 56.3%
Taylor expanded in F around -inf
mul-1-negN/A
distribute-neg-inN/A
sub-negN/A
lower--.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -1.02e8 < F < 7.00000000000000038e-11Initial program 99.4%
Applied rewrites99.5%
Applied rewrites99.6%
if 7.00000000000000038e-11 < F Initial program 56.2%
Applied rewrites75.4%
Applied rewrites75.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) (/ -1.0 2.0)))))
(t_1 (fma x 2.0 (fma F F 2.0))))
(if (<= t_0 2e-92)
(- (/ F (* B (sqrt t_1))) (/ x (tan B)))
(if (<= t_0 20.0)
(fma
-1.0
(/ (/ -1.0 (sin B)) (/ (sqrt (fma 2.0 x (fma F F 2.0))) F))
(/ (- x) B))
(if (<= t_0 2e+305)
(fma (/ (sqrt (/ 1.0 t_1)) B) F (/ (- x) (tan B)))
(/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), (-1.0 / 2.0)));
double t_1 = fma(x, 2.0, fma(F, F, 2.0));
double tmp;
if (t_0 <= 2e-92) {
tmp = (F / (B * sqrt(t_1))) - (x / tan(B));
} else if (t_0 <= 20.0) {
tmp = fma(-1.0, ((-1.0 / sin(B)) / (sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)), (-x / B));
} else if (t_0 <= 2e+305) {
tmp = fma((sqrt((1.0 / t_1)) / B), F, (-x / tan(B)));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ Float64(-1.0 / 2.0)))) t_1 = fma(x, 2.0, fma(F, F, 2.0)) tmp = 0.0 if (t_0 <= 2e-92) tmp = Float64(Float64(F / Float64(B * sqrt(t_1))) - Float64(x / tan(B))); elseif (t_0 <= 20.0) tmp = fma(-1.0, Float64(Float64(-1.0 / sin(B)) / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)), Float64(Float64(-x) / B)); elseif (t_0 <= 2e+305) tmp = fma(Float64(sqrt(Float64(1.0 / t_1)) / B), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-92], N[(N[(F / N[(B * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 20.0], N[(-1.0 * N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+305], N[(N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-92}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{t\_1}} - \frac{x}{\tan B}\\
\mathbf{elif}\;t\_0 \leq 20:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{\frac{-1}{\sin B}}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}}, \frac{-x}{B}\right)\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{t\_1}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.99999999999999998e-92Initial program 80.1%
Applied rewrites84.2%
Applied rewrites84.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6468.3
Applied rewrites68.3%
if 1.99999999999999998e-92 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 20Initial program 95.2%
Applied rewrites95.4%
Applied rewrites95.4%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6477.8
Applied rewrites77.8%
if 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.9999999999999999e305Initial program 99.4%
Applied rewrites99.9%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.8
Applied rewrites99.8%
if 1.9999999999999999e305 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 22.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6467.5
Applied rewrites67.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6485.9
Applied rewrites85.9%
Final simplification79.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) (/ -1.0 2.0)))))
(t_1 (fma x 2.0 (fma F F 2.0))))
(if (<= t_0 2e-92)
(- (/ F (* B (sqrt t_1))) (/ x (tan B)))
(if (<= t_0 20.0)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) (/ x B))
(if (<= t_0 2e+305)
(fma (/ (sqrt (/ 1.0 t_1)) B) F (/ (- x) (tan B)))
(/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), (-1.0 / 2.0)));
double t_1 = fma(x, 2.0, fma(F, F, 2.0));
double tmp;
if (t_0 <= 2e-92) {
tmp = (F / (B * sqrt(t_1))) - (x / tan(B));
} else if (t_0 <= 20.0) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - (x / B);
} else if (t_0 <= 2e+305) {
tmp = fma((sqrt((1.0 / t_1)) / B), F, (-x / tan(B)));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ Float64(-1.0 / 2.0)))) t_1 = fma(x, 2.0, fma(F, F, 2.0)) tmp = 0.0 if (t_0 <= 2e-92) tmp = Float64(Float64(F / Float64(B * sqrt(t_1))) - Float64(x / tan(B))); elseif (t_0 <= 20.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - Float64(x / B)); elseif (t_0 <= 2e+305) tmp = fma(Float64(sqrt(Float64(1.0 / t_1)) / B), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-92], N[(N[(F / N[(B * N[Sqrt[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 20.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+305], N[(N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-92}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{t\_1}} - \frac{x}{\tan B}\\
\mathbf{elif}\;t\_0 \leq 20:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{t\_1}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.99999999999999998e-92Initial program 80.1%
Applied rewrites84.2%
Applied rewrites84.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6468.3
Applied rewrites68.3%
if 1.99999999999999998e-92 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 20Initial program 95.2%
Applied rewrites95.4%
Applied rewrites95.2%
Taylor expanded in B around 0
lower-/.f6477.7
Applied rewrites77.7%
if 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.9999999999999999e305Initial program 99.4%
Applied rewrites99.9%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.8
Applied rewrites99.8%
if 1.9999999999999999e305 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 22.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6467.5
Applied rewrites67.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6485.9
Applied rewrites85.9%
Final simplification79.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) (/ -1.0 2.0)))))
(t_1 (- (/ F (* B (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x (tan B)))))
(if (<= t_0 2e-92)
t_1
(if (<= t_0 20.0)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) (/ x B))
(if (<= t_0 2e+305) t_1 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), (-1.0 / 2.0)));
double t_1 = (F / (B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / tan(B));
double tmp;
if (t_0 <= 2e-92) {
tmp = t_1;
} else if (t_0 <= 20.0) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - (x / B);
} else if (t_0 <= 2e+305) {
tmp = t_1;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ Float64(-1.0 / 2.0)))) t_1 = Float64(Float64(F / Float64(B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / tan(B))) tmp = 0.0 if (t_0 <= 2e-92) tmp = t_1; elseif (t_0 <= 20.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - Float64(x / B)); elseif (t_0 <= 2e+305) tmp = t_1; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(F / N[(B * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 2e-92], t$95$1, If[LessEqual[t$95$0, 20.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+305], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \frac{F}{B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
\mathbf{if}\;t\_0 \leq 2 \cdot 10^{-92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 20:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.99999999999999998e-92 or 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.9999999999999999e305Initial program 85.9%
Applied rewrites88.9%
Applied rewrites88.9%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6477.7
Applied rewrites77.7%
if 1.99999999999999998e-92 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 20Initial program 95.2%
Applied rewrites95.4%
Applied rewrites95.2%
Taylor expanded in B around 0
lower-/.f6477.7
Applied rewrites77.7%
if 1.9999999999999999e305 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 22.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6467.5
Applied rewrites67.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6485.9
Applied rewrites85.9%
Final simplification79.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ F (* B (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x (tan B))))
(t_1 (/ F (sin B)))
(t_2
(+
(* x (/ -1.0 (tan B)))
(* t_1 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) (/ -1.0 2.0))))))
(if (<= t_2 2e-84)
t_0
(if (<= t_2 20.0)
(* t_1 (sqrt (/ 1.0 (fma F F 2.0))))
(if (<= t_2 2e+305) t_0 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (F / (B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / tan(B));
double t_1 = F / sin(B);
double t_2 = (x * (-1.0 / tan(B))) + (t_1 * pow(((2.0 + (F * F)) + (x * 2.0)), (-1.0 / 2.0)));
double tmp;
if (t_2 <= 2e-84) {
tmp = t_0;
} else if (t_2 <= 20.0) {
tmp = t_1 * sqrt((1.0 / fma(F, F, 2.0)));
} else if (t_2 <= 2e+305) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / Float64(B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / tan(B))) t_1 = Float64(F / sin(B)) t_2 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_1 * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_2 <= 2e-84) tmp = t_0; elseif (t_2 <= 20.0) tmp = Float64(t_1 * sqrt(Float64(1.0 / fma(F, F, 2.0)))); elseif (t_2 <= 2e+305) 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[(F / N[(B * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 2e-84], t$95$0, If[LessEqual[t$95$2, 20.0], N[(t$95$1 * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+305], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_2 \leq 2 \cdot 10^{-84}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 20:\\
\;\;\;\;t\_1 \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 2.0000000000000001e-84 or 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.9999999999999999e305Initial program 85.9%
Applied rewrites88.9%
Applied rewrites89.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6477.3
Applied rewrites77.3%
if 2.0000000000000001e-84 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 20Initial program 95.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6466.6
Applied rewrites66.6%
if 1.9999999999999999e305 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 22.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6467.5
Applied rewrites67.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6485.9
Applied rewrites85.9%
Final simplification77.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -102000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7e-11)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) 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 <= -102000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7e-11) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - 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 <= -102000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7e-11) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - 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, -102000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7e-11], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $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 -102000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-11}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.02e8Initial program 56.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-tan.f64N/A
associate-*r/N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6499.7
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
remove-double-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
remove-double-neg99.8
Applied rewrites99.8%
if -1.02e8 < F < 7.00000000000000038e-11Initial program 99.4%
Applied rewrites99.5%
Applied rewrites99.6%
if 7.00000000000000038e-11 < F Initial program 56.2%
Applied rewrites75.4%
Applied rewrites75.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.85)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7e-11)
(- (/ F (* (sin B) (sqrt (fma x 2.0 2.0)))) 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 <= -1.85) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7e-11) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, 2.0)))) - 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 <= -1.85) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7e-11) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, 2.0)))) - 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, -1.85], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7e-11], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $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 -1.85:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-11}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.8500000000000001Initial program 57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.9
Applied rewrites98.9%
lift-tan.f64N/A
associate-*r/N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6498.9
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
remove-double-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
remove-double-neg99.0
Applied rewrites99.0%
if -1.8500000000000001 < F < 7.00000000000000038e-11Initial program 99.4%
Applied rewrites99.5%
Applied rewrites99.6%
Taylor expanded in F around 0
lower-*.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.9
Applied rewrites98.9%
if 7.00000000000000038e-11 < F Initial program 56.2%
Applied rewrites75.4%
Applied rewrites75.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -490000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -5.5e-102)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) (/ x B))
(if (<= F 3.9e-16)
(- (/ F (* B (sqrt (fma x 2.0 (fma F F 2.0))))) 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 <= -490000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -5.5e-102) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - (x / B);
} else if (F <= 3.9e-16) {
tmp = (F / (B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - 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 <= -490000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -5.5e-102) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - Float64(x / B)); elseif (F <= 3.9e-16) tmp = Float64(Float64(F / Float64(B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - 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, -490000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.5e-102], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e-16], N[(N[(F / N[(B * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $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 -490000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -5.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.9e5Initial program 56.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-tan.f64N/A
associate-*r/N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6499.7
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
remove-double-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
remove-double-neg99.8
Applied rewrites99.8%
if -4.9e5 < F < -5.4999999999999997e-102Initial program 99.3%
Applied rewrites99.3%
Applied rewrites99.8%
Taylor expanded in B around 0
lower-/.f6486.7
Applied rewrites86.7%
if -5.4999999999999997e-102 < F < 3.89999999999999977e-16Initial program 99.5%
Applied rewrites99.6%
Applied rewrites99.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6490.5
Applied rewrites90.5%
if 3.89999999999999977e-16 < F Initial program 56.7%
Applied rewrites75.7%
Applied rewrites75.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6498.8
Applied rewrites98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma 2.0 x (fma F F 2.0))))
(t_1 (/ -1.0 (sin B)))
(t_2 (/ x (tan B)))
(t_3 (- (/ F (* B (sqrt (fma x 2.0 (fma F F 2.0))))) t_2)))
(if (<= F -490000.0)
(- t_1 t_2)
(if (<= F -5.5e-102)
(- (/ F (* (sin B) t_0)) (/ x B))
(if (<= F 3e-126)
t_3
(if (<= F 1e+120) (fma -1.0 (/ t_1 (/ t_0 F)) (/ (- x) B)) t_3))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0)));
double t_1 = -1.0 / sin(B);
double t_2 = x / tan(B);
double t_3 = (F / (B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - t_2;
double tmp;
if (F <= -490000.0) {
tmp = t_1 - t_2;
} else if (F <= -5.5e-102) {
tmp = (F / (sin(B) * t_0)) - (x / B);
} else if (F <= 3e-126) {
tmp = t_3;
} else if (F <= 1e+120) {
tmp = fma(-1.0, (t_1 / (t_0 / F)), (-x / B));
} else {
tmp = t_3;
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(2.0, x, fma(F, F, 2.0))) t_1 = Float64(-1.0 / sin(B)) t_2 = Float64(x / tan(B)) t_3 = Float64(Float64(F / Float64(B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - t_2) tmp = 0.0 if (F <= -490000.0) tmp = Float64(t_1 - t_2); elseif (F <= -5.5e-102) tmp = Float64(Float64(F / Float64(sin(B) * t_0)) - Float64(x / B)); elseif (F <= 3e-126) tmp = t_3; elseif (F <= 1e+120) tmp = fma(-1.0, Float64(t_1 / Float64(t_0 / F)), Float64(Float64(-x) / B)); else tmp = t_3; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(F / N[(B * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[F, -490000.0], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[F, -5.5e-102], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3e-126], t$95$3, If[LessEqual[F, 1e+120], N[(-1.0 * N[(t$95$1 / N[(t$95$0 / F), $MachinePrecision]), $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\\
t_1 := \frac{-1}{\sin B}\\
t_2 := \frac{x}{\tan B}\\
t_3 := \frac{F}{B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_2\\
\mathbf{if}\;F \leq -490000:\\
\;\;\;\;t\_1 - t\_2\\
\mathbf{elif}\;F \leq -5.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{F}{\sin B \cdot t\_0} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-126}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;F \leq 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{t\_1}{\frac{t\_0}{F}}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if F < -4.9e5Initial program 56.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-tan.f64N/A
associate-*r/N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6499.7
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
remove-double-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
remove-double-neg99.8
Applied rewrites99.8%
if -4.9e5 < F < -5.4999999999999997e-102Initial program 99.3%
Applied rewrites99.3%
Applied rewrites99.8%
Taylor expanded in B around 0
lower-/.f6486.7
Applied rewrites86.7%
if -5.4999999999999997e-102 < F < 3.0000000000000002e-126 or 9.9999999999999998e119 < F Initial program 77.8%
Applied rewrites84.6%
Applied rewrites84.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6480.2
Applied rewrites80.2%
if 3.0000000000000002e-126 < F < 9.9999999999999998e119Initial program 85.4%
Applied rewrites99.6%
Applied rewrites99.7%
Taylor expanded in B around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6491.4
Applied rewrites91.4%
(FPCore (F B x)
:precision binary64
(if (<= B 1.4e-5)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma (* B B) (* F 0.16666666666666666) F)
(fma x (* (* B B) 0.3333333333333333) (- x)))
B)
(-
(/
-1.0
(fma
(fma B (* B 0.008333333333333333) -0.16666666666666666)
(* B (* B B))
B))
(/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.4e-5) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma((B * B), (F * 0.16666666666666666), F), fma(x, ((B * B) * 0.3333333333333333), -x)) / B;
} else {
tmp = (-1.0 / fma(fma(B, (B * 0.008333333333333333), -0.16666666666666666), (B * (B * B)), B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 1.4e-5) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(Float64(B * B), Float64(F * 0.16666666666666666), F), fma(x, Float64(Float64(B * B) * 0.3333333333333333), Float64(-x))) / B); else tmp = Float64(Float64(-1.0 / fma(fma(B, Float64(B * 0.008333333333333333), -0.16666666666666666), Float64(B * Float64(B * B)), B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 1.4e-5], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(F * 0.16666666666666666), $MachinePrecision] + F), $MachinePrecision] + N[(x * N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[(N[(B * N[(B * 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(B * N[(B * B), $MachinePrecision]), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, F \cdot 0.16666666666666666, F\right), \mathsf{fma}\left(x, \left(B \cdot B\right) \cdot 0.3333333333333333, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(\mathsf{fma}\left(B, B \cdot 0.008333333333333333, -0.16666666666666666\right), B \cdot \left(B \cdot B\right), B\right)} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 1.39999999999999998e-5Initial program 72.2%
Taylor expanded in B around 0
Applied rewrites63.5%
if 1.39999999999999998e-5 < B Initial program 86.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6458.5
Applied rewrites58.5%
lift-tan.f64N/A
associate-*r/N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6458.5
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
remove-double-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
remove-double-neg58.6
Applied rewrites58.6%
Taylor expanded in B around 0
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
*-lft-identityN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
unpow2N/A
associate-*l*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6455.3
Applied rewrites55.3%
Final simplification61.6%
(FPCore (F B x)
:precision binary64
(if (<= B 1.4e-5)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma (* B B) (* F 0.16666666666666666) F)
(fma x (* (* B B) 0.3333333333333333) (- x)))
B)
(- (/ -1.0 (fma B (* (* B B) -0.16666666666666666) B)) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.4e-5) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma((B * B), (F * 0.16666666666666666), F), fma(x, ((B * B) * 0.3333333333333333), -x)) / B;
} else {
tmp = (-1.0 / fma(B, ((B * B) * -0.16666666666666666), B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 1.4e-5) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(Float64(B * B), Float64(F * 0.16666666666666666), F), fma(x, Float64(Float64(B * B) * 0.3333333333333333), Float64(-x))) / B); else tmp = Float64(Float64(-1.0 / fma(B, Float64(Float64(B * B) * -0.16666666666666666), B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 1.4e-5], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(F * 0.16666666666666666), $MachinePrecision] + F), $MachinePrecision] + N[(x * N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, F \cdot 0.16666666666666666, F\right), \mathsf{fma}\left(x, \left(B \cdot B\right) \cdot 0.3333333333333333, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 1.39999999999999998e-5Initial program 72.2%
Taylor expanded in B around 0
Applied rewrites63.5%
if 1.39999999999999998e-5 < B Initial program 86.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6458.5
Applied rewrites58.5%
lift-tan.f64N/A
associate-*r/N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6458.5
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
remove-double-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
remove-double-neg58.6
Applied rewrites58.6%
Taylor expanded in B around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6455.4
Applied rewrites55.4%
Final simplification61.6%
(FPCore (F B x)
:precision binary64
(if (<= B 8.2e-5)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma (* B B) (* F 0.16666666666666666) F)
(fma x (* (* B B) 0.3333333333333333) (- x)))
B)
(- (/ -1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 8.2e-5) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma((B * B), (F * 0.16666666666666666), F), fma(x, ((B * B) * 0.3333333333333333), -x)) / B;
} else {
tmp = (-1.0 / B) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 8.2e-5) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(Float64(B * B), Float64(F * 0.16666666666666666), F), fma(x, Float64(Float64(B * B) * 0.3333333333333333), Float64(-x))) / B); else tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 8.2e-5], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(F * 0.16666666666666666), $MachinePrecision] + F), $MachinePrecision] + N[(x * N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] + (-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}
\mathbf{if}\;B \leq 8.2 \cdot 10^{-5}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, F \cdot 0.16666666666666666, F\right), \mathsf{fma}\left(x, \left(B \cdot B\right) \cdot 0.3333333333333333, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 8.20000000000000009e-5Initial program 72.4%
Taylor expanded in B around 0
Applied rewrites63.7%
if 8.20000000000000009e-5 < B Initial program 86.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6457.8
Applied rewrites57.8%
lift-tan.f64N/A
associate-*r/N/A
associate-*r/N/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6457.8
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
remove-double-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
remove-double-neg57.9
Applied rewrites57.9%
Taylor expanded in B around 0
lower-/.f6445.0
Applied rewrites45.0%
Final simplification59.4%
(FPCore (F B x)
:precision binary64
(if (<= F -6.6e+73)
(/ (- -1.0 x) B)
(if (<= F -700.0)
(/ -1.0 (sin B))
(if (<= F 3.9e-16)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) B)
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e+73) {
tmp = (-1.0 - x) / B;
} else if (F <= -700.0) {
tmp = -1.0 / sin(B);
} else if (F <= 3.9e-16) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.6e+73) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -700.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3.9e-16) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.6e+73], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -700.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e-16], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{+73}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -700:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.60000000000000061e73Initial program 45.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.0
Applied rewrites40.0%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6458.5
Applied rewrites58.5%
if -6.60000000000000061e73 < F < -700Initial program 93.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6496.5
Applied rewrites96.5%
Taylor expanded in x around 0
lower-/.f64N/A
lower-sin.f6468.6
Applied rewrites68.6%
if -700 < F < 3.89999999999999977e-16Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6463.2
Applied rewrites63.2%
if 3.89999999999999977e-16 < F Initial program 56.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6457.9
Applied rewrites57.9%
(FPCore (F B x)
:precision binary64
(if (<= F -720.0)
(- (/ -1.0 (fma B (* (* B B) -0.16666666666666666) B)) (/ x B))
(if (<= F 3.9e-16)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -720.0) {
tmp = (-1.0 / fma(B, ((B * B) * -0.16666666666666666), B)) - (x / B);
} else if (F <= 3.9e-16) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -720.0) tmp = Float64(Float64(-1.0 / fma(B, Float64(Float64(B * B) * -0.16666666666666666), B)) - Float64(x / B)); elseif (F <= 3.9e-16) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -720.0], N[(N[(-1.0 / N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e-16], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -720:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -720Initial program 57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.9
Applied rewrites98.9%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6477.2
Applied rewrites77.2%
Taylor expanded in B around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
if -720 < F < 3.89999999999999977e-16Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6463.2
Applied rewrites63.2%
if 3.89999999999999977e-16 < F Initial program 56.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6457.9
Applied rewrites57.9%
Final simplification58.4%
(FPCore (F B x)
:precision binary64
(if (<= F -720.0)
(- (/ -1.0 (fma B (* (* B B) -0.16666666666666666) B)) (/ x B))
(if (<= F 1.62e+165)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -720.0) {
tmp = (-1.0 / fma(B, ((B * B) * -0.16666666666666666), B)) - (x / B);
} else if (F <= 1.62e+165) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -720.0) tmp = Float64(Float64(-1.0 / fma(B, Float64(Float64(B * B) * -0.16666666666666666), B)) - Float64(x / B)); elseif (F <= 1.62e+165) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -720.0], N[(N[(-1.0 / N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.62e+165], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -720:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.62 \cdot 10^{+165}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -720Initial program 57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.9
Applied rewrites98.9%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6477.2
Applied rewrites77.2%
Taylor expanded in B around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6450.9
Applied rewrites50.9%
if -720 < F < 1.61999999999999993e165Initial program 93.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6462.5
Applied rewrites62.5%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6462.5
Applied rewrites62.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6462.5
Applied rewrites62.5%
if 1.61999999999999993e165 < F Initial program 33.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6423.7
Applied rewrites23.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6454.7
Applied rewrites54.7%
Final simplification58.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1920000.0)
(/
(fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) (- -1.0 x))
B)
(if (<= F 1.62e+165)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1920000.0) {
tmp = fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), (-1.0 - x)) / B;
} else if (F <= 1.62e+165) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1920000.0) tmp = Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), Float64(-1.0 - x)) / B); elseif (F <= 1.62e+165) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1920000.0], N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.62e+165], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1920000:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1.62 \cdot 10^{+165}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.92e6Initial program 56.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6451.5
Applied rewrites51.5%
if -1.92e6 < F < 1.61999999999999993e165Initial program 93.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6462.1
Applied rewrites62.1%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6462.1
Applied rewrites62.1%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6462.1
Applied rewrites62.1%
if 1.61999999999999993e165 < F Initial program 33.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6423.7
Applied rewrites23.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6454.7
Applied rewrites54.7%
(FPCore (F B x)
:precision binary64
(if (<= F -750.0)
(/
(fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) (- -1.0 x))
B)
(if (<= F 3.9e-16)
(/ (- (/ F (sqrt (fma 2.0 x 2.0))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -750.0) {
tmp = fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), (-1.0 - x)) / B;
} else if (F <= 3.9e-16) {
tmp = ((F / sqrt(fma(2.0, x, 2.0))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -750.0) tmp = Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), Float64(-1.0 - x)) / B); elseif (F <= 3.9e-16) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, 2.0))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -750.0], N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.9e-16], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -750:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -750Initial program 56.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6451.5
Applied rewrites51.5%
if -750 < F < 3.89999999999999977e-16Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6462.7
Applied rewrites62.7%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6462.7
Applied rewrites62.7%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
lower-fma.f6462.0
Applied rewrites62.0%
if 3.89999999999999977e-16 < F Initial program 56.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6457.9
Applied rewrites57.9%
(FPCore (F B x)
:precision binary64
(if (<= F -6e-62)
(/
(fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) (- -1.0 x))
B)
(if (<= F 4e-83) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-62) {
tmp = fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), (-1.0 - x)) / B;
} else if (F <= 4e-83) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6e-62) tmp = Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), Float64(-1.0 - x)) / B); elseif (F <= 4e-83) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6e-62], N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e-83], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-62}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.0000000000000002e-62Initial program 64.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6488.5
Applied rewrites88.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6447.6
Applied rewrites47.6%
if -6.0000000000000002e-62 < F < 4.0000000000000001e-83Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6459.7
Applied rewrites59.7%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6446.1
Applied rewrites46.1%
if 4.0000000000000001e-83 < F Initial program 61.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6446.4
Applied rewrites46.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6454.1
Applied rewrites54.1%
(FPCore (F B x) :precision binary64 (if (<= F -6e-62) (/ (fma B (* B -0.16666666666666666) (- -1.0 x)) B) (if (<= F 4e-83) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-62) {
tmp = fma(B, (B * -0.16666666666666666), (-1.0 - x)) / B;
} else if (F <= 4e-83) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6e-62) tmp = Float64(fma(B, Float64(B * -0.16666666666666666), Float64(-1.0 - x)) / B); elseif (F <= 4e-83) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6e-62], N[(N[(B * N[(B * -0.16666666666666666), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e-83], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-62}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B, B \cdot -0.16666666666666666, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.0000000000000002e-62Initial program 64.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6488.5
Applied rewrites88.5%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6470.2
Applied rewrites70.2%
Taylor expanded in B around 0
lower-/.f64N/A
+-commutativeN/A
associate--l+N/A
*-commutativeN/A
sub-negN/A
mul-1-negN/A
distribute-neg-inN/A
+-commutativeN/A
unpow2N/A
associate-*l*N/A
lower-fma.f64N/A
lower-*.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6447.5
Applied rewrites47.5%
if -6.0000000000000002e-62 < F < 4.0000000000000001e-83Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6459.7
Applied rewrites59.7%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6446.1
Applied rewrites46.1%
if 4.0000000000000001e-83 < F Initial program 61.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6446.4
Applied rewrites46.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6454.1
Applied rewrites54.1%
(FPCore (F B x) :precision binary64 (if (<= F -6e-62) (/ (- -1.0 x) B) (if (<= F 4e-83) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-62) {
tmp = (-1.0 - x) / B;
} else if (F <= 4e-83) {
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 <= (-6d-62)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4d-83) 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 <= -6e-62) {
tmp = (-1.0 - x) / B;
} else if (F <= 4e-83) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-62: tmp = (-1.0 - x) / B elif F <= 4e-83: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-62) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4e-83) 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 <= -6e-62) tmp = (-1.0 - x) / B; elseif (F <= 4e-83) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-62], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e-83], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-62}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.0000000000000002e-62Initial program 64.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.8
Applied rewrites43.8%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6447.4
Applied rewrites47.4%
if -6.0000000000000002e-62 < F < 4.0000000000000001e-83Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6459.7
Applied rewrites59.7%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6446.1
Applied rewrites46.1%
if 4.0000000000000001e-83 < F Initial program 61.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6446.4
Applied rewrites46.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6454.1
Applied rewrites54.1%
(FPCore (F B x) :precision binary64 (if (<= F -6e-62) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-62) {
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 <= (-6d-62)) 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 <= -6e-62) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-62: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-62) 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 <= -6e-62) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-62], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6 \cdot 10^{-62}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -6.0000000000000002e-62Initial program 64.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.8
Applied rewrites43.8%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6447.4
Applied rewrites47.4%
if -6.0000000000000002e-62 < F Initial program 80.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6453.1
Applied rewrites53.1%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6435.8
Applied rewrites35.8%
(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 75.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6450.3
Applied rewrites50.3%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6433.0
Applied rewrites33.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 75.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6450.3
Applied rewrites50.3%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6430.6
Applied rewrites30.6%
Taylor expanded in x around 0
lower-/.f649.5
Applied rewrites9.5%
herbie shell --seed 2024216
(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))))))