
(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 22 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 (/ 1.0 (sin B))) (t_1 (- (/ x (tan B)))))
(if (<= F -2e+42)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 110000000.0)
(fma t_0 (* F (pow (fma 2.0 x (fma F F 2.0)) -0.5)) t_1)
(fma t_0 1.0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / tan(B));
double tmp;
if (F <= -2e+42) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 110000000.0) {
tmp = fma(t_0, (F * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (F <= -2e+42) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 110000000.0) tmp = fma(t_0, Float64(F * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -2e+42], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 110000000.0], N[(t$95$0 * N[(F * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+42}:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 110000000:\\
\;\;\;\;\mathsf{fma}\left(t\_0, F \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
\end{array}
if F < -2.00000000000000009e42Initial program 60.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites72.0%
Applied rewrites72.3%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -2.00000000000000009e42 < F < 1.1e8Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
if 1.1e8 < F Initial program 64.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.2%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) (/ -1.0 2.0)))))
(t_1
(fma
(/
1.0
(*
(sqrt (fma F F (fma 2.0 x 2.0)))
(fma B (* (* B B) -0.16666666666666666) B)))
F
(- (/ x (tan B))))))
(if (<= t_0 -5e+19)
t_1
(if (<= t_0 10.0)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
(if (<= t_0 2e+284) 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)) + (2.0 * x)), (-1.0 / 2.0)));
double t_1 = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, -(x / tan(B)));
double tmp;
if (t_0 <= -5e+19) {
tmp = t_1;
} else if (t_0 <= 10.0) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
} else if (t_0 <= 2e+284) {
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(2.0 * x)) ^ Float64(-1.0 / 2.0)))) t_1 = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, Float64(-Float64(x / tan(B)))) tmp = 0.0 if (t_0 <= -5e+19) tmp = t_1; elseif (t_0 <= 10.0) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B)); elseif (t_0 <= 2e+284) 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[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]}, If[LessEqual[t$95$0, -5e+19], t$95$1, If[LessEqual[t$95$0, 10.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+284], 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) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\
\mathbf{if}\;t\_0 \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 10:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;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)))))) < -5e19 or 10 < (+.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.00000000000000016e284Initial program 97.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites98.5%
Applied rewrites98.6%
Taylor expanded in B around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6498.6
Applied rewrites98.6%
if -5e19 < (+.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)))))) < 10Initial program 83.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites83.9%
Applied rewrites83.6%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6457.3
Applied rewrites57.3%
if 2.00000000000000016e284 < (+.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 23.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.f6453.8
Applied rewrites53.8%
Taylor expanded in F around -inf
Applied rewrites81.7%
Final simplification81.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1
(+
t_0
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) (/ -1.0 2.0)))))
(t_2 (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))))
(t_3 (+ t_0 (* t_2 (/ F B)))))
(if (<= t_1 -5e+19)
t_3
(if (<= t_1 10.0)
(/ (fma F t_2 (- x)) (sin B))
(if (<= t_1 2e+284) t_3 (/ (- -1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = t_0 + ((F / sin(B)) * pow(((2.0 + (F * F)) + (2.0 * x)), (-1.0 / 2.0)));
double t_2 = sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))));
double t_3 = t_0 + (t_2 * (F / B));
double tmp;
if (t_1 <= -5e+19) {
tmp = t_3;
} else if (t_1 <= 10.0) {
tmp = fma(F, t_2, -x) / sin(B);
} else if (t_1 <= 2e+284) {
tmp = t_3;
} else {
tmp = (-1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) t_2 = sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) t_3 = Float64(t_0 + Float64(t_2 * Float64(F / B))) tmp = 0.0 if (t_1 <= -5e+19) tmp = t_3; elseif (t_1 <= 10.0) tmp = Float64(fma(F, t_2, Float64(-x)) / sin(B)); elseif (t_1 <= 2e+284) tmp = t_3; else tmp = Float64(Float64(-1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(t$95$2 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+19], t$95$3, If[LessEqual[t$95$1, 10.0], N[(N[(F * t$95$2 + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+284], t$95$3, N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := t\_0 + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
t_3 := t\_0 + t\_2 \cdot \frac{F}{B}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_2, -x\right)}{\sin B}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+284}:\\
\;\;\;\;t\_3\\
\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)))))) < -5e19 or 10 < (+.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.00000000000000016e284Initial program 97.7%
Taylor expanded in B around 0
*-commutativeN/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.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
if -5e19 < (+.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)))))) < 10Initial program 83.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites83.9%
Applied rewrites83.6%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6457.3
Applied rewrites57.3%
if 2.00000000000000016e284 < (+.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 23.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.f6453.8
Applied rewrites53.8%
Taylor expanded in F around -inf
Applied rewrites81.7%
Final simplification81.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (- (/ x (tan B)))))
(if (<= F -3.35e+40)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 2000000.0)
(fma F (* t_0 (pow (fma 2.0 x (fma F F 2.0)) -0.5)) t_1)
(fma t_0 1.0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = -(x / tan(B));
double tmp;
if (F <= -3.35e+40) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 2000000.0) {
tmp = fma(F, (t_0 * pow(fma(2.0, x, fma(F, F, 2.0)), -0.5)), t_1);
} else {
tmp = fma(t_0, 1.0, t_1);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (F <= -3.35e+40) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 2000000.0) tmp = fma(F, Float64(t_0 * (fma(2.0, x, fma(F, F, 2.0)) ^ -0.5)), t_1); else tmp = fma(t_0, 1.0, t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -3.35e+40], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2000000.0], N[(F * N[(t$95$0 * N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$0 * 1.0 + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := -\frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.35 \cdot 10^{+40}:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 2000000:\\
\;\;\;\;\mathsf{fma}\left(F, t\_0 \cdot {\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, 1, t\_1\right)\\
\end{array}
\end{array}
if F < -3.35000000000000011e40Initial program 60.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites72.0%
Applied rewrites72.3%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -3.35000000000000011e40 < F < 2e6Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
if 2e6 < F Initial program 64.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.2%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= F -300000000.0)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 2000000.0)
(fma (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) F t_0)
(fma (/ 1.0 (sin B)) 1.0 t_0)))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (F <= -300000000.0) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 2000000.0) {
tmp = fma((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), F, t_0);
} else {
tmp = fma((1.0 / sin(B)), 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (F <= -300000000.0) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 2000000.0) tmp = fma(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, t_0); else tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -300000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2000000.0], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;F \leq -300000000:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 2000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
\end{array}
\end{array}
if F < -3e8Initial program 64.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.9%
Applied rewrites75.1%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -3e8 < F < 2e6Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.7%
if 2e6 < F Initial program 64.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.2%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= F -450000000.0)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 2000000.0)
(fma (/ 1.0 (* (sin B) (sqrt (fma F F (fma 2.0 x 2.0))))) F t_0)
(fma (/ 1.0 (sin B)) 1.0 t_0)))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (F <= -450000000.0) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 2000000.0) {
tmp = fma((1.0 / (sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))), F, t_0);
} else {
tmp = fma((1.0 / sin(B)), 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (F <= -450000000.0) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 2000000.0) tmp = fma(Float64(1.0 / Float64(sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))), F, t_0); else tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -450000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2000000.0], N[(N[(1.0 / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;F \leq -450000000:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 2000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
\end{array}
\end{array}
if F < -4.5e8Initial program 64.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.9%
Applied rewrites75.1%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -4.5e8 < F < 2e6Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.6%
if 2e6 < F Initial program 64.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.2%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))))
(if (<= F -1e+155)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1e+41)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) t_0) (sin B))
(fma (/ 1.0 (sin B)) 1.0 (- (/ x (tan B))))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double tmp;
if (F <= -1e+155) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1e+41) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - t_0) / sin(B);
} else {
tmp = fma((1.0 / sin(B)), 1.0, -(x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * cos(B)) tmp = 0.0 if (F <= -1e+155) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1e+41) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - t_0) / sin(B)); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(-Float64(x / tan(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+155], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+41], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
\mathbf{if}\;F \leq -1 \cdot 10^{+155}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+41}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -\frac{x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -1.00000000000000001e155Initial program 37.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites46.6%
Applied rewrites46.6%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -1.00000000000000001e155 < F < 1.00000000000000001e41Initial program 96.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.5%
if 1.00000000000000001e41 < F Initial program 60.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites69.3%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))))
(if (<= F -1e+155)
(/ (- -1.0 t_0) (sin B))
(if (<= F 1e+41)
(/ (- (/ F (sqrt (fma F F 2.0))) t_0) (sin B))
(fma (/ 1.0 (sin B)) 1.0 (- (/ x (tan B))))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double tmp;
if (F <= -1e+155) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 1e+41) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - t_0) / sin(B);
} else {
tmp = fma((1.0 / sin(B)), 1.0, -(x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * cos(B)) tmp = 0.0 if (F <= -1e+155) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 1e+41) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - t_0) / sin(B)); else tmp = fma(Float64(1.0 / sin(B)), 1.0, Float64(-Float64(x / tan(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+155], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+41], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
\mathbf{if}\;F \leq -1 \cdot 10^{+155}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+41}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, -\frac{x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -1.00000000000000001e155Initial program 37.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites46.6%
Applied rewrites46.6%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -1.00000000000000001e155 < F < 1.00000000000000001e41Initial program 96.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.5%
Taylor expanded in x around 0
+-commutativeN/A
unpow2N/A
lower-fma.f6498.9
Applied rewrites98.9%
if 1.00000000000000001e41 < F Initial program 60.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites69.3%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= F -265000000.0)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 6.5e-78)
(fma
(/
1.0
(*
(sqrt (fma F F (fma 2.0 x 2.0)))
(fma B (* (* B B) -0.16666666666666666) B)))
F
t_0)
(if (<= F 1300000.0)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
(fma (/ 1.0 (sin B)) 1.0 t_0))))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (F <= -265000000.0) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 6.5e-78) {
tmp = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, t_0);
} else if (F <= 1300000.0) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
} else {
tmp = fma((1.0 / sin(B)), 1.0, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (F <= -265000000.0) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 6.5e-78) tmp = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, t_0); elseif (F <= 1300000.0) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B)); else tmp = fma(Float64(1.0 / sin(B)), 1.0, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[F, -265000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-78], N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], If[LessEqual[F, 1300000.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * 1.0 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;F \leq -265000000:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, t\_0\right)\\
\mathbf{elif}\;F \leq 1300000:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sin B}, 1, t\_0\right)\\
\end{array}
\end{array}
if F < -2.65e8Initial program 64.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.9%
Applied rewrites75.1%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -2.65e8 < F < 6.5000000000000003e-78Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Applied rewrites99.6%
Taylor expanded in B around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6485.7
Applied rewrites85.7%
if 6.5000000000000003e-78 < F < 1.3e6Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.4%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6489.0
Applied rewrites89.0%
if 1.3e6 < F Initial program 64.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.2%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification93.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (cos B))))
(if (<= F -265000000.0)
(/ (- -1.0 t_0) (sin B))
(if (<= F 6.5e-78)
(fma
(/
1.0
(*
(sqrt (fma F F (fma 2.0 x 2.0)))
(fma B (* (* B B) -0.16666666666666666) B)))
F
(- (/ x (tan B))))
(if (<= F 1300000.0)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
(/ (- 1.0 t_0) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * cos(B);
double tmp;
if (F <= -265000000.0) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 6.5e-78) {
tmp = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, -(x / tan(B)));
} else if (F <= 1300000.0) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * cos(B)) tmp = 0.0 if (F <= -265000000.0) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 6.5e-78) tmp = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, Float64(-Float64(x / tan(B)))); elseif (F <= 1300000.0) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -265000000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-78], N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1300000.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \cos B\\
\mathbf{if}\;F \leq -265000000:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1300000:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.65e8Initial program 64.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.9%
Applied rewrites75.1%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -2.65e8 < F < 6.5000000000000003e-78Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Applied rewrites99.6%
Taylor expanded in B around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6485.7
Applied rewrites85.7%
if 6.5000000000000003e-78 < F < 1.3e6Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.4%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6489.0
Applied rewrites89.0%
if 1.3e6 < F Initial program 64.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.2%
Applied rewrites71.8%
Taylor expanded in F around inf
Applied rewrites99.6%
Final simplification93.0%
(FPCore (F B x)
:precision binary64
(if (<= F -265000000.0)
(/ (- -1.0 (* x (cos B))) (sin B))
(if (<= F 6.5e-78)
(fma
(/
1.0
(*
(sqrt (fma F F (fma 2.0 x 2.0)))
(fma B (* (* B B) -0.16666666666666666) B)))
F
(- (/ x (tan B))))
(if (<= F 1.36e+116)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
(/ -1.0 (/ (tan B) x))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -265000000.0) {
tmp = (-1.0 - (x * cos(B))) / sin(B);
} else if (F <= 6.5e-78) {
tmp = fma((1.0 / (sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, ((B * B) * -0.16666666666666666), B))), F, -(x / tan(B)));
} else if (F <= 1.36e+116) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
} else {
tmp = -1.0 / (tan(B) / x);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -265000000.0) tmp = Float64(Float64(-1.0 - Float64(x * cos(B))) / sin(B)); elseif (F <= 6.5e-78) tmp = fma(Float64(1.0 / Float64(sqrt(fma(F, F, fma(2.0, x, 2.0))) * fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))), F, Float64(-Float64(x / tan(B)))); elseif (F <= 1.36e+116) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B)); else tmp = Float64(-1.0 / Float64(tan(B) / x)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -265000000.0], N[(N[(-1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.5e-78], N[(N[(1.0 / N[(N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.36e+116], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -265000000:\\
\;\;\;\;\frac{-1 - x \cdot \cos B}{\sin B}\\
\mathbf{elif}\;F \leq 6.5 \cdot 10^{-78}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)} \cdot \mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}, F, -\frac{x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.36 \cdot 10^{+116}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
\end{array}
\end{array}
if F < -2.65e8Initial program 64.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.9%
Applied rewrites75.1%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -2.65e8 < F < 6.5000000000000003e-78Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Applied rewrites99.6%
Taylor expanded in B around 0
+-commutativeN/A
distribute-lft-inN/A
*-rgt-identityN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6485.7
Applied rewrites85.7%
if 6.5000000000000003e-78 < F < 1.36e116Initial program 95.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.7%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6484.5
Applied rewrites84.5%
if 1.36e116 < F Initial program 50.4%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6459.3
Applied rewrites59.3%
Applied rewrites59.5%
Final simplification84.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -1.08e-29)
t_0
(if (<= x 2.15e-17)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -1.08e-29) {
tmp = t_0;
} else if (x <= 2.15e-17) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (x <= -1.08e-29) tmp = t_0; elseif (x <= 2.15e-17) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -1.08e-29], t$95$0, If[LessEqual[x, 2.15e-17], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1.08 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-17}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.07999999999999995e-29 or 2.15000000000000012e-17 < x Initial program 88.0%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6495.4
Applied rewrites95.4%
Applied rewrites95.5%
if -1.07999999999999995e-29 < x < 2.15000000000000012e-17Initial program 76.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites78.1%
Applied rewrites78.0%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6464.9
Applied rewrites64.9%
Final simplification78.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -8.5e-30)
t_0
(if (<= x 4.5e-78) (/ (* F (sqrt (/ 1.0 (fma F F 2.0)))) (sin B)) t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -8.5e-30) {
tmp = t_0;
} else if (x <= 4.5e-78) {
tmp = (F * sqrt((1.0 / fma(F, F, 2.0)))) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (x <= -8.5e-30) tmp = t_0; elseif (x <= 4.5e-78) tmp = Float64(Float64(F * sqrt(Float64(1.0 / fma(F, F, 2.0)))) / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -8.5e-30], t$95$0, If[LessEqual[x, 4.5e-78], N[(N[(F * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -8.5 \cdot 10^{-30}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-78}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8.49999999999999931e-30 or 4.5e-78 < x Initial program 85.4%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6486.0
Applied rewrites86.0%
Applied rewrites86.1%
if -8.49999999999999931e-30 < x < 4.5e-78Initial program 77.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites78.8%
Applied rewrites78.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6461.2
Applied rewrites61.2%
Final simplification74.8%
(FPCore (F B x)
:precision binary64
(if (<= B 0.00045)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma 0.16666666666666666 (* F (* B B)) F)
(fma (* x (* B B)) 0.3333333333333333 (- x)))
B)
(- (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.00045) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), fma((x * (B * B)), 0.3333333333333333, -x)) / B;
} else {
tmp = -(x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.00045) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), fma(Float64(x * Float64(B * B)), 0.3333333333333333, Float64(-x))) / B); else tmp = Float64(-Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.00045], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.00045:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 4.4999999999999999e-4Initial program 79.0%
Taylor expanded in B around 0
Applied rewrites56.1%
if 4.4999999999999999e-4 < B Initial program 90.7%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6461.6
Applied rewrites61.6%
Applied rewrites61.9%
Final simplification57.5%
(FPCore (F B x)
:precision binary64
(if (<= F -3.1e-14)
(/ (- -1.0 x) B)
(if (<= F 80000000.0)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma 0.16666666666666666 (* F (* B B)) F)
(fma (* x (* B B)) 0.3333333333333333 (- x)))
B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.1e-14) {
tmp = (-1.0 - x) / B;
} else if (F <= 80000000.0) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), fma((x * (B * B)), 0.3333333333333333, -x)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.1e-14) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 80000000.0) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), fma(Float64(x * Float64(B * B)), 0.3333333333333333, Float64(-x))) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.1e-14], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 80000000.0], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.1 \cdot 10^{-14}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 80000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \mathsf{fma}\left(x \cdot \left(B \cdot B\right), 0.3333333333333333, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.10000000000000004e-14Initial program 66.3%
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.0
Applied rewrites50.0%
Taylor expanded in F around -inf
Applied rewrites67.4%
if -3.10000000000000004e-14 < F < 8e7Initial program 99.4%
Taylor expanded in B around 0
Applied rewrites46.7%
if 8e7 < F Initial program 64.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.f6431.4
Applied rewrites31.4%
Taylor expanded in F around inf
Applied rewrites44.1%
Final simplification51.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45e-5)
(/ (- -1.0 x) B)
(if (<= F 2e+20)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= 2e+20) {
tmp = ((F / sqrt(fma(F, F, 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 <= -1.45e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2e+20) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 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, -1.45e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2e+20], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 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 -1.45 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+20}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.45e-5Initial program 65.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.f6450.8
Applied rewrites50.8%
Taylor expanded in F around -inf
Applied rewrites68.5%
if -1.45e-5 < F < 2e20Initial program 98.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.f6446.2
Applied rewrites46.2%
Applied rewrites46.3%
if 2e20 < F Initial program 63.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.f6430.2
Applied rewrites30.2%
Taylor expanded in F around inf
Applied rewrites43.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-5) (/ (- -1.0 x) B) (if (<= F 0.123) (/ (fma F (sqrt 0.5) (- x)) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.123) {
tmp = fma(F, sqrt(0.5), -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 0.123) tmp = Float64(fma(F, sqrt(0.5), Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.123], N[(N[(F * N[Sqrt[0.5], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 0.123:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{0.5}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.45e-5Initial program 65.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.f6450.8
Applied rewrites50.8%
Taylor expanded in F around -inf
Applied rewrites68.5%
if -1.45e-5 < F < 0.123Initial 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.f6445.5
Applied rewrites45.5%
Taylor expanded in F around 0
Applied rewrites45.1%
Taylor expanded in x around 0
Applied rewrites45.1%
if 0.123 < F Initial program 65.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.f6432.9
Applied rewrites32.9%
Taylor expanded in F around inf
Applied rewrites44.3%
(FPCore (F B x)
:precision binary64
(if (<= F -8.2e-143)
(/ (- -1.0 x) B)
(if (<= F 1.05e-38)
(/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.2e-143) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.05e-38) {
tmp = (x * fma(0.3333333333333333, (B * B), -1.0)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8.2e-143) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.05e-38) tmp = Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8.2e-143], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.05e-38], N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-38}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.2e-143Initial 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.f6451.5
Applied rewrites51.5%
Taylor expanded in F around -inf
Applied rewrites52.2%
if -8.2e-143 < F < 1.05000000000000006e-38Initial program 99.4%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6471.8
Applied rewrites71.8%
Taylor expanded in B around 0
Applied rewrites30.4%
if 1.05000000000000006e-38 < F Initial program 68.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.f6435.1
Applied rewrites35.1%
Taylor expanded in F around inf
Applied rewrites42.1%
(FPCore (F B x) :precision binary64 (if (<= F -8.2e-143) (/ (- -1.0 x) B) (if (<= F 1.95e-54) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.2e-143) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.95e-54) {
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 <= (-8.2d-143)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.95d-54) 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 <= -8.2e-143) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.95e-54) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.2e-143: tmp = (-1.0 - x) / B elif F <= 1.95e-54: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.2e-143) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.95e-54) 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 <= -8.2e-143) tmp = (-1.0 - x) / B; elseif (F <= 1.95e-54) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.2e-143], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-54], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-54}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.2e-143Initial 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.f6451.5
Applied rewrites51.5%
Taylor expanded in F around -inf
Applied rewrites52.2%
if -8.2e-143 < F < 1.95e-54Initial 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.f6442.4
Applied rewrites42.4%
Taylor expanded in F around 0
Applied rewrites29.7%
if 1.95e-54 < F Initial program 70.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.f6435.5
Applied rewrites35.5%
Taylor expanded in F around inf
Applied rewrites41.1%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (- x) B))) (if (<= x -1.6e-116) t_0 (if (<= x 3.8e-59) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.6e-116) {
tmp = t_0;
} else if (x <= 3.8e-59) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
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) :: t_0
real(8) :: tmp
t_0 = -x / b
if (x <= (-1.6d-116)) then
tmp = t_0
else if (x <= 3.8d-59) then
tmp = (-1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.6e-116) {
tmp = t_0;
} else if (x <= 3.8e-59) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if x <= -1.6e-116: tmp = t_0 elif x <= 3.8e-59: tmp = -1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (x <= -1.6e-116) tmp = t_0; elseif (x <= 3.8e-59) tmp = Float64(-1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / B; tmp = 0.0; if (x <= -1.6e-116) tmp = t_0; elseif (x <= 3.8e-59) tmp = -1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -1.6e-116], t$95$0, If[LessEqual[x, 3.8e-59], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{-116}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-59}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.60000000000000005e-116 or 3.79999999999999983e-59 < x Initial program 84.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.0
Applied rewrites46.0%
Taylor expanded in F around 0
Applied rewrites40.3%
if -1.60000000000000005e-116 < x < 3.79999999999999983e-59Initial program 78.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.f6439.2
Applied rewrites39.2%
Taylor expanded in F around -inf
Applied rewrites20.1%
Taylor expanded in x around 0
Applied rewrites20.1%
(FPCore (F B x) :precision binary64 (if (<= F -6e-143) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -6e-143) {
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-143)) 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-143) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6e-143: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6e-143) 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-143) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6e-143], 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^{-143}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -5.9999999999999997e-143Initial program 75.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.f6450.9
Applied rewrites50.9%
Taylor expanded in F around -inf
Applied rewrites51.7%
if -5.9999999999999997e-143 < F Initial program 84.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.f6439.2
Applied rewrites39.2%
Taylor expanded in F around 0
Applied rewrites25.5%
(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 81.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.f6443.2
Applied rewrites43.2%
Taylor expanded in F around -inf
Applied rewrites29.9%
Taylor expanded in x around 0
Applied rewrites11.6%
herbie shell --seed 2024221
(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))))))