
(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 21 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 -2e+107)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 3850000.0)
(fma F (/ (sqrt (pow (fma F F 2.0) -1.0)) (sin B)) (/ (- x) (tan B)))
(+ (* x (/ -1.0 (tan B))) (pow (sin B) -1.0)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+107) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 3850000.0) {
tmp = fma(F, (sqrt(pow(fma(F, F, 2.0), -1.0)) / sin(B)), (-x / tan(B)));
} else {
tmp = (x * (-1.0 / tan(B))) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+107) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 3850000.0) tmp = fma(F, Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+107], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3850000.0], N[(F * N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(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}
\mathbf{if}\;F \leq -2 \cdot 10^{+107}:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 3850000:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.9999999999999999e107Initial program 42.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites53.7%
Applied rewrites53.7%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -1.9999999999999999e107 < F < 3.85e6Initial program 98.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
if 3.85e6 < F Initial program 66.6%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1
(+
t_0
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0)))))
(t_2
(+ t_0 (* (/ F B) (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))))
(if (<= t_1 -1e+14)
t_2
(if (<= t_1 -1e-38)
(fma
F
(/ (sqrt (pow (fma F F 2.0) -1.0)) (sin B))
(/ (- x) (* (fma 0.3333333333333333 (* B B) 1.0) B)))
(if (<= t_1 INFINITY) t_2 (/ (- -1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = t_0 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double t_2 = t_0 + ((F / B) * sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)));
double tmp;
if (t_1 <= -1e+14) {
tmp = t_2;
} else if (t_1 <= -1e-38) {
tmp = fma(F, (sqrt(pow(fma(F, F, 2.0), -1.0)) / sin(B)), (-x / (fma(0.3333333333333333, (B * B), 1.0) * B)));
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (-1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) t_2 = Float64(t_0 + Float64(Float64(F / B) * sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)))) tmp = 0.0 if (t_1 <= -1e+14) tmp = t_2; elseif (t_1 <= -1e-38) tmp = fma(F, Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) / sin(B)), Float64(Float64(-x) / Float64(fma(0.3333333333333333, Float64(B * B), 1.0) * B))); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(-1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(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[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+14], t$95$2, If[LessEqual[t$95$1, -1e-38], N[(F * N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := t\_0 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_2 := t\_0 + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-38}:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}}{\sin B}, \frac{-x}{\mathsf{fma}\left(0.3333333333333333, B \cdot B, 1\right) \cdot B}\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1e14 or -9.9999999999999996e-39 < (+.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)))))) < +inf.0Initial program 85.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6477.2
Applied rewrites77.2%
if -1e14 < (+.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.9999999999999996e-39Initial program 97.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites97.3%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6497.2
Applied rewrites97.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.7
Applied rewrites86.7%
if +inf.0 < (+.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 0.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6461.2
Applied rewrites61.2%
Taylor expanded in F around -inf
Applied rewrites92.0%
Final simplification79.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<=
(+
t_0
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))
INFINITY)
(+ t_0 (* (/ F B) (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(/ (- -1.0 x) B))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if ((t_0 + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)))) <= ((double) INFINITY)) {
tmp = t_0 + ((F / B) * sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)));
} else {
tmp = (-1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) <= Inf) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)))); else tmp = Float64(Float64(-1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$0 + 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], Infinity], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;t\_0 + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)} \leq \infty:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < +inf.0Initial program 86.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6474.4
Applied rewrites74.4%
if +inf.0 < (+.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 0.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6461.2
Applied rewrites61.2%
Taylor expanded in F around -inf
Applied rewrites92.0%
Final simplification76.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -1e+154)
(/ (- -1.0 t_0) (sin B))
(if (<= F 2000000000000.0)
(/ (- (/ F (sqrt (fma F F 2.0))) t_0) (sin B))
(+ (* x (/ -1.0 (tan B))) (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -1e+154) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 2000000000000.0) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - t_0) / sin(B);
} else {
tmp = (x * (-1.0 / tan(B))) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -1e+154) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 2000000000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - t_0) / sin(B)); 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[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -1e+154], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2000000000000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(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 := \cos B \cdot x\\
\mathbf{if}\;F \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 2000000000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.00000000000000004e154Initial program 29.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites41.7%
Applied rewrites41.6%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -1.00000000000000004e154 < F < 2e12Initial program 98.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.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 2e12 < F Initial program 65.6%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.5)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 1.4)
(fma F (/ (sqrt 0.5) (sin B)) (/ (- x) (tan B)))
(+ (* x (/ -1.0 (tan B))) (pow (sin B) -1.0)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 1.4) {
tmp = fma(F, (sqrt(0.5) / sin(B)), (-x / tan(B)));
} else {
tmp = (x * (-1.0 / tan(B))) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.5) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 1.4) tmp = fma(F, Float64(sqrt(0.5) / sin(B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.5], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.4], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(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}
\mathbf{if}\;F \leq -1.5:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\mathsf{fma}\left(F, \frac{\sqrt{0.5}}{\sin B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.5Initial program 51.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites62.8%
Applied rewrites62.8%
Taylor expanded in F around -inf
Applied rewrites99.3%
if -1.5 < F < 1.3999999999999999Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in F around 0
Applied rewrites98.4%
if 1.3999999999999999 < F Initial program 67.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6498.8
Applied rewrites98.8%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -50000.0)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 650.0)
(+ t_0 (* (/ F B) (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(+ t_0 (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -50000.0) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 650.0) {
tmp = t_0 + ((F / B) * sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)));
} else {
tmp = t_0 + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -50000.0) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 650.0) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)))); else tmp = Float64(t_0 + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -50000.0], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 650.0], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -50000:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 650:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -5e4Initial program 51.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites62.2%
Applied rewrites62.2%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -5e4 < F < 650Initial program 99.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.6
Applied rewrites86.6%
if 650 < F Initial program 66.6%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification93.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(if (<= B 0.0051)
(/
(-
(fma
(fma 0.5 x (* 0.16666666666666666 (fma t_0 F (- x))))
(* B B)
(* t_0 F))
x)
B)
(/ (- x) (tan B)))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0));
double tmp;
if (B <= 0.0051) {
tmp = (fma(fma(0.5, x, (0.16666666666666666 * fma(t_0, F, -x))), (B * B), (t_0 * F)) - x) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) tmp = 0.0 if (B <= 0.0051) tmp = Float64(Float64(fma(fma(0.5, x, Float64(0.16666666666666666 * fma(t_0, F, Float64(-x)))), Float64(B * B), Float64(t_0 * F)) - x) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.0051], N[(N[(N[(N[(0.5 * x + N[(0.16666666666666666 * N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{if}\;B \leq 0.0051:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, 0.16666666666666666 \cdot \mathsf{fma}\left(t\_0, F, -x\right)\right), B \cdot B, t\_0 \cdot F\right) - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 0.0051000000000000004Initial program 76.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.4%
Applied rewrites85.4%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites55.0%
if 0.0051000000000000004 < B Initial program 83.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6465.3
Applied rewrites65.3%
Applied rewrites65.5%
Final simplification57.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(if (<= B 0.0051)
(/
(fma
t_0
F
(-
(*
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B))
x))
B)
(/ (- x) (tan B)))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0));
double tmp;
if (B <= 0.0051) {
tmp = fma(t_0, F, ((fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)) * (B * B)) - x)) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) tmp = 0.0 if (B <= 0.0051) tmp = Float64(fma(t_0, F, Float64(Float64(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)) * Float64(B * B)) - x)) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.0051], N[(N[(t$95$0 * F + N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{if}\;B \leq 0.0051:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right) - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 0.0051000000000000004Initial program 76.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites55.0%
if 0.0051000000000000004 < B Initial program 83.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6465.3
Applied rewrites65.3%
Applied rewrites65.5%
Final simplification57.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -50000.0)
(/ (- -1.0 t_0) (sin B))
(if (<= F 650.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -50000.0) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 650.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -50000.0) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 650.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)))); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -50000.0], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 650.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -50000:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 650:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -5e4Initial program 51.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites62.2%
Applied rewrites62.2%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -5e4 < F < 650Initial program 99.4%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.6
Applied rewrites86.6%
if 650 < F Initial program 66.6%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
Applied rewrites99.6%
Final simplification93.5%
(FPCore (F B x)
:precision binary64
(if (<= F -9e+135)
(/ (- -1.0 x) B)
(if (<= F 650.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e+135) {
tmp = (-1.0 - x) / B;
} else if (F <= 650.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e+135) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 650.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e+135], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 650.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{+135}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 650:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -9.00000000000000014e135Initial program 33.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6424.8
Applied rewrites24.8%
Taylor expanded in F around -inf
Applied rewrites48.1%
if -9.00000000000000014e135 < F < 650Initial program 98.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.5
Applied rewrites83.5%
if 650 < F Initial program 66.6%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
Applied rewrites99.6%
Final simplification81.6%
(FPCore (F B x)
:precision binary64
(if (<= B 180000.0)
(/
(- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (fma (* (* B B) x) -0.5 x))
(sin B))
(/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 180000.0) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - fma(((B * B) * x), -0.5, x)) / sin(B);
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 180000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - fma(Float64(Float64(B * B) * x), -0.5, x)) / sin(B)); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 180000.0], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * -0.5 + x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 180000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \mathsf{fma}\left(\left(B \cdot B\right) \cdot x, -0.5, x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 1.8e5Initial program 76.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites85.5%
Applied rewrites85.5%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6456.0
Applied rewrites56.0%
if 1.8e5 < B Initial program 82.9%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6466.2
Applied rewrites66.2%
Applied rewrites66.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2.7)
(/ (fma (/ (fma 2.0 x 2.0) (* F F)) 0.5 (- -1.0 x)) B)
(if (<= F 0.00041)
(/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7) {
tmp = fma((fma(2.0, x, 2.0) / (F * F)), 0.5, (-1.0 - x)) / B;
} else if (F <= 0.00041) {
tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.7) tmp = Float64(fma(Float64(fma(2.0, x, 2.0) / Float64(F * F)), 0.5, Float64(-1.0 - x)) / B); elseif (F <= 0.00041) tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.7], N[(N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.00041], N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 0.5, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 0.00041:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -2.7000000000000002Initial program 51.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6428.7
Applied rewrites28.7%
Taylor expanded in F around -inf
Applied rewrites45.1%
if -2.7000000000000002 < F < 4.0999999999999999e-4Initial 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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6454.1
Applied rewrites54.1%
Taylor expanded in F around 0
Applied rewrites54.1%
if 4.0999999999999999e-4 < F Initial program 67.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6436.3
Applied rewrites36.3%
Taylor expanded in F around inf
Applied rewrites41.4%
Applied rewrites41.8%
Final simplification48.2%
(FPCore (F B x) :precision binary64 (if (<= B 2.35e-5) (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.35e-5) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.35e-5) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.35e-5], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.35 \cdot 10^{-5}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 2.34999999999999986e-5Initial program 76.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6455.4
Applied rewrites55.4%
Applied rewrites55.5%
if 2.34999999999999986e-5 < B Initial program 83.2%
Taylor expanded in F around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6465.3
Applied rewrites65.3%
Applied rewrites65.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+59)
(/ (- -1.0 x) B)
(if (<= F 2e+72)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+59) {
tmp = (-1.0 - x) / B;
} else if (F <= 2e+72) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+59) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2e+72) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+59], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2e+72], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+59}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+72}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -9.99999999999999972e58Initial program 47.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6429.6
Applied rewrites29.6%
Taylor expanded in F around -inf
Applied rewrites47.6%
if -9.99999999999999972e58 < F < 1.99999999999999989e72Initial program 98.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6452.4
Applied rewrites52.4%
Applied rewrites52.4%
if 1.99999999999999989e72 < F Initial program 57.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6430.3
Applied rewrites30.3%
Taylor expanded in F around inf
Applied rewrites38.5%
Applied rewrites39.0%
Final simplification48.5%
(FPCore (F B x)
:precision binary64
(if (<= F -6.6e-46)
(/ (- -1.0 x) B)
(if (<= F 1.9e-205)
(/ (- x) B)
(if (<= F 6e-6)
(/ (fma (sqrt (fma -0.5 x 0.5)) F (- x)) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-46) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.9e-205) {
tmp = -x / B;
} else if (F <= 6e-6) {
tmp = fma(sqrt(fma(-0.5, x, 0.5)), F, -x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.6e-46) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.9e-205) tmp = Float64(Float64(-x) / B); elseif (F <= 6e-6) tmp = Float64(fma(sqrt(fma(-0.5, x, 0.5)), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.6e-46], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-205], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 6e-6], N[(N[(N[Sqrt[N[(-0.5 * x + 0.5), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{-46}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-205}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-6}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(-0.5, x, 0.5\right)}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -6.60000000000000027e-46Initial program 56.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6430.2
Applied rewrites30.2%
Taylor expanded in F around -inf
Applied rewrites42.1%
if -6.60000000000000027e-46 < F < 1.89999999999999996e-205Initial program 99.5%
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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6450.7
Applied rewrites50.7%
Taylor expanded in F around 0
Applied rewrites42.0%
if 1.89999999999999996e-205 < F < 6.0000000000000002e-6Initial program 99.5%
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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6462.4
Applied rewrites62.4%
Taylor expanded in F around 0
Applied rewrites62.4%
Taylor expanded in x around 0
Applied rewrites48.8%
if 6.0000000000000002e-6 < F Initial program 67.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6436.3
Applied rewrites36.3%
Taylor expanded in F around inf
Applied rewrites41.4%
Applied rewrites41.8%
Final simplification42.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+60)
(/ (- -1.0 x) B)
(if (<= F 6e-6)
(/ (fma (sqrt (fma (fma 0.5 x -0.5) x 0.5)) F (- x)) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+60) {
tmp = (-1.0 - x) / B;
} else if (F <= 6e-6) {
tmp = fma(sqrt(fma(fma(0.5, x, -0.5), x, 0.5)), F, -x) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+60) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 6e-6) tmp = Float64(fma(sqrt(fma(fma(0.5, x, -0.5), x, 0.5)), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+60], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6e-6], N[(N[(N[Sqrt[N[(N[(0.5 * x + -0.5), $MachinePrecision] * x + 0.5), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+60}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-6}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(0.5, x, -0.5\right), x, 0.5\right)}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -1.35e60Initial program 45.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6430.5
Applied rewrites30.5%
Taylor expanded in F around -inf
Applied rewrites49.1%
if -1.35e60 < F < 6.0000000000000002e-6Initial 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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6451.6
Applied rewrites51.6%
Taylor expanded in F around 0
Applied rewrites50.9%
Taylor expanded in x around 0
Applied rewrites47.6%
if 6.0000000000000002e-6 < F Initial program 67.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6436.3
Applied rewrites36.3%
Taylor expanded in F around inf
Applied rewrites41.4%
Applied rewrites41.8%
Final simplification46.3%
(FPCore (F B x)
:precision binary64
(if (<= F -6.6e-46)
(/ (- -1.0 x) B)
(if (<= F 9.5e-62)
(/ (- x) B)
(if (<= F 3e-6)
(/ (* (sqrt 0.5) F) B)
(/ (/ (- 1.0 (* x x)) (+ 1.0 x)) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-46) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-62) {
tmp = -x / B;
} else if (F <= 3e-6) {
tmp = (sqrt(0.5) * F) / B;
} else {
tmp = ((1.0 - (x * x)) / (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 <= (-6.6d-46)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9.5d-62) then
tmp = -x / b
else if (f <= 3d-6) then
tmp = (sqrt(0.5d0) * f) / b
else
tmp = ((1.0d0 - (x * x)) / (1.0d0 + x)) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-46) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-62) {
tmp = -x / B;
} else if (F <= 3e-6) {
tmp = (Math.sqrt(0.5) * F) / B;
} else {
tmp = ((1.0 - (x * x)) / (1.0 + x)) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.6e-46: tmp = (-1.0 - x) / B elif F <= 9.5e-62: tmp = -x / B elif F <= 3e-6: tmp = (math.sqrt(0.5) * F) / B else: tmp = ((1.0 - (x * x)) / (1.0 + x)) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.6e-46) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9.5e-62) tmp = Float64(Float64(-x) / B); elseif (F <= 3e-6) tmp = Float64(Float64(sqrt(0.5) * F) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(x * x)) / Float64(1.0 + x)) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -6.6e-46) tmp = (-1.0 - x) / B; elseif (F <= 9.5e-62) tmp = -x / B; elseif (F <= 3e-6) tmp = (sqrt(0.5) * F) / B; else tmp = ((1.0 - (x * x)) / (1.0 + x)) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.6e-46], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e-62], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 3e-6], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(1.0 + x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{-46}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1 - x \cdot x}{1 + x}}{B}\\
\end{array}
\end{array}
if F < -6.60000000000000027e-46Initial program 56.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6430.2
Applied rewrites30.2%
Taylor expanded in F around -inf
Applied rewrites42.1%
if -6.60000000000000027e-46 < F < 9.49999999999999951e-62Initial program 99.5%
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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6454.1
Applied rewrites54.1%
Taylor expanded in F around 0
Applied rewrites41.3%
if 9.49999999999999951e-62 < F < 3.0000000000000001e-6Initial program 99.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6460.9
Applied rewrites60.9%
Taylor expanded in x around 0
Applied rewrites60.9%
Taylor expanded in F around 0
Applied rewrites60.9%
if 3.0000000000000001e-6 < F Initial program 67.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6436.3
Applied rewrites36.3%
Taylor expanded in F around inf
Applied rewrites41.4%
Applied rewrites41.8%
Final simplification42.4%
(FPCore (F B x)
:precision binary64
(if (<= F -6.6e-46)
(/ (- -1.0 x) B)
(if (<= F 9.5e-62)
(/ (- x) B)
(if (<= F 3e-6) (/ (* (sqrt 0.5) F) B) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-46) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-62) {
tmp = -x / B;
} else if (F <= 3e-6) {
tmp = (sqrt(0.5) * F) / 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 <= (-6.6d-46)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9.5d-62) then
tmp = -x / b
else if (f <= 3d-6) then
tmp = (sqrt(0.5d0) * f) / 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 <= -6.6e-46) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.5e-62) {
tmp = -x / B;
} else if (F <= 3e-6) {
tmp = (Math.sqrt(0.5) * F) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.6e-46: tmp = (-1.0 - x) / B elif F <= 9.5e-62: tmp = -x / B elif F <= 3e-6: tmp = (math.sqrt(0.5) * F) / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.6e-46) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9.5e-62) tmp = Float64(Float64(-x) / B); elseif (F <= 3e-6) tmp = Float64(Float64(sqrt(0.5) * F) / 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 <= -6.6e-46) tmp = (-1.0 - x) / B; elseif (F <= 9.5e-62) tmp = -x / B; elseif (F <= 3e-6) tmp = (sqrt(0.5) * F) / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.6e-46], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.5e-62], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 3e-6], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{-46}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 3 \cdot 10^{-6}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.60000000000000027e-46Initial program 56.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6430.2
Applied rewrites30.2%
Taylor expanded in F around -inf
Applied rewrites42.1%
if -6.60000000000000027e-46 < F < 9.49999999999999951e-62Initial program 99.5%
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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6454.1
Applied rewrites54.1%
Taylor expanded in F around 0
Applied rewrites41.3%
if 9.49999999999999951e-62 < F < 3.0000000000000001e-6Initial program 99.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6460.9
Applied rewrites60.9%
Taylor expanded in x around 0
Applied rewrites60.9%
Taylor expanded in F around 0
Applied rewrites60.9%
if 3.0000000000000001e-6 < F Initial program 67.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6436.3
Applied rewrites36.3%
Taylor expanded in F around inf
Applied rewrites41.4%
Final simplification42.3%
(FPCore (F B x) :precision binary64 (if (<= F -6.6e-46) (/ (- -1.0 x) B) (if (<= F 4.5e-61) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.6e-46) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.5e-61) {
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 <= (-6.6d-46)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.5d-61) 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 <= -6.6e-46) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.5e-61) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.6e-46: tmp = (-1.0 - x) / B elif F <= 4.5e-61: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.6e-46) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.5e-61) 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 <= -6.6e-46) tmp = (-1.0 - x) / B; elseif (F <= 4.5e-61) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.6e-46], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.5e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.6 \cdot 10^{-46}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.60000000000000027e-46Initial program 56.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6430.2
Applied rewrites30.2%
Taylor expanded in F around -inf
Applied rewrites42.1%
if -6.60000000000000027e-46 < F < 4.5e-61Initial program 99.5%
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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6454.1
Applied rewrites54.1%
Taylor expanded in F around 0
Applied rewrites41.3%
if 4.5e-61 < F Initial program 71.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites37.2%
Final simplification40.2%
(FPCore (F B x) :precision binary64 (if (<= F 4.5e-61) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 4.5e-61) {
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 <= 4.5d-61) 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 <= 4.5e-61) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 4.5e-61: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 4.5e-61) 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 <= 4.5e-61) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 4.5e-61], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 4.5e-61Initial program 81.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6443.9
Applied rewrites43.9%
Taylor expanded in F around 0
Applied rewrites31.4%
if 4.5e-61 < F Initial program 71.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
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites37.2%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(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 78.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6442.4
Applied rewrites42.4%
Taylor expanded in F around 0
Applied rewrites27.2%
herbie shell --seed 2024305
(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))))))