
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (/ -1.0 (sin B))))
(if (<= F -1.15e+34)
(+ (* x (/ -1.0 (tan B))) t_1)
(if (<= F 5000000000000.0)
(fma (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) F t_0)
(fma -1.0 t_1 t_0)))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = -1.0 / sin(B);
double tmp;
if (F <= -1.15e+34) {
tmp = (x * (-1.0 / tan(B))) + t_1;
} else if (F <= 5000000000000.0) {
tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, t_0);
} else {
tmp = fma(-1.0, t_1, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -1.15e+34) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + t_1); elseif (F <= 5000000000000.0) tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, t_0); else tmp = fma(-1.0, t_1, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.15e+34], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 5000000000000.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 + t$95$0), $MachinePrecision], N[(-1.0 * t$95$1 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -1.15 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_1\\
\mathbf{elif}\;F \leq 5000000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_1, t\_0\right)\\
\end{array}
\end{array}
if F < -1.1499999999999999e34Initial program 57.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -1.1499999999999999e34 < F < 5e12Initial program 99.5%
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 5e12 < F Initial program 61.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites71.0%
Taylor expanded in F around inf
Applied rewrites99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1 (+ t_0 (* (/ F B) (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)))))
(t_2 (/ F (sin B)))
(t_3 (+ t_0 (* t_2 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
(if (<= t_3 -1e-205)
t_1
(if (<= t_3 5e-165)
(pow (sin B) -1.0)
(if (<= t_3 20.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_2)
(if (<= t_3 2e+283)
t_1
(- (/ (+ 1.0 x) (* (* F F) B)) (/ (+ 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 / B) * sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)));
double t_2 = F / sin(B);
double t_3 = t_0 + (t_2 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double tmp;
if (t_3 <= -1e-205) {
tmp = t_1;
} else if (t_3 <= 5e-165) {
tmp = pow(sin(B), -1.0);
} else if (t_3 <= 20.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_2;
} else if (t_3 <= 2e+283) {
tmp = t_1;
} else {
tmp = ((1.0 + x) / ((F * F) * B)) - ((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 / B) * sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)))) t_2 = Float64(F / sin(B)) t_3 = Float64(t_0 + Float64(t_2 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_3 <= -1e-205) tmp = t_1; elseif (t_3 <= 5e-165) tmp = sin(B) ^ -1.0; elseif (t_3 <= 20.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_2); elseif (t_3 <= 2e+283) tmp = t_1; else tmp = Float64(Float64(Float64(1.0 + x) / Float64(Float64(F * F) * B)) - 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 / B), $MachinePrecision] * N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(t$95$2 * 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$3, -1e-205], t$95$1, If[LessEqual[t$95$3, 5e-165], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[t$95$3, 20.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 2e+283], t$95$1, N[(N[(N[(1.0 + x), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := t\_0 + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\
t_2 := \frac{F}{\sin B}\\
t_3 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-165}:\\
\;\;\;\;{\sin B}^{-1}\\
\mathbf{elif}\;t\_3 \leq 20:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_2\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+283}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + x}{\left(F \cdot F\right) \cdot B} - \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)))))) < -1e-205 or 20 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.99999999999999991e283Initial program 95.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6483.2
Applied rewrites83.2%
if -1e-205 < (+.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)))))) < 4.99999999999999981e-165Initial program 15.3%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites15.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6415.0
Applied rewrites15.0%
Taylor expanded in F around inf
Applied rewrites69.3%
if 4.99999999999999981e-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)))))) < 20Initial program 91.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6447.4
Applied rewrites47.4%
if 1.99999999999999991e283 < (+.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.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
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%
Taylor expanded in F around 0
Applied rewrites52.3%
Taylor expanded in F around -inf
Applied rewrites68.4%
Final simplification75.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (/ -1.0 (sin B))))
(if (<= F -1e+91)
(+ (* x (/ -1.0 (tan B))) t_1)
(if (<= F 10000000.0)
(fma (* (- F) (sqrt (pow (fma F F 2.0) -1.0))) t_1 t_0)
(fma -1.0 t_1 t_0)))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = -1.0 / sin(B);
double tmp;
if (F <= -1e+91) {
tmp = (x * (-1.0 / tan(B))) + t_1;
} else if (F <= 10000000.0) {
tmp = fma((-F * sqrt(pow(fma(F, F, 2.0), -1.0))), t_1, t_0);
} else {
tmp = fma(-1.0, t_1, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -1e+91) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + t_1); elseif (F <= 10000000.0) tmp = fma(Float64(Float64(-F) * sqrt((fma(F, F, 2.0) ^ -1.0))), t_1, t_0); else tmp = fma(-1.0, t_1, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+91], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 10000000.0], N[(N[((-F) * N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision], N[(-1.0 * t$95$1 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+91}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_1\\
\mathbf{elif}\;F \leq 10000000:\\
\;\;\;\;\mathsf{fma}\left(\left(-F\right) \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, t\_1, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_1, t\_0\right)\\
\end{array}
\end{array}
if F < -1.00000000000000008e91Initial program 45.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -1.00000000000000008e91 < F < 1e7Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/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%
if 1e7 < F Initial program 62.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites71.4%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+33)
(+
(* (- x) (pow B -1.0))
(-
(fma
(*
(/ (fma -0.16666666666666666 (* B B) -1.0) B)
(/ (fma 2.0 x 2.0) (* F F)))
-0.5
(* -0.16666666666666666 B))
(pow B -1.0)))
(if (<= F 2.7e+134)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(pow (sin B) -1.0))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+33) {
tmp = (-x * pow(B, -1.0)) + (fma(((fma(-0.16666666666666666, (B * B), -1.0) / B) * (fma(2.0, x, 2.0) / (F * F))), -0.5, (-0.16666666666666666 * B)) - pow(B, -1.0));
} else if (F <= 2.7e+134) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+33) tmp = Float64(Float64(Float64(-x) * (B ^ -1.0)) + Float64(fma(Float64(Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B) * Float64(fma(2.0, x, 2.0) / Float64(F * F))), -0.5, Float64(-0.16666666666666666 * B)) - (B ^ -1.0))); elseif (F <= 2.7e+134) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+33], N[(N[((-x) * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(-0.16666666666666666 * B), $MachinePrecision]), $MachinePrecision] - N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.7e+134], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+33}:\\
\;\;\;\;\left(-x\right) \cdot {B}^{-1} + \left(\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, -0.5, -0.16666666666666666 \cdot B\right) - {B}^{-1}\right)\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+134}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if F < -4.99999999999999973e33Initial program 58.4%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites40.9%
Taylor expanded in B around 0
lower-/.f6440.9
Applied rewrites40.9%
Taylor expanded in F around -inf
Applied rewrites65.2%
if -4.99999999999999973e33 < F < 2.7e134Initial program 97.7%
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.f6455.9
Applied rewrites55.9%
Applied rewrites56.0%
if 2.7e134 < F Initial program 38.1%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites38.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6413.4
Applied rewrites13.4%
Taylor expanded in F around inf
Applied rewrites64.7%
Final simplification59.5%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+33)
(+
(* (- x) (pow B -1.0))
(-
(fma
(*
(/ (fma -0.16666666666666666 (* B B) -1.0) B)
(/ (fma 2.0 x 2.0) (* F F)))
-0.5
(* -0.16666666666666666 B))
(pow B -1.0)))
(if (<= F 2.35e+173)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(fma (/ -0.5 (* F F)) (/ (fma 2.0 x 2.0) B) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+33) {
tmp = (-x * pow(B, -1.0)) + (fma(((fma(-0.16666666666666666, (B * B), -1.0) / B) * (fma(2.0, x, 2.0) / (F * F))), -0.5, (-0.16666666666666666 * B)) - pow(B, -1.0));
} else if (F <= 2.35e+173) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = fma((-0.5 / (F * F)), (fma(2.0, x, 2.0) / B), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+33) tmp = Float64(Float64(Float64(-x) * (B ^ -1.0)) + Float64(fma(Float64(Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B) * Float64(fma(2.0, x, 2.0) / Float64(F * F))), -0.5, Float64(-0.16666666666666666 * B)) - (B ^ -1.0))); elseif (F <= 2.35e+173) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = fma(Float64(-0.5 / Float64(F * F)), Float64(fma(2.0, x, 2.0) / B), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+33], N[(N[((-x) * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -0.5 + N[(-0.16666666666666666 * B), $MachinePrecision]), $MachinePrecision] - N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.35e+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[(-0.5 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / B), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+33}:\\
\;\;\;\;\left(-x\right) \cdot {B}^{-1} + \left(\mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B} \cdot \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, -0.5, -0.16666666666666666 \cdot B\right) - {B}^{-1}\right)\\
\mathbf{elif}\;F \leq 2.35 \cdot 10^{+173}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.5}{F \cdot F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{B}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -4.99999999999999973e33Initial program 58.4%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites40.9%
Taylor expanded in B around 0
lower-/.f6440.9
Applied rewrites40.9%
Taylor expanded in F around -inf
Applied rewrites65.2%
if -4.99999999999999973e33 < F < 2.35000000000000007e173Initial program 97.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.f6454.9
Applied rewrites54.9%
Applied rewrites54.9%
if 2.35000000000000007e173 < F Initial program 26.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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6416.6
Applied rewrites16.6%
Taylor expanded in F around inf
Applied rewrites41.0%
Final simplification56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))) (t_1 (/ -1.0 (sin B))))
(if (<= F -62000.0)
(+ t_0 t_1)
(if (<= F 4200.0)
(+ t_0 (* (/ F B) (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))))
(fma -1.0 t_1 (/ (- x) (tan B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = -1.0 / sin(B);
double tmp;
if (F <= -62000.0) {
tmp = t_0 + t_1;
} else if (F <= 4200.0) {
tmp = t_0 + ((F / B) * sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)));
} else {
tmp = fma(-1.0, t_1, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -62000.0) tmp = Float64(t_0 + t_1); elseif (F <= 4200.0) tmp = Float64(t_0 + Float64(Float64(F / B) * sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)))); else tmp = fma(-1.0, t_1, Float64(Float64(-x) / tan(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[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -62000.0], N[(t$95$0 + t$95$1), $MachinePrecision], If[LessEqual[F, 4200.0], N[(t$95$0 + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * t$95$1 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -62000:\\
\;\;\;\;t\_0 + t\_1\\
\mathbf{elif}\;F \leq 4200:\\
\;\;\;\;t\_0 + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_1, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -62000Initial program 60.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -62000 < F < 4200Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6482.4
Applied rewrites82.4%
if 4200 < F Initial program 62.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites71.4%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification91.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2.3e+155)
(+ (* (- x) (pow B -1.0)) (/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 4200.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))))
(fma -1.0 (/ -1.0 (sin B)) (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e+155) {
tmp = (-x * pow(B, -1.0)) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 4200.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)));
} else {
tmp = fma(-1.0, (-1.0 / sin(B)), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.3e+155) tmp = Float64(Float64(Float64(-x) * (B ^ -1.0)) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 4200.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)))); else tmp = fma(-1.0, Float64(-1.0 / sin(B)), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.3e+155], N[(N[((-x) * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4200.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * 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 -2.3 \cdot 10^{+155}:\\
\;\;\;\;\left(-x\right) \cdot {B}^{-1} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 4200:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{\sin B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -2.29999999999999998e155Initial program 27.3%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites26.2%
Taylor expanded in B around 0
lower-/.f6426.1
Applied rewrites26.1%
Taylor expanded in F around -inf
Applied rewrites71.6%
if -2.29999999999999998e155 < F < 4200Initial program 98.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6479.9
Applied rewrites79.9%
if 4200 < F Initial program 62.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites71.4%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification83.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (sin B))))
(if (<= F -2.3e+155)
(+ (* x (/ -1.0 (tan B))) t_0)
(if (<= F 10000000.0)
(- (/ (/ F (sqrt (fma F F 2.0))) (sin B)) (/ x (tan B)))
(fma -1.0 t_0 (/ (- x) (tan B)))))))
double code(double F, double B, double x) {
double t_0 = -1.0 / sin(B);
double tmp;
if (F <= -2.3e+155) {
tmp = (x * (-1.0 / tan(B))) + t_0;
} else if (F <= 10000000.0) {
tmp = ((F / sqrt(fma(F, F, 2.0))) / sin(B)) - (x / tan(B));
} else {
tmp = fma(-1.0, t_0, (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -2.3e+155) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + t_0); elseif (F <= 10000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / sin(B)) - Float64(x / tan(B))); else tmp = fma(-1.0, t_0, Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e+155], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[F, 10000000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * t$95$0 + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{+155}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0\\
\mathbf{elif}\;F \leq 10000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_0, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -2.29999999999999998e155Initial program 27.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -2.29999999999999998e155 < F < 1e7Initial program 98.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/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 1e7 < F Initial program 62.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites71.4%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (/ -1.0 (sin B))))
(if (<= F -1.52)
(+ (* x (/ -1.0 (tan B))) t_1)
(if (<= F 0.003) (fma (* (- F) (sqrt 0.5)) t_1 t_0) (fma -1.0 t_1 t_0)))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = -1.0 / sin(B);
double tmp;
if (F <= -1.52) {
tmp = (x * (-1.0 / tan(B))) + t_1;
} else if (F <= 0.003) {
tmp = fma((-F * sqrt(0.5)), t_1, t_0);
} else {
tmp = fma(-1.0, t_1, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -1.52) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + t_1); elseif (F <= 0.003) tmp = fma(Float64(Float64(-F) * sqrt(0.5)), t_1, t_0); else tmp = fma(-1.0, t_1, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.52], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[F, 0.003], N[(N[((-F) * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] * t$95$1 + t$95$0), $MachinePrecision], N[(-1.0 * t$95$1 + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -1.52:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_1\\
\mathbf{elif}\;F \leq 0.003:\\
\;\;\;\;\mathsf{fma}\left(\left(-F\right) \cdot \sqrt{0.5}, t\_1, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, t\_1, t\_0\right)\\
\end{array}
\end{array}
if F < -1.52Initial program 61.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.5
Applied rewrites98.5%
if -1.52 < F < 0.0030000000000000001Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/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 rewrites99.2%
if 0.0030000000000000001 < F Initial program 64.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites73.1%
Taylor expanded in F around inf
Applied rewrites97.5%
Final simplification98.6%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.35e-16) (not (<= x 4.8e-76))) (/ (- x) (tan B)) (pow (/ (* (sqrt (fma F F 2.0)) (sin B)) F) -1.0)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.35e-16) || !(x <= 4.8e-76)) {
tmp = -x / tan(B);
} else {
tmp = pow(((sqrt(fma(F, F, 2.0)) * sin(B)) / F), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -1.35e-16) || !(x <= 4.8e-76)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(sqrt(fma(F, F, 2.0)) * sin(B)) / F) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.35e-16], N[Not[LessEqual[x, 4.8e-76]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision] / F), $MachinePrecision], -1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-16} \lor \neg \left(x \leq 4.8 \cdot 10^{-76}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}{F}\right)}^{-1}\\
\end{array}
\end{array}
if x < -1.35e-16 or 4.80000000000000026e-76 < x Initial program 89.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites97.0%
Taylor expanded in F around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6491.9
Applied rewrites91.9%
Applied rewrites92.0%
if -1.35e-16 < x < 4.80000000000000026e-76Initial program 71.0%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites70.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6454.7
Applied rewrites54.7%
Applied rewrites57.6%
Final simplification73.7%
(FPCore (F B x)
:precision binary64
(if (<= B 0.000195)
(+
(- (/ x B))
(/
(*
(sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))
(fma (* B B) (* 0.16666666666666666 F) F))
B))
(/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.000195) {
tmp = -(x / B) + ((sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * fma((B * B), (0.16666666666666666 * F), F)) / B);
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.000195) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * fma(Float64(B * B), Float64(0.16666666666666666 * F), F)) / B)); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.000195], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.000195:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 1.94999999999999996e-4Initial program 77.6%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites63.0%
Taylor expanded in B around 0
lower-/.f6460.4
Applied rewrites60.4%
if 1.94999999999999996e-4 < B Initial program 86.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites86.9%
Taylor expanded in F around 0
associate-*r/N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6458.7
Applied rewrites58.7%
Applied rewrites58.8%
Final simplification60.0%
(FPCore (F B x)
:precision binary64
(if (<= F -43.0)
(- (/ (+ 1.0 x) (* (* F F) B)) (/ (+ 1.0 x) B))
(if (<= F 290.0)
(/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -43.0) {
tmp = ((1.0 + x) / ((F * F) * B)) - ((1.0 + x) / B);
} else if (F <= 290.0) {
tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -43.0) tmp = Float64(Float64(Float64(1.0 + x) / Float64(Float64(F * F) * B)) - Float64(Float64(1.0 + x) / B)); elseif (F <= 290.0) tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -43.0], N[(N[(N[(1.0 + x), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 290.0], 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 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -43:\\
\;\;\;\;\frac{1 + x}{\left(F \cdot F\right) \cdot B} - \frac{1 + x}{B}\\
\mathbf{elif}\;F \leq 290:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -43Initial program 61.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.f6444.1
Applied rewrites44.1%
Taylor expanded in F around 0
Applied rewrites24.7%
Taylor expanded in F around -inf
Applied rewrites65.6%
if -43 < F < 290Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.8
Applied rewrites48.8%
Taylor expanded in F around 0
Applied rewrites48.5%
if 290 < F Initial program 63.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.f6447.9
Applied rewrites47.9%
Taylor expanded in F around inf
Applied rewrites56.6%
Final simplification55.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma F F 2.0))))
(if (<= F -28000000000000.0)
(+ (* (- x) (pow B -1.0)) (/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F -4.1e-53)
(pow (* t_0 (/ B F)) -1.0)
(if (<= F 5.4e-83)
(/ (- x) B)
(if (<= F 19500.0) (/ (/ F t_0) B) (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(F, F, 2.0));
double tmp;
if (F <= -28000000000000.0) {
tmp = (-x * pow(B, -1.0)) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= -4.1e-53) {
tmp = pow((t_0 * (B / F)), -1.0);
} else if (F <= 5.4e-83) {
tmp = -x / B;
} else if (F <= 19500.0) {
tmp = (F / t_0) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(F, F, 2.0)) tmp = 0.0 if (F <= -28000000000000.0) tmp = Float64(Float64(Float64(-x) * (B ^ -1.0)) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= -4.1e-53) tmp = Float64(t_0 * Float64(B / F)) ^ -1.0; elseif (F <= 5.4e-83) tmp = Float64(Float64(-x) / B); elseif (F <= 19500.0) tmp = Float64(Float64(F / t_0) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -28000000000000.0], N[(N[((-x) * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.1e-53], N[Power[N[(t$95$0 * N[(B / F), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision], If[LessEqual[F, 5.4e-83], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 19500.0], N[(N[(F / t$95$0), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(F, F, 2\right)}\\
\mathbf{if}\;F \leq -28000000000000:\\
\;\;\;\;\left(-x\right) \cdot {B}^{-1} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;{\left(t\_0 \cdot \frac{B}{F}\right)}^{-1}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 19500:\\
\;\;\;\;\frac{\frac{F}{t\_0}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.8e13Initial program 59.0%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites41.8%
Taylor expanded in B around 0
lower-/.f6441.8
Applied rewrites41.8%
Taylor expanded in F around -inf
Applied rewrites65.7%
if -2.8e13 < F < -4.1000000000000001e-53Initial program 99.1%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites99.2%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6478.9
Applied rewrites78.9%
Taylor expanded in B around 0
Applied rewrites58.2%
if -4.1000000000000001e-53 < F < 5.39999999999999982e-83Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites40.2%
if 5.39999999999999982e-83 < F < 19500Initial 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.f6456.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites46.5%
Applied rewrites46.6%
if 19500 < F Initial program 62.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.f6446.3
Applied rewrites46.3%
Taylor expanded in F around inf
Applied rewrites56.9%
Final simplification52.4%
(FPCore (F B x)
:precision binary64
(if (<= F -28000000000000.0)
(+ (* (- x) (pow B -1.0)) (/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F -4.1e-53)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F B))
(if (<= F 5.4e-83)
(/ (- x) B)
(if (<= F 19500.0) (/ (/ F (sqrt (fma F F 2.0))) B) (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -28000000000000.0) {
tmp = (-x * pow(B, -1.0)) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= -4.1e-53) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / B);
} else if (F <= 5.4e-83) {
tmp = -x / B;
} else if (F <= 19500.0) {
tmp = (F / sqrt(fma(F, F, 2.0))) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -28000000000000.0) tmp = Float64(Float64(Float64(-x) * (B ^ -1.0)) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= -4.1e-53) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / B)); elseif (F <= 5.4e-83) tmp = Float64(Float64(-x) / B); elseif (F <= 19500.0) tmp = Float64(Float64(F / sqrt(fma(F, F, 2.0))) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -28000000000000.0], N[(N[((-x) * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.1e-53], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e-83], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 19500.0], N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -28000000000000:\\
\;\;\;\;\left(-x\right) \cdot {B}^{-1} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 19500:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.8e13Initial program 59.0%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites41.8%
Taylor expanded in B around 0
lower-/.f6441.8
Applied rewrites41.8%
Taylor expanded in F around -inf
Applied rewrites65.7%
if -2.8e13 < F < -4.1000000000000001e-53Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6457.7
Applied rewrites57.7%
Taylor expanded in x around 0
Applied rewrites58.0%
if -4.1000000000000001e-53 < F < 5.39999999999999982e-83Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites40.2%
if 5.39999999999999982e-83 < F < 19500Initial 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.f6456.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites46.5%
Applied rewrites46.6%
if 19500 < F Initial program 62.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.f6446.3
Applied rewrites46.3%
Taylor expanded in F around inf
Applied rewrites56.9%
Final simplification52.4%
(FPCore (F B x)
:precision binary64
(if (<= F -28000000000000.0)
(/ (- -1.0 x) B)
(if (<= F -4.1e-53)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F B))
(if (<= F 5.4e-83)
(/ (- x) B)
(if (<= F 19500.0) (/ (/ F (sqrt (fma F F 2.0))) B) (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -28000000000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= -4.1e-53) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / B);
} else if (F <= 5.4e-83) {
tmp = -x / B;
} else if (F <= 19500.0) {
tmp = (F / sqrt(fma(F, F, 2.0))) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -28000000000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -4.1e-53) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / B)); elseif (F <= 5.4e-83) tmp = Float64(Float64(-x) / B); elseif (F <= 19500.0) tmp = Float64(Float64(F / sqrt(fma(F, F, 2.0))) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -28000000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.1e-53], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e-83], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 19500.0], N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -28000000000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 19500:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.8e13Initial program 59.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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6442.2
Applied rewrites42.2%
Taylor expanded in F around -inf
Applied rewrites65.2%
if -2.8e13 < F < -4.1000000000000001e-53Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6457.7
Applied rewrites57.7%
Taylor expanded in x around 0
Applied rewrites58.0%
if -4.1000000000000001e-53 < F < 5.39999999999999982e-83Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites40.2%
if 5.39999999999999982e-83 < F < 19500Initial 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.f6456.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites46.5%
Applied rewrites46.6%
if 19500 < F Initial program 62.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.f6446.3
Applied rewrites46.3%
Taylor expanded in F around inf
Applied rewrites56.9%
Final simplification52.3%
(FPCore (F B x)
:precision binary64
(if (<= F -6.8e+45)
(+ (* (- x) (pow B -1.0)) (/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 2.35e+173)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(fma (/ -0.5 (* F F)) (/ (fma 2.0 x 2.0) B) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.8e+45) {
tmp = (-x * pow(B, -1.0)) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 2.35e+173) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = fma((-0.5 / (F * F)), (fma(2.0, x, 2.0) / B), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.8e+45) tmp = Float64(Float64(Float64(-x) * (B ^ -1.0)) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 2.35e+173) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = fma(Float64(-0.5 / Float64(F * F)), Float64(fma(2.0, x, 2.0) / B), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.8e+45], N[(N[((-x) * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.35e+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[(-0.5 / N[(F * F), $MachinePrecision]), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / B), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8 \cdot 10^{+45}:\\
\;\;\;\;\left(-x\right) \cdot {B}^{-1} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 2.35 \cdot 10^{+173}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-0.5}{F \cdot F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{B}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -6.8e45Initial program 54.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites39.2%
Taylor expanded in B around 0
lower-/.f6439.2
Applied rewrites39.2%
Taylor expanded in F around -inf
Applied rewrites65.5%
if -6.8e45 < F < 2.35000000000000007e173Initial program 97.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.f6455.1
Applied rewrites55.1%
Applied rewrites55.1%
if 2.35000000000000007e173 < F Initial program 26.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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6416.6
Applied rewrites16.6%
Taylor expanded in F around inf
Applied rewrites41.0%
Final simplification56.0%
(FPCore (F B x)
:precision binary64
(if (<= F -6.8e+45)
(+ (* (- x) (pow B -1.0)) (/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F 2.35e+173)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.8e+45) {
tmp = (-x * pow(B, -1.0)) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= 2.35e+173) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.8e+45) tmp = Float64(Float64(Float64(-x) * (B ^ -1.0)) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= 2.35e+173) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.8e+45], N[(N[((-x) * N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.35e+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 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8 \cdot 10^{+45}:\\
\;\;\;\;\left(-x\right) \cdot {B}^{-1} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq 2.35 \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 - x}{B}\\
\end{array}
\end{array}
if F < -6.8e45Initial program 54.9%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites39.2%
Taylor expanded in B around 0
lower-/.f6439.2
Applied rewrites39.2%
Taylor expanded in F around -inf
Applied rewrites65.5%
if -6.8e45 < F < 2.35000000000000007e173Initial program 97.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.f6455.1
Applied rewrites55.1%
Applied rewrites55.1%
if 2.35000000000000007e173 < F Initial program 26.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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6416.6
Applied rewrites16.6%
Taylor expanded in F around inf
Applied rewrites41.0%
Final simplification56.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (/ F (sqrt (fma F F 2.0))) B)))
(if (<= F -28000000000000.0)
(/ (- -1.0 x) B)
(if (<= F -4.1e-53)
t_0
(if (<= F 5.4e-83)
(/ (- x) B)
(if (<= F 19500.0) t_0 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = (F / sqrt(fma(F, F, 2.0))) / B;
double tmp;
if (F <= -28000000000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= -4.1e-53) {
tmp = t_0;
} else if (F <= 5.4e-83) {
tmp = -x / B;
} else if (F <= 19500.0) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / sqrt(fma(F, F, 2.0))) / B) tmp = 0.0 if (F <= -28000000000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -4.1e-53) tmp = t_0; elseif (F <= 5.4e-83) tmp = Float64(Float64(-x) / B); elseif (F <= 19500.0) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -28000000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.1e-53], t$95$0, If[LessEqual[F, 5.4e-83], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 19500.0], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{B}\\
\mathbf{if}\;F \leq -28000000000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 19500:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.8e13Initial program 59.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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6442.2
Applied rewrites42.2%
Taylor expanded in F around -inf
Applied rewrites65.2%
if -2.8e13 < F < -4.1000000000000001e-53 or 5.39999999999999982e-83 < F < 19500Initial program 99.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.f6457.2
Applied rewrites57.2%
Taylor expanded in x around 0
Applied rewrites50.8%
Applied rewrites51.0%
if -4.1000000000000001e-53 < F < 5.39999999999999982e-83Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites40.2%
if 19500 < F Initial program 62.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.f6446.3
Applied rewrites46.3%
Taylor expanded in F around inf
Applied rewrites56.9%
Final simplification52.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.000106)
(/ (- -1.0 x) B)
(if (<= F -4.1e-53)
(/ (* (sqrt (fma -0.25 (* F F) 0.5)) F) B)
(if (<= F 5.4e-83)
(/ (- x) B)
(if (<= F 1.22e-20) (/ (* (sqrt 0.5) F) B) (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.000106) {
tmp = (-1.0 - x) / B;
} else if (F <= -4.1e-53) {
tmp = (sqrt(fma(-0.25, (F * F), 0.5)) * F) / B;
} else if (F <= 5.4e-83) {
tmp = -x / B;
} else if (F <= 1.22e-20) {
tmp = (sqrt(0.5) * F) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.000106) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -4.1e-53) tmp = Float64(Float64(sqrt(fma(-0.25, Float64(F * F), 0.5)) * F) / B); elseif (F <= 5.4e-83) tmp = Float64(Float64(-x) / B); elseif (F <= 1.22e-20) tmp = Float64(Float64(sqrt(0.5) * F) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.000106], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.1e-53], N[(N[(N[Sqrt[N[(-0.25 * N[(F * F), $MachinePrecision] + 0.5), $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.4e-83], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 1.22e-20], 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 -0.000106:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;\frac{\sqrt{\mathsf{fma}\left(-0.25, F \cdot F, 0.5\right)} \cdot F}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-20}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.06e-4Initial program 61.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.f6443.6
Applied rewrites43.6%
Taylor expanded in F around -inf
Applied rewrites63.7%
if -1.06e-4 < F < -4.1000000000000001e-53Initial program 99.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.f6456.1
Applied rewrites56.1%
Taylor expanded in x around 0
Applied rewrites56.2%
Taylor expanded in F around 0
Applied rewrites56.2%
if -4.1000000000000001e-53 < F < 5.39999999999999982e-83Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites40.2%
if 5.39999999999999982e-83 < F < 1.22000000000000003e-20Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6463.3
Applied rewrites63.3%
Taylor expanded in x around 0
Applied rewrites54.4%
Taylor expanded in F around 0
Applied rewrites54.4%
if 1.22000000000000003e-20 < F Initial program 66.7%
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.5
Applied rewrites46.5%
Taylor expanded in F around inf
Applied rewrites53.2%
Final simplification51.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (* (sqrt 0.5) F) B)))
(if (<= F -0.000102)
(/ (- -1.0 x) B)
(if (<= F -4.1e-53)
t_0
(if (<= F 5.4e-83)
(/ (- x) B)
(if (<= F 1.22e-20) t_0 (/ (- 1.0 x) B)))))))
double code(double F, double B, double x) {
double t_0 = (sqrt(0.5) * F) / B;
double tmp;
if (F <= -0.000102) {
tmp = (-1.0 - x) / B;
} else if (F <= -4.1e-53) {
tmp = t_0;
} else if (F <= 5.4e-83) {
tmp = -x / B;
} else if (F <= 1.22e-20) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = (sqrt(0.5d0) * f) / b
if (f <= (-0.000102d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-4.1d-53)) then
tmp = t_0
else if (f <= 5.4d-83) then
tmp = -x / b
else if (f <= 1.22d-20) then
tmp = t_0
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (Math.sqrt(0.5) * F) / B;
double tmp;
if (F <= -0.000102) {
tmp = (-1.0 - x) / B;
} else if (F <= -4.1e-53) {
tmp = t_0;
} else if (F <= 5.4e-83) {
tmp = -x / B;
} else if (F <= 1.22e-20) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = (math.sqrt(0.5) * F) / B tmp = 0 if F <= -0.000102: tmp = (-1.0 - x) / B elif F <= -4.1e-53: tmp = t_0 elif F <= 5.4e-83: tmp = -x / B elif F <= 1.22e-20: tmp = t_0 else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(Float64(sqrt(0.5) * F) / B) tmp = 0.0 if (F <= -0.000102) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -4.1e-53) tmp = t_0; elseif (F <= 5.4e-83) tmp = Float64(Float64(-x) / B); elseif (F <= 1.22e-20) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (sqrt(0.5) * F) / B; tmp = 0.0; if (F <= -0.000102) tmp = (-1.0 - x) / B; elseif (F <= -4.1e-53) tmp = t_0; elseif (F <= 5.4e-83) tmp = -x / B; elseif (F <= 1.22e-20) tmp = t_0; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -0.000102], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.1e-53], t$95$0, If[LessEqual[F, 5.4e-83], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 1.22e-20], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\sqrt{0.5} \cdot F}{B}\\
\mathbf{if}\;F \leq -0.000102:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.01999999999999999e-4Initial program 61.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.f6443.6
Applied rewrites43.6%
Taylor expanded in F around -inf
Applied rewrites63.7%
if -1.01999999999999999e-4 < F < -4.1000000000000001e-53 or 5.39999999999999982e-83 < F < 1.22000000000000003e-20Initial 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.f6460.4
Applied rewrites60.4%
Taylor expanded in x around 0
Applied rewrites55.1%
Taylor expanded in F around 0
Applied rewrites54.9%
if -4.1000000000000001e-53 < F < 5.39999999999999982e-83Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites40.2%
if 1.22000000000000003e-20 < F Initial program 66.7%
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.5
Applied rewrites46.5%
Taylor expanded in F around inf
Applied rewrites53.2%
Final simplification51.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.1e-45) (/ (- -1.0 x) B) (if (<= F 1e-82) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e-45) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-82) {
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.1d-45)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1d-82) 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.1e-45) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-82) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.1e-45: tmp = (-1.0 - x) / B elif F <= 1e-82: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.1e-45) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1e-82) 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.1e-45) tmp = (-1.0 - x) / B; elseif (F <= 1e-82) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.1e-45], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e-82], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.1 \cdot 10^{-45}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 10^{-82}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.09999999999999997e-45Initial program 65.7%
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.f6445.5
Applied rewrites45.5%
Taylor expanded in F around -inf
Applied rewrites57.9%
if -1.09999999999999997e-45 < F < 1e-82Initial 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.2
Applied rewrites47.2%
Taylor expanded in F around 0
Applied rewrites39.8%
if 1e-82 < 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
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6449.0
Applied rewrites49.0%
Taylor expanded in F around inf
Applied rewrites47.3%
Final simplification47.9%
(FPCore (F B x) :precision binary64 (if (<= F -1.1e-45) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e-45) {
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.1d-45)) 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.1e-45) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.1e-45: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.1e-45) 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.1e-45) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.1e-45], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.1 \cdot 10^{-45}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.09999999999999997e-45Initial program 65.7%
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.f6445.5
Applied rewrites45.5%
Taylor expanded in F around -inf
Applied rewrites57.9%
if -1.09999999999999997e-45 < F Initial program 85.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.f6448.1
Applied rewrites48.1%
Taylor expanded in F around 0
Applied rewrites32.2%
Final simplification40.0%
(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 79.7%
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.f6447.3
Applied rewrites47.3%
Taylor expanded in F around 0
Applied rewrites29.1%
Final simplification29.1%
herbie shell --seed 2024303
(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))))))