
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(if (<= F -1.65e+28)
(- (/ F (* (sin B) (- F))) (/ x (tan B)))
(if (<= F 175000000.0)
(fma
(- F)
(* (/ -1.0 (sin B)) (pow (fma x 2.0 (fma F F 2.0)) -0.5))
(/ (- x) (tan B)))
(- (pow (sin B) -1.0) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.65e+28) {
tmp = (F / (sin(B) * -F)) - (x / tan(B));
} else if (F <= 175000000.0) {
tmp = fma(-F, ((-1.0 / sin(B)) * pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5)), (-x / tan(B)));
} else {
tmp = pow(sin(B), -1.0) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.65e+28) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - Float64(x / tan(B))); elseif (F <= 175000000.0) tmp = fma(Float64(-F), Float64(Float64(-1.0 / sin(B)) * (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5)), Float64(Float64(-x) / tan(B))); else tmp = Float64((sin(B) ^ -1.0) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.65e+28], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 175000000.0], N[((-F) * N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.65 \cdot 10^{+28}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 175000000:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{-1}{\sin B} \cdot {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.65e28Initial program 54.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites70.2%
Applied rewrites70.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6470.2
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6470.2
Applied rewrites70.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -1.65e28 < F < 1.75e8Initial program 98.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
if 1.75e8 < F Initial program 62.3%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B)))
(t_1 (/ F (sin B)))
(t_2
(+
(* x (/ -1.0 (tan B)))
(* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
(t_3 (/ x (tan B)))
(t_4 (- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (/ F B)) t_3)))
(if (<= t_2 -1e+19)
(- (/ F (* (sqrt (fma (+ 1.0 x) 2.0 (* F F))) B)) t_3)
(if (<= t_2 -2e-165)
(fma -1.0 (* (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) t_0) (- (/ x B)))
(if (<= t_2 1e-160)
(- t_0 (/ x B))
(if (<= t_2 2e-51)
t_4
(if (<= t_2 50.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_1)
(if (<= t_2 2e+277) t_4 (- (/ 1.0 (sin B)) (/ x B))))))))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double t_1 = F / sin(B);
double t_2 = (x * (-1.0 / tan(B))) + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double t_3 = x / tan(B);
double t_4 = (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * (F / B)) - t_3;
double tmp;
if (t_2 <= -1e+19) {
tmp = (F / (sqrt(fma((1.0 + x), 2.0, (F * F))) * B)) - t_3;
} else if (t_2 <= -2e-165) {
tmp = fma(-1.0, ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * t_0), -(x / B));
} else if (t_2 <= 1e-160) {
tmp = t_0 - (x / B);
} else if (t_2 <= 2e-51) {
tmp = t_4;
} else if (t_2 <= 50.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_1;
} else if (t_2 <= 2e+277) {
tmp = t_4;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) t_1 = Float64(F / sin(B)) t_2 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_1 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) t_3 = Float64(x / tan(B)) t_4 = Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * Float64(F / B)) - t_3) tmp = 0.0 if (t_2 <= -1e+19) tmp = Float64(Float64(F / Float64(sqrt(fma(Float64(1.0 + x), 2.0, Float64(F * F))) * B)) - t_3); elseif (t_2 <= -2e-165) tmp = fma(-1.0, Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) * t_0), Float64(-Float64(x / B))); elseif (t_2 <= 1e-160) tmp = Float64(t_0 - Float64(x / B)); elseif (t_2 <= 2e-51) tmp = t_4; elseif (t_2 <= 50.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_1); elseif (t_2 <= 2e+277) tmp = t_4; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); 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[(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[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+19], N[(N[(F / N[(N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[t$95$2, -2e-165], N[(-1.0 * N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision], If[LessEqual[t$95$2, 1e-160], N[(t$95$0 - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-51], t$95$4, If[LessEqual[t$95$2, 50.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+277], t$95$4, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_3 := \frac{x}{\tan B}\\
t_4 := \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \frac{F}{B} - t\_3\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)} \cdot B} - t\_3\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-165}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot t\_0, -\frac{x}{B}\right)\\
\mathbf{elif}\;t\_2 \leq 10^{-160}:\\
\;\;\;\;t\_0 - \frac{x}{B}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_2 \leq 50:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{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)))))) < -1e19Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.7
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6499.7
Applied rewrites99.7%
if -1e19 < (+.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)))))) < -2e-165Initial program 89.0%
Taylor expanded in B around 0
lower-/.f6476.5
Applied rewrites76.5%
Applied rewrites76.5%
if -2e-165 < (+.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)))))) < 9.9999999999999999e-161Initial program 17.5%
Taylor expanded in B around 0
lower-/.f6417.1
Applied rewrites17.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6417.1
Applied rewrites17.2%
Taylor expanded in F around -inf
Applied rewrites50.7%
if 9.9999999999999999e-161 < (+.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)))))) < 2e-51 or 50 < (+.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.00000000000000001e277Initial program 93.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites94.0%
Applied rewrites94.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6488.5
Applied rewrites88.5%
if 2e-51 < (+.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)))))) < 50Initial program 87.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6465.9
Applied rewrites65.9%
if 2.00000000000000001e277 < (+.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 29.8%
Taylor expanded in B around 0
lower-/.f6425.5
Applied rewrites25.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6425.5
Applied rewrites64.4%
Taylor expanded in F around inf
Applied rewrites80.3%
Final simplification82.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sin B)))
(t_1
(+
(* x (/ -1.0 (tan B)))
(* t_0 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
(t_2 (/ x (tan B)))
(t_3 (- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (/ F B)) t_2)))
(if (<= t_1 -1e+19)
(- (/ F (* (sqrt (fma (+ 1.0 x) 2.0 (* F F))) B)) t_2)
(if (<= t_1 -2e-165)
(- (/ t_0 (sqrt (fma x 2.0 (fma F F 2.0)))) (/ x B))
(if (<= t_1 1e-160)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= t_1 2e-51)
t_3
(if (<= t_1 50.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_0)
(if (<= t_1 2e+277) t_3 (- (/ 1.0 (sin B)) (/ x B))))))))))
double code(double F, double B, double x) {
double t_0 = F / sin(B);
double t_1 = (x * (-1.0 / tan(B))) + (t_0 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double t_2 = x / tan(B);
double t_3 = (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * (F / B)) - t_2;
double tmp;
if (t_1 <= -1e+19) {
tmp = (F / (sqrt(fma((1.0 + x), 2.0, (F * F))) * B)) - t_2;
} else if (t_1 <= -2e-165) {
tmp = (t_0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (x / B);
} else if (t_1 <= 1e-160) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (t_1 <= 2e-51) {
tmp = t_3;
} else if (t_1 <= 50.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_0;
} else if (t_1 <= 2e+277) {
tmp = t_3;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(F / sin(B)) t_1 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_0 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) t_2 = Float64(x / tan(B)) t_3 = Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * Float64(F / B)) - t_2) tmp = 0.0 if (t_1 <= -1e+19) tmp = Float64(Float64(F / Float64(sqrt(fma(Float64(1.0 + x), 2.0, Float64(F * F))) * B)) - t_2); elseif (t_1 <= -2e-165) tmp = Float64(Float64(t_0 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(x / B)); elseif (t_1 <= 1e-160) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (t_1 <= 2e-51) tmp = t_3; elseif (t_1 <= 50.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_0); elseif (t_1 <= 2e+277) tmp = t_3; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * 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]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+19], N[(N[(F / N[(N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$1, -2e-165], N[(N[(t$95$0 / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e-160], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e-51], t$95$3, If[LessEqual[t$95$1, 50.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 2e+277], t$95$3, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
t_1 := x \cdot \frac{-1}{\tan B} + t\_0 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_2 := \frac{x}{\tan B}\\
t_3 := \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \frac{F}{B} - t\_2\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)} \cdot B} - t\_2\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-165}:\\
\;\;\;\;\frac{t\_0}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{elif}\;t\_1 \leq 10^{-160}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-51}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 50:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_0\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{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)))))) < -1e19Initial program 95.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Applied rewrites99.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.7
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6499.7
Applied rewrites99.7%
if -1e19 < (+.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)))))) < -2e-165Initial program 89.0%
Taylor expanded in B around 0
lower-/.f6476.5
Applied rewrites76.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6476.5
Applied rewrites76.4%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f6476.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6476.6
Applied rewrites76.6%
if -2e-165 < (+.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)))))) < 9.9999999999999999e-161Initial program 17.5%
Taylor expanded in B around 0
lower-/.f6417.1
Applied rewrites17.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6417.1
Applied rewrites17.2%
Taylor expanded in F around -inf
Applied rewrites50.7%
if 9.9999999999999999e-161 < (+.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)))))) < 2e-51 or 50 < (+.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.00000000000000001e277Initial program 93.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites94.0%
Applied rewrites94.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6488.5
Applied rewrites88.5%
if 2e-51 < (+.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)))))) < 50Initial program 87.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6465.9
Applied rewrites65.9%
if 2.00000000000000001e277 < (+.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 29.8%
Taylor expanded in B around 0
lower-/.f6425.5
Applied rewrites25.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6425.5
Applied rewrites64.4%
Taylor expanded in F around inf
Applied rewrites80.3%
Final simplification82.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ F (* (sqrt (fma (+ 1.0 x) 2.0 (* F F))) B)) (/ x (tan B))))
(t_1 (/ F (sin B)))
(t_2
(+
(* x (/ -1.0 (tan B)))
(* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
(if (<= t_2 -1e+19)
t_0
(if (<= t_2 -2e-165)
(- (/ t_1 (sqrt (fma x 2.0 (fma F F 2.0)))) (/ x B))
(if (<= t_2 1e-160)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= t_2 2e-41)
t_0
(if (<= t_2 50.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_1)
(if (<= t_2 2e+277) t_0 (- (/ 1.0 (sin B)) (/ x B))))))))))
double code(double F, double B, double x) {
double t_0 = (F / (sqrt(fma((1.0 + x), 2.0, (F * F))) * B)) - (x / tan(B));
double t_1 = F / sin(B);
double t_2 = (x * (-1.0 / tan(B))) + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double tmp;
if (t_2 <= -1e+19) {
tmp = t_0;
} else if (t_2 <= -2e-165) {
tmp = (t_1 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (x / B);
} else if (t_2 <= 1e-160) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (t_2 <= 2e-41) {
tmp = t_0;
} else if (t_2 <= 50.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_1;
} else if (t_2 <= 2e+277) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / Float64(sqrt(fma(Float64(1.0 + x), 2.0, Float64(F * F))) * B)) - 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(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_2 <= -1e+19) tmp = t_0; elseif (t_2 <= -2e-165) tmp = Float64(Float64(t_1 / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(x / B)); elseif (t_2 <= 1e-160) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (t_2 <= 2e-41) tmp = t_0; elseif (t_2 <= 50.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_1); elseif (t_2 <= 2e+277) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[(N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $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[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+19], t$95$0, If[LessEqual[t$95$2, -2e-165], N[(N[(t$95$1 / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-160], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-41], t$95$0, If[LessEqual[t$95$2, 50.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+277], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)} \cdot B} - \frac{x}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-165}:\\
\;\;\;\;\frac{t\_1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{elif}\;t\_2 \leq 10^{-160}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 50:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{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)))))) < -1e19 or 9.9999999999999999e-161 < (+.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.00000000000000001e-41 or 50 < (+.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.00000000000000001e277Initial program 94.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites96.7%
Applied rewrites96.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6496.7
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6496.7
Applied rewrites96.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6493.9
Applied rewrites93.9%
if -1e19 < (+.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)))))) < -2e-165Initial program 89.0%
Taylor expanded in B around 0
lower-/.f6476.5
Applied rewrites76.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6476.5
Applied rewrites76.4%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f6476.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6476.6
Applied rewrites76.6%
if -2e-165 < (+.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)))))) < 9.9999999999999999e-161Initial program 17.5%
Taylor expanded in B around 0
lower-/.f6417.1
Applied rewrites17.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6417.1
Applied rewrites17.2%
Taylor expanded in F around -inf
Applied rewrites50.7%
if 2.00000000000000001e-41 < (+.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)))))) < 50Initial program 86.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6462.9
Applied rewrites62.9%
if 2.00000000000000001e277 < (+.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 29.8%
Taylor expanded in B around 0
lower-/.f6425.5
Applied rewrites25.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6425.5
Applied rewrites64.4%
Taylor expanded in F around inf
Applied rewrites80.3%
Final simplification82.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ F (* (sqrt (fma (+ 1.0 x) 2.0 (* F F))) B)) (/ x (tan B))))
(t_1 (/ F (sin B)))
(t_2
(+
(* x (/ -1.0 (tan B)))
(* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
(if (<= t_2 -1e+19)
t_0
(if (<= t_2 -2e-165)
(- (/ F (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x B))
(if (<= t_2 1e-160)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= t_2 2e-41)
t_0
(if (<= t_2 50.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_1)
(if (<= t_2 2e+277) t_0 (- (/ 1.0 (sin B)) (/ x B))))))))))
double code(double F, double B, double x) {
double t_0 = (F / (sqrt(fma((1.0 + x), 2.0, (F * F))) * B)) - (x / tan(B));
double t_1 = F / sin(B);
double t_2 = (x * (-1.0 / tan(B))) + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double tmp;
if (t_2 <= -1e+19) {
tmp = t_0;
} else if (t_2 <= -2e-165) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / B);
} else if (t_2 <= 1e-160) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (t_2 <= 2e-41) {
tmp = t_0;
} else if (t_2 <= 50.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_1;
} else if (t_2 <= 2e+277) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / Float64(sqrt(fma(Float64(1.0 + x), 2.0, Float64(F * F))) * B)) - 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(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_2 <= -1e+19) tmp = t_0; elseif (t_2 <= -2e-165) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / B)); elseif (t_2 <= 1e-160) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (t_2 <= 2e-41) tmp = t_0; elseif (t_2 <= 50.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_1); elseif (t_2 <= 2e+277) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[(N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $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[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+19], t$95$0, If[LessEqual[t$95$2, -2e-165], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e-160], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e-41], t$95$0, If[LessEqual[t$95$2, 50.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 2e+277], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sqrt{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)} \cdot B} - \frac{x}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := x \cdot \frac{-1}{\tan B} + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+19}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-165}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{elif}\;t\_2 \leq 10^{-160}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-41}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 50:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+277}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{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)))))) < -1e19 or 9.9999999999999999e-161 < (+.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.00000000000000001e-41 or 50 < (+.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.00000000000000001e277Initial program 94.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites96.7%
Applied rewrites96.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6496.7
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6496.7
Applied rewrites96.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6493.9
Applied rewrites93.9%
if -1e19 < (+.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)))))) < -2e-165Initial program 89.0%
Taylor expanded in B around 0
lower-/.f6476.5
Applied rewrites76.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6476.5
Applied rewrites76.4%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6476.5
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6476.5
Applied rewrites76.5%
if -2e-165 < (+.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)))))) < 9.9999999999999999e-161Initial program 17.5%
Taylor expanded in B around 0
lower-/.f6417.1
Applied rewrites17.1%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6417.1
Applied rewrites17.2%
Taylor expanded in F around -inf
Applied rewrites50.7%
if 2.00000000000000001e-41 < (+.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)))))) < 50Initial program 86.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6462.9
Applied rewrites62.9%
if 2.00000000000000001e277 < (+.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 29.8%
Taylor expanded in B around 0
lower-/.f6425.5
Applied rewrites25.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6425.5
Applied rewrites64.4%
Taylor expanded in F around inf
Applied rewrites80.3%
Final simplification82.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+123)
(- (/ F (* (sin B) (- F))) (/ x (tan B)))
(if (<= F 20000000.0)
(fma (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) F (/ (- x) (tan B)))
(- (pow (sin B) -1.0) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+123) {
tmp = (F / (sin(B) * -F)) - (x / tan(B));
} else if (F <= 20000000.0) {
tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, (-x / tan(B)));
} else {
tmp = pow(sin(B), -1.0) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+123) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - Float64(x / tan(B))); elseif (F <= 20000000.0) tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(Float64(-x) / tan(B))); else tmp = Float64((sin(B) ^ -1.0) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+123], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 20000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+123}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 20000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -9.99999999999999978e122Initial program 31.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites55.4%
Applied rewrites55.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6455.5
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6455.5
Applied rewrites55.5%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -9.99999999999999978e122 < F < 2e7Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
if 2e7 < F Initial program 62.3%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+153)
(- (/ F (* (sin B) (- F))) t_0)
(if (<= F 200000000.0)
(- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) t_0)
(- (pow (sin B) -1.0) (* (cos B) (/ x (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+153) {
tmp = (F / (sin(B) * -F)) - t_0;
} else if (F <= 200000000.0) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - t_0;
} else {
tmp = pow(sin(B), -1.0) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+153) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - t_0); elseif (F <= 200000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - t_0); else tmp = Float64((sin(B) ^ -1.0) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+153], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+153}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - t\_0\\
\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1e153Initial program 28.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites48.8%
Applied rewrites48.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6448.8
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6448.8
Applied rewrites48.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -1e153 < F < 2e8Initial program 96.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.7%
if 2e8 < F Initial program 62.3%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.65e+28)
(- (/ F (* (sin B) (- F))) (/ x (tan B)))
(if (<= F -9.5e-150)
(fma (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) F (- (/ x B)))
(if (<= F 9e-98)
(fma
(- F)
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (- B))
(/ (- x) (tan B)))
(if (<= F 250000.0)
(- (/ F (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x B))
(+ (/ -1.0 (/ (tan B) x)) (pow (sin B) -1.0)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.65e+28) {
tmp = (F / (sin(B) * -F)) - (x / tan(B));
} else if (F <= -9.5e-150) {
tmp = fma((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), F, -(x / B));
} else if (F <= 9e-98) {
tmp = fma(-F, (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / -B), (-x / tan(B)));
} else if (F <= 250000.0) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / B);
} else {
tmp = (-1.0 / (tan(B) / x)) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.65e+28) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - Float64(x / tan(B))); elseif (F <= -9.5e-150) tmp = fma(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(-Float64(x / B))); elseif (F <= 9e-98) tmp = fma(Float64(-F), Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); elseif (F <= 250000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.65e+28], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.5e-150], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + (-N[(x / B), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 9e-98], N[((-F) * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 250000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.65 \cdot 10^{+28}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -9.5 \cdot 10^{-150}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, -\frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-98}:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 250000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.65e28Initial program 54.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites70.2%
Applied rewrites70.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6470.2
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6470.2
Applied rewrites70.2%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -1.65e28 < F < -9.50000000000000013e-150Initial program 96.8%
Taylor expanded in B around 0
lower-/.f6483.6
Applied rewrites83.6%
lift-+.f64N/A
+-commutativeN/A
Applied rewrites86.4%
if -9.50000000000000013e-150 < F < 8.99999999999999994e-98Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in B around 0
mul-1-negN/A
associate-*l/N/A
*-lft-identityN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites95.2%
if 8.99999999999999994e-98 < F < 2.5e5Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6484.2
Applied rewrites84.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6484.2
Applied rewrites84.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6484.3
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 2.5e5 < F Initial program 62.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f6462.3
Applied rewrites62.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Final simplification95.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma x 2.0 (fma F F 2.0)))))
(if (<= F -65000000.0)
(- (/ F (* (sin B) (- F))) (/ x (tan B)))
(if (<= F -9.5e-150)
(- (/ (/ F (sin B)) t_0) (/ x B))
(if (<= F 9e-98)
(fma
(- F)
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (- B))
(/ (- x) (tan B)))
(if (<= F 250000.0)
(- (/ F (* (sin B) t_0)) (/ x B))
(+ (/ -1.0 (/ (tan B) x)) (pow (sin B) -1.0))))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(x, 2.0, fma(F, F, 2.0)));
double tmp;
if (F <= -65000000.0) {
tmp = (F / (sin(B) * -F)) - (x / tan(B));
} else if (F <= -9.5e-150) {
tmp = ((F / sin(B)) / t_0) - (x / B);
} else if (F <= 9e-98) {
tmp = fma(-F, (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / -B), (-x / tan(B)));
} else if (F <= 250000.0) {
tmp = (F / (sin(B) * t_0)) - (x / B);
} else {
tmp = (-1.0 / (tan(B) / x)) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(x, 2.0, fma(F, F, 2.0))) tmp = 0.0 if (F <= -65000000.0) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - Float64(x / tan(B))); elseif (F <= -9.5e-150) tmp = Float64(Float64(Float64(F / sin(B)) / t_0) - Float64(x / B)); elseif (F <= 9e-98) tmp = fma(Float64(-F), Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); elseif (F <= 250000.0) tmp = Float64(Float64(F / Float64(sin(B) * t_0)) - Float64(x / B)); else tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -65000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.5e-150], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-98], N[((-F) * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 250000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\\
\mathbf{if}\;F \leq -65000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -9.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{t\_0} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-98}:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 250000:\\
\;\;\;\;\frac{F}{\sin B \cdot t\_0} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -6.5e7Initial program 54.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites71.0%
Applied rewrites71.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6471.1
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6471.1
Applied rewrites71.1%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -6.5e7 < F < -9.50000000000000013e-150Initial program 99.5%
Taylor expanded in B around 0
lower-/.f6485.5
Applied rewrites85.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6485.5
Applied rewrites85.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f6485.4
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.4
Applied rewrites85.4%
if -9.50000000000000013e-150 < F < 8.99999999999999994e-98Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in B around 0
mul-1-negN/A
associate-*l/N/A
*-lft-identityN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites95.2%
if 8.99999999999999994e-98 < F < 2.5e5Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6484.2
Applied rewrites84.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6484.2
Applied rewrites84.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6484.3
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 2.5e5 < F Initial program 62.3%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
lower-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
lower-/.f6462.3
Applied rewrites62.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
clear-numN/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
Final simplification95.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+153)
(- (/ F (* (sin B) (- F))) t_0)
(if (<= F 1.55e+157)
(- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) t_0)
(+ (* x (/ -1.0 (tan B))) (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+153) {
tmp = (F / (sin(B) * -F)) - t_0;
} else if (F <= 1.55e+157) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+153) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - t_0); elseif (F <= 1.55e+157) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+153], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.55e+157], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+153}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - t\_0\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{+157}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1e153Initial program 28.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites48.8%
Applied rewrites48.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6448.8
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6448.8
Applied rewrites48.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -1e153 < F < 1.5499999999999999e157Initial program 94.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.7%
if 1.5499999999999999e157 < F Initial program 34.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+155)
(- (/ F (* (sin B) (- F))) t_0)
(if (<= F 1.55e+157)
(- (/ F (* (sin B) (sqrt (fma F F 2.0)))) t_0)
(+ (* x (/ -1.0 (tan B))) (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+155) {
tmp = (F / (sin(B) * -F)) - t_0;
} else if (F <= 1.55e+157) {
tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+155) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - t_0); elseif (F <= 1.55e+157) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+155], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.55e+157], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+155}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - t\_0\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{+157}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.00000000000000001e155Initial program 28.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites48.8%
Applied rewrites48.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6448.8
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6448.8
Applied rewrites48.8%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -1.00000000000000001e155 < F < 1.5499999999999999e157Initial program 94.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
if 1.5499999999999999e157 < F Initial program 34.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma x 2.0 (fma F F 2.0)))) (t_1 (/ x (tan B))))
(if (<= F -65000000.0)
(- (/ F (* (sin B) (- F))) t_1)
(if (<= F -9.5e-150)
(- (/ (/ F (sin B)) t_0) (/ x B))
(if (<= F 9e-98)
(fma
(- F)
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (- B))
(/ (- x) (tan B)))
(if (<= F 250000.0)
(- (/ F (* (sin B) t_0)) (/ x B))
(- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(x, 2.0, fma(F, F, 2.0)));
double t_1 = x / tan(B);
double tmp;
if (F <= -65000000.0) {
tmp = (F / (sin(B) * -F)) - t_1;
} else if (F <= -9.5e-150) {
tmp = ((F / sin(B)) / t_0) - (x / B);
} else if (F <= 9e-98) {
tmp = fma(-F, (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / -B), (-x / tan(B)));
} else if (F <= 250000.0) {
tmp = (F / (sin(B) * t_0)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(x, 2.0, fma(F, F, 2.0))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -65000000.0) tmp = Float64(Float64(F / Float64(sin(B) * Float64(-F))) - t_1); elseif (F <= -9.5e-150) tmp = Float64(Float64(Float64(F / sin(B)) / t_0) - Float64(x / B)); elseif (F <= 9e-98) tmp = fma(Float64(-F), Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); elseif (F <= 250000.0) tmp = Float64(Float64(F / Float64(sin(B) * t_0)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -65000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * (-F)), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -9.5e-150], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-98], N[((-F) * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 250000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -65000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(-F\right)} - t\_1\\
\mathbf{elif}\;F \leq -9.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{t\_0} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-98}:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 250000:\\
\;\;\;\;\frac{F}{\sin B \cdot t\_0} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -6.5e7Initial program 54.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites71.0%
Applied rewrites71.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6471.1
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6471.1
Applied rewrites71.1%
Taylor expanded in F around -inf
mul-1-negN/A
lower-neg.f6499.8
Applied rewrites99.8%
if -6.5e7 < F < -9.50000000000000013e-150Initial program 99.5%
Taylor expanded in B around 0
lower-/.f6485.5
Applied rewrites85.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6485.5
Applied rewrites85.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f6485.4
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.4
Applied rewrites85.4%
if -9.50000000000000013e-150 < F < 8.99999999999999994e-98Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in B around 0
mul-1-negN/A
associate-*l/N/A
*-lft-identityN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites95.2%
if 8.99999999999999994e-98 < F < 2.5e5Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6484.2
Applied rewrites84.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6484.2
Applied rewrites84.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6484.3
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 2.5e5 < F Initial program 62.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites72.9%
Applied rewrites72.9%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification95.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma x 2.0 (fma F F 2.0)))))
(if (<= F -65000000.0)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F -9.5e-150)
(- (/ (/ F (sin B)) t_0) (/ x B))
(if (<= F 9e-98)
(fma
(- F)
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (- B))
(/ (- x) (tan B)))
(if (<= F 250000.0)
(- (/ F (* (sin B) t_0)) (/ x B))
(- (/ 1.0 (sin B)) (/ x (tan B)))))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(x, 2.0, fma(F, F, 2.0)));
double tmp;
if (F <= -65000000.0) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= -9.5e-150) {
tmp = ((F / sin(B)) / t_0) - (x / B);
} else if (F <= 9e-98) {
tmp = fma(-F, (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / -B), (-x / tan(B)));
} else if (F <= 250000.0) {
tmp = (F / (sin(B) * t_0)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(x, 2.0, fma(F, F, 2.0))) tmp = 0.0 if (F <= -65000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= -9.5e-150) tmp = Float64(Float64(Float64(F / sin(B)) / t_0) - Float64(x / B)); elseif (F <= 9e-98) tmp = fma(Float64(-F), Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); elseif (F <= 250000.0) tmp = Float64(Float64(F / Float64(sin(B) * t_0)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -65000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -9.5e-150], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-98], N[((-F) * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 250000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}\\
\mathbf{if}\;F \leq -65000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq -9.5 \cdot 10^{-150}:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{t\_0} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-98}:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 250000:\\
\;\;\;\;\frac{F}{\sin B \cdot t\_0} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -6.5e7Initial program 54.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -6.5e7 < F < -9.50000000000000013e-150Initial program 99.5%
Taylor expanded in B around 0
lower-/.f6485.5
Applied rewrites85.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6485.5
Applied rewrites85.3%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
associate-/r*N/A
lift-sin.f64N/A
lower-/.f64N/A
lift-sin.f64N/A
lower-/.f6485.4
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6485.4
Applied rewrites85.4%
if -9.50000000000000013e-150 < F < 8.99999999999999994e-98Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.8%
Taylor expanded in B around 0
mul-1-negN/A
associate-*l/N/A
*-lft-identityN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites95.2%
if 8.99999999999999994e-98 < F < 2.5e5Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6484.2
Applied rewrites84.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6484.2
Applied rewrites84.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6484.3
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 2.5e5 < F Initial program 62.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites72.9%
Applied rewrites72.9%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification95.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4e+110)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 9e-98)
(fma
(- F)
(/ (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (- B))
(/ (- x) (tan B)))
(if (<= F 250000.0)
(- (/ F (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x B))
(- (/ 1.0 (sin B)) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4e+110) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 9e-98) {
tmp = fma(-F, (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) / -B), (-x / tan(B)));
} else if (F <= 250000.0) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / B);
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4e+110) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 9e-98) tmp = fma(Float64(-F), Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); elseif (F <= 250000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4e+110], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-98], N[((-F) * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 250000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4 \cdot 10^{+110}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-98}:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 250000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.39999999999999993e110Initial program 33.1%
Taylor expanded in B around 0
lower-/.f6418.4
Applied rewrites18.4%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6418.4
Applied rewrites41.5%
Taylor expanded in F around -inf
Applied rewrites85.2%
if -1.39999999999999993e110 < F < 8.99999999999999994e-98Initial program 98.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
Taylor expanded in B around 0
mul-1-negN/A
associate-*l/N/A
*-lft-identityN/A
distribute-neg-frac2N/A
mul-1-negN/A
lower-/.f64N/A
Applied rewrites84.9%
if 8.99999999999999994e-98 < F < 2.5e5Initial program 99.4%
Taylor expanded in B around 0
lower-/.f6484.2
Applied rewrites84.2%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6484.2
Applied rewrites84.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6484.3
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.3
Applied rewrites84.3%
if 2.5e5 < F Initial program 62.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites72.9%
Applied rewrites72.9%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification89.3%
(FPCore (F B x)
:precision binary64
(if (<= F -5.8e+51)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1800000000.0)
(- (/ F (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x B))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.8e+51) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1800000000.0) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / B);
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.8e+51) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1800000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.8e+51], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1800000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.8 \cdot 10^{+51}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1800000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.7999999999999997e51Initial program 46.6%
Taylor expanded in B around 0
lower-/.f6425.0
Applied rewrites25.0%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6425.0
Applied rewrites43.5%
Taylor expanded in F around -inf
Applied rewrites78.2%
if -5.7999999999999997e51 < F < 1.8e9Initial program 98.7%
Taylor expanded in B around 0
lower-/.f6476.5
Applied rewrites76.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6476.5
Applied rewrites77.2%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6477.2
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6477.2
Applied rewrites77.2%
if 1.8e9 < F Initial program 62.3%
Taylor expanded in B around 0
lower-/.f6435.7
Applied rewrites35.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6435.7
Applied rewrites46.4%
Taylor expanded in F around inf
Applied rewrites72.5%
(FPCore (F B x)
:precision binary64
(if (<= F -65000000.0)
(/ (- -1.0 x) B)
(if (<= F 1.55)
(/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -65000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.55) {
tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
} else {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -65000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.55) tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -65000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.55], N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -65000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.55:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.5e7Initial program 54.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6440.8
Applied rewrites40.8%
Taylor expanded in F around -inf
Applied rewrites53.4%
if -6.5e7 < F < 1.55000000000000004Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6458.1
Applied rewrites58.1%
Taylor expanded in F around 0
Applied rewrites57.6%
if 1.55000000000000004 < F Initial program 62.8%
Taylor expanded in B around 0
lower-/.f6436.6
Applied rewrites36.6%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6436.6
Applied rewrites47.0%
Taylor expanded in F around inf
Applied rewrites72.3%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6443.0
Applied rewrites43.0%
Final simplification52.0%
(FPCore (F B x)
:precision binary64
(if (<= F -0.07)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 28500.0)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.07) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 28500.0) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.07) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 28500.0) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.07], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 28500.0], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.07:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 28500:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.070000000000000007Initial program 55.6%
Taylor expanded in B around 0
lower-/.f6435.5
Applied rewrites35.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6435.5
Applied rewrites51.6%
Taylor expanded in F around -inf
Applied rewrites78.5%
if -0.070000000000000007 < F < 28500Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6459.5
Applied rewrites59.5%
Applied rewrites59.5%
if 28500 < F Initial program 62.3%
Taylor expanded in B around 0
lower-/.f6435.7
Applied rewrites35.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6435.7
Applied rewrites46.4%
Taylor expanded in F around inf
Applied rewrites72.5%
(FPCore (F B x)
:precision binary64
(if (<= F -0.07)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7.6e+173)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.07) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7.6e+173) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.07) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7.6e+173) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.07], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.6e+173], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.07:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.6 \cdot 10^{+173}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.070000000000000007Initial program 55.6%
Taylor expanded in B around 0
lower-/.f6435.5
Applied rewrites35.5%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6435.5
Applied rewrites51.6%
Taylor expanded in F around -inf
Applied rewrites78.5%
if -0.070000000000000007 < F < 7.60000000000000022e173Initial program 94.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6453.7
Applied rewrites53.7%
Applied rewrites53.7%
if 7.60000000000000022e173 < F Initial program 37.3%
Taylor expanded in B around 0
lower-/.f644.8
Applied rewrites4.8%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f644.8
Applied rewrites14.6%
Taylor expanded in F around inf
Applied rewrites65.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6447.3
Applied rewrites47.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.07)
(/ (fma (/ 0.5 F) (/ (fma 2.0 x 2.0) F) (- -1.0 x)) B)
(if (<= F 7.6e+173)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.07) {
tmp = fma((0.5 / F), (fma(2.0, x, 2.0) / F), (-1.0 - x)) / B;
} else if (F <= 7.6e+173) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.07) tmp = Float64(fma(Float64(0.5 / F), Float64(fma(2.0, x, 2.0) / F), Float64(-1.0 - x)) / B); elseif (F <= 7.6e+173) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.07], N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.6e+173], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.07:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 7.6 \cdot 10^{+173}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.070000000000000007Initial program 55.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.9
Applied rewrites39.9%
Taylor expanded in F around -inf
Applied rewrites52.1%
if -0.070000000000000007 < F < 7.60000000000000022e173Initial program 94.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6453.7
Applied rewrites53.7%
Applied rewrites53.7%
if 7.60000000000000022e173 < F Initial program 37.3%
Taylor expanded in B around 0
lower-/.f644.8
Applied rewrites4.8%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f644.8
Applied rewrites14.6%
Taylor expanded in F around inf
Applied rewrites65.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6447.3
Applied rewrites47.3%
(FPCore (F B x)
:precision binary64
(if (<= F -5.5e+160)
(/ (- -1.0 x) B)
(if (<= F 7.6e+173)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.5e+160) {
tmp = (-1.0 - x) / B;
} else if (F <= 7.6e+173) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.5e+160) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 7.6e+173) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.5e+160], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7.6e+173], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.5 \cdot 10^{+160}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 7.6 \cdot 10^{+173}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.5e160Initial program 25.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6433.5
Applied rewrites33.5%
Taylor expanded in F around -inf
Applied rewrites57.5%
if -5.5e160 < F < 7.60000000000000022e173Initial program 92.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6452.3
Applied rewrites52.3%
Applied rewrites52.3%
if 7.60000000000000022e173 < F Initial program 37.3%
Taylor expanded in B around 0
lower-/.f644.8
Applied rewrites4.8%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f644.8
Applied rewrites14.6%
Taylor expanded in F around inf
Applied rewrites65.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6447.3
Applied rewrites47.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.96e-47) (/ (- -1.0 x) B) (if (<= F 9.5e-27) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.96e-47) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-27) {
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 <= (-1.96d-47)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9.5d-27) 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 <= -1.96e-47) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-27) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.96e-47: tmp = (-1.0 - x) / B elif F <= 9.5e-27: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.96e-47) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9.5e-27) 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 <= -1.96e-47) tmp = (-1.0 - x) / B; elseif (F <= 9.5e-27) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.96e-47], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e-27], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.96 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-27}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.9600000000000001e-47Initial program 60.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6441.2
Applied rewrites41.2%
Taylor expanded in F around -inf
Applied rewrites47.6%
if -1.9600000000000001e-47 < F < 9.50000000000000037e-27Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6459.7
Applied rewrites59.7%
Taylor expanded in F around 0
Applied rewrites41.2%
if 9.50000000000000037e-27 < F Initial program 64.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6431.0
Applied rewrites31.0%
Taylor expanded in F around inf
Applied rewrites42.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.96e-47) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.96e-47) {
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 <= (-1.96d-47)) 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 <= -1.96e-47) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.96e-47: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.96e-47) 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 <= -1.96e-47) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.96e-47], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.96 \cdot 10^{-47}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.9600000000000001e-47Initial program 60.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6441.2
Applied rewrites41.2%
Taylor expanded in F around -inf
Applied rewrites47.6%
if -1.9600000000000001e-47 < F Initial program 83.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6446.4
Applied rewrites46.4%
Taylor expanded in F around 0
Applied rewrites32.5%
(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.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6444.7
Applied rewrites44.7%
Taylor expanded in F around 0
Applied rewrites31.2%
herbie shell --seed 2024304
(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))))))