
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+22)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 150000000.0)
(- (/ F (* (sin B) (sqrt (fma F F 2.0)))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2e+22) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 150000000.0) {
tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+22) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 150000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 150000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 150000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2e22Initial program 47.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 rewrites68.1%
Applied rewrites68.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2e22 < F < 1.5e8Initial 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.7%
Applied rewrites99.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.7
Applied rewrites99.7%
if 1.5e8 < F Initial program 62.0%
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 rewrites79.6%
Applied rewrites79.7%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8e-37)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 280000.0)
(- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (/ F B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8e-37) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 280000.0) {
tmp = (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * (F / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8e-37) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 280000.0) tmp = Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * Float64(F / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e-37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 280000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{-37}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 280000:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8.00000000000000053e-37Initial program 51.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 rewrites70.3%
Applied rewrites70.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6496.6
Applied rewrites96.6%
if -8.00000000000000053e-37 < F < 2.8e5Initial 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%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.5
Applied rewrites87.5%
if 2.8e5 < F Initial program 62.0%
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 rewrites79.6%
Applied rewrites79.7%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification93.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8e-37)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.15e-164)
(- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (/ F B)) t_0)
(if (<= F 6e+153)
(- (/ (/ F (sqrt (fma F F 2.0))) (sin B)) (/ x B))
(fma -1.0 (/ -1.0 B) (/ (- x) (tan B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8e-37) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.15e-164) {
tmp = (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * (F / B)) - t_0;
} else if (F <= 6e+153) {
tmp = ((F / sqrt(fma(F, F, 2.0))) / sin(B)) - (x / B);
} else {
tmp = fma(-1.0, (-1.0 / B), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8e-37) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.15e-164) tmp = Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * Float64(F / B)) - t_0); elseif (F <= 6e+153) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / sin(B)) - Float64(x / B)); else tmp = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e-37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e-164], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6e+153], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{-37}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-164}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \frac{F}{B} - t\_0\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -8.00000000000000053e-37Initial program 51.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 rewrites70.3%
Applied rewrites70.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6496.6
Applied rewrites96.6%
if -8.00000000000000053e-37 < F < 1.14999999999999993e-164Initial 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.7%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6491.2
Applied rewrites91.2%
if 1.14999999999999993e-164 < F < 6.00000000000000037e153Initial program 86.1%
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.5%
Applied rewrites99.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6489.6
Applied rewrites89.6%
if 6.00000000000000037e153 < F Initial program 48.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 rewrites56.7%
Taylor expanded in B around 0
lower-/.f6456.7
Applied rewrites56.7%
Taylor expanded in F around inf
Applied rewrites84.8%
Final simplification91.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1.9e+63)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.15e-164)
(- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (/ F B)) (/ x (tan B)))
(if (<= F 6e+153)
(- (/ (/ F (sqrt (fma F F 2.0))) (sin B)) (/ x B))
(fma -1.0 (/ -1.0 B) (/ (- x) (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.9e+63) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.15e-164) {
tmp = (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * (F / B)) - (x / tan(B));
} else if (F <= 6e+153) {
tmp = ((F / sqrt(fma(F, F, 2.0))) / sin(B)) - (x / B);
} else {
tmp = fma(-1.0, (-1.0 / B), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.9e+63) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.15e-164) tmp = Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * Float64(F / B)) - Float64(x / tan(B))); elseif (F <= 6e+153) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / sin(B)) - Float64(x / B)); else tmp = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.9e+63], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-164], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e+153], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.9 \cdot 10^{+63}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-164}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < -1.9000000000000001e63Initial program 43.4%
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 rewrites65.6%
Applied rewrites65.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
lower-/.f6479.1
Applied rewrites79.1%
if -1.9000000000000001e63 < F < 1.14999999999999993e-164Initial 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.7%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
if 1.14999999999999993e-164 < F < 6.00000000000000037e153Initial program 86.1%
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.5%
Applied rewrites99.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6489.6
Applied rewrites89.6%
if 6.00000000000000037e153 < F Initial program 48.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 rewrites56.7%
Taylor expanded in B around 0
lower-/.f6456.7
Applied rewrites56.7%
Taylor expanded in F around inf
Applied rewrites84.8%
Final simplification85.2%
(FPCore (F B x)
:precision binary64
(if (<= F 9.5e-272)
(- (/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x (tan B)))
(if (<= F 6e+153)
(- (/ (/ F (sqrt (fma F F 2.0))) (sin B)) (/ x B))
(fma -1.0 (/ -1.0 B) (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= 9.5e-272) {
tmp = (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / tan(B));
} else if (F <= 6e+153) {
tmp = ((F / sqrt(fma(F, F, 2.0))) / sin(B)) - (x / B);
} else {
tmp = fma(-1.0, (-1.0 / B), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 9.5e-272) tmp = Float64(Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / tan(B))); elseif (F <= 6e+153) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / sin(B)) - Float64(x / B)); else tmp = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 9.5e-272], N[(N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e+153], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 9.5 \cdot 10^{-272}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+153}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < 9.50000000000000024e-272Initial program 71.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 rewrites82.8%
Applied rewrites82.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6471.8
Applied rewrites71.8%
Taylor expanded in B around 0
Applied rewrites70.9%
if 9.50000000000000024e-272 < F < 6.00000000000000037e153Initial program 89.1%
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.8%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
lower-/.f6483.6
Applied rewrites83.6%
if 6.00000000000000037e153 < F Initial program 48.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 rewrites56.7%
Taylor expanded in B around 0
lower-/.f6456.7
Applied rewrites56.7%
Taylor expanded in F around inf
Applied rewrites84.8%
Final simplification76.4%
(FPCore (F B x)
:precision binary64
(if (<= F 9.5e-272)
(- (/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x (tan B)))
(if (<= F 2.45e-11)
(+ (- (/ x B)) (* (/ F (sin B)) (sqrt 0.5)))
(fma -1.0 (/ -1.0 B) (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= 9.5e-272) {
tmp = (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / tan(B));
} else if (F <= 2.45e-11) {
tmp = -(x / B) + ((F / sin(B)) * sqrt(0.5));
} else {
tmp = fma(-1.0, (-1.0 / B), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 9.5e-272) tmp = Float64(Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / tan(B))); elseif (F <= 2.45e-11) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64(F / sin(B)) * sqrt(0.5))); else tmp = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 9.5e-272], N[(N[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.45e-11], N[((-N[(x / B), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 9.5 \cdot 10^{-272}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.45 \cdot 10^{-11}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if F < 9.50000000000000024e-272Initial program 71.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 rewrites82.8%
Applied rewrites82.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6471.8
Applied rewrites71.8%
Taylor expanded in B around 0
Applied rewrites70.9%
if 9.50000000000000024e-272 < F < 2.4499999999999999e-11Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f6479.5
Applied rewrites79.5%
Taylor expanded in F around 0
Applied rewrites79.5%
if 2.4499999999999999e-11 < F Initial program 63.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 rewrites80.6%
Taylor expanded in B around 0
lower-/.f6464.2
Applied rewrites64.2%
Taylor expanded in F around inf
Applied rewrites74.9%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0235)
(/ (fma 0.5 (/ (/ (fma 2.0 x 2.0) F) F) (- -1.0 x)) B)
(if (<= F 2.7e+181)
(/ (fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (- x)) B)
(/
(- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0235) {
tmp = fma(0.5, ((fma(2.0, x, 2.0) / F) / F), (-1.0 - x)) / B;
} else if (F <= 2.7e+181) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, -x) / B;
} else {
tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.0235) tmp = Float64(fma(0.5, Float64(Float64(fma(2.0, x, 2.0) / F) / F), Float64(-1.0 - x)) / B); elseif (F <= 2.7e+181) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.0235], N[(N[(0.5 * N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.7e+181], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0235:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F}}{F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+181}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -0.0235Initial program 48.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.f6436.7
Applied rewrites36.7%
Taylor expanded in F around -inf
Applied rewrites52.3%
Applied rewrites52.3%
if -0.0235 < F < 2.70000000000000007e181Initial program 93.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.f6450.9
Applied rewrites50.9%
if 2.70000000000000007e181 < F Initial program 41.9%
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 rewrites51.2%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites15.6%
Taylor expanded in F around inf
Applied rewrites48.3%
Final simplification51.1%
(FPCore (F B x)
:precision binary64
(if (<= F -2.1e-94)
(/ (pow (/ (+ -1.0 x) (- 1.0 (* x x))) -1.0) B)
(if (<= F 4e-79)
(/ (- x) B)
(if (<= F 550000.0)
(/ (* (sqrt (pow (fma F F 2.0) -1.0)) F) B)
(/
(- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-94) {
tmp = pow(((-1.0 + x) / (1.0 - (x * x))), -1.0) / B;
} else if (F <= 4e-79) {
tmp = -x / B;
} else if (F <= 550000.0) {
tmp = (sqrt(pow(fma(F, F, 2.0), -1.0)) * F) / B;
} else {
tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-94) tmp = Float64((Float64(Float64(-1.0 + x) / Float64(1.0 - Float64(x * x))) ^ -1.0) / B); elseif (F <= 4e-79) tmp = Float64(Float64(-x) / B); elseif (F <= 550000.0) tmp = Float64(Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * F) / B); else tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-94], N[(N[Power[N[(N[(-1.0 + x), $MachinePrecision] / N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e-79], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 550000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;\frac{{\left(\frac{-1 + x}{1 - x \cdot x}\right)}^{-1}}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-79}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 550000:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.1000000000000001e-94Initial program 56.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.f6436.8
Applied rewrites36.8%
Taylor expanded in F around -inf
Applied rewrites46.2%
Applied rewrites46.2%
if -2.1000000000000001e-94 < F < 4e-79Initial program 99.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.f6450.4
Applied rewrites50.4%
Taylor expanded in F around 0
Applied rewrites43.8%
if 4e-79 < F < 5.5e5Initial 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.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites45.7%
if 5.5e5 < F Initial program 62.0%
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 rewrites79.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites38.5%
Taylor expanded in F around inf
Applied rewrites51.6%
Final simplification46.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2.1e-94)
(/ (- -1.0 x) B)
(if (<= F 4e-79)
(/ (- x) B)
(if (<= F 550000.0)
(/ (* (sqrt (pow (fma F F 2.0) -1.0)) F) B)
(/
(- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-94) {
tmp = (-1.0 - x) / B;
} else if (F <= 4e-79) {
tmp = -x / B;
} else if (F <= 550000.0) {
tmp = (sqrt(pow(fma(F, F, 2.0), -1.0)) * F) / B;
} else {
tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-94) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4e-79) tmp = Float64(Float64(-x) / B); elseif (F <= 550000.0) tmp = Float64(Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * F) / B); else tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-94], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e-79], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 550000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-79}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 550000:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.1000000000000001e-94Initial program 56.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.f6436.8
Applied rewrites36.8%
Taylor expanded in F around -inf
Applied rewrites46.2%
if -2.1000000000000001e-94 < F < 4e-79Initial program 99.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.f6450.4
Applied rewrites50.4%
Taylor expanded in F around 0
Applied rewrites43.8%
if 4e-79 < F < 5.5e5Initial 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.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites45.7%
if 5.5e5 < F Initial program 62.0%
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 rewrites79.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites38.5%
Taylor expanded in F around inf
Applied rewrites51.6%
Final simplification46.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2.1e-94)
(/ (- -1.0 x) B)
(if (<= F 4e-79)
(/ (- x) B)
(if (<= F 550000.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F B))
(/
(- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-94) {
tmp = (-1.0 - x) / B;
} else if (F <= 4e-79) {
tmp = -x / B;
} else if (F <= 550000.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / B);
} else {
tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-94) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4e-79) tmp = Float64(Float64(-x) / B); elseif (F <= 550000.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / B)); else tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-94], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e-79], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 550000.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{-79}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 550000:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.1000000000000001e-94Initial program 56.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.f6436.8
Applied rewrites36.8%
Taylor expanded in F around -inf
Applied rewrites46.2%
if -2.1000000000000001e-94 < F < 4e-79Initial program 99.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.f6450.4
Applied rewrites50.4%
Taylor expanded in F around 0
Applied rewrites43.8%
if 4e-79 < F < 5.5e5Initial 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.9
Applied rewrites56.9%
Taylor expanded in x around 0
Applied rewrites45.6%
if 5.5e5 < F Initial program 62.0%
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 rewrites79.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites38.5%
Taylor expanded in F around inf
Applied rewrites51.6%
Final simplification46.6%
(FPCore (F B x)
:precision binary64
(if (<= F -8e-37)
(/ (pow (/ (+ -1.0 x) (- 1.0 (* x x))) -1.0) B)
(if (<= F 1.88)
(/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
(/
(- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e-37) {
tmp = pow(((-1.0 + x) / (1.0 - (x * x))), -1.0) / B;
} else if (F <= 1.88) {
tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
} else {
tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8e-37) tmp = Float64((Float64(Float64(-1.0 + x) / Float64(1.0 - Float64(x * x))) ^ -1.0) / B); elseif (F <= 1.88) tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8e-37], N[(N[Power[N[(N[(-1.0 + x), $MachinePrecision] / N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.88], 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[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{-37}:\\
\;\;\;\;\frac{{\left(\frac{-1 + x}{1 - x \cdot x}\right)}^{-1}}{B}\\
\mathbf{elif}\;F \leq 1.88:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -8.00000000000000053e-37Initial program 51.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.f6436.3
Applied rewrites36.3%
Taylor expanded in F around -inf
Applied rewrites51.1%
Applied rewrites51.1%
if -8.00000000000000053e-37 < F < 1.8799999999999999Initial 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.f6450.2
Applied rewrites50.2%
Taylor expanded in F around 0
Applied rewrites50.0%
if 1.8799999999999999 < F Initial program 62.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 rewrites79.9%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites39.5%
Taylor expanded in F around inf
Applied rewrites52.0%
Final simplification50.8%
(FPCore (F B x) :precision binary64 (if (<= B 3.2e-9) (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (- (/ -1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.2e-9) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (-1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.2e-9) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.2e-9], 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[(-1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 3.20000000000000012e-9Initial program 70.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.f6454.5
Applied rewrites54.5%
Applied rewrites54.5%
if 3.20000000000000012e-9 < B Initial program 89.4%
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 rewrites89.6%
Applied rewrites89.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6462.0
Applied rewrites62.0%
Taylor expanded in B around 0
Applied rewrites66.1%
Final simplification57.1%
(FPCore (F B x)
:precision binary64
(if (<= F -9e+170)
(/ (pow (/ (+ -1.0 x) (- 1.0 (* x x))) -1.0) B)
(if (<= F 2.7e+181)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(/
(- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e+170) {
tmp = pow(((-1.0 + x) / (1.0 - (x * x))), -1.0) / B;
} else if (F <= 2.7e+181) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -9e+170) tmp = Float64((Float64(Float64(-1.0 + x) / Float64(1.0 - Float64(x * x))) ^ -1.0) / B); elseif (F <= 2.7e+181) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -9e+170], N[(N[Power[N[(N[(-1.0 + x), $MachinePrecision] / N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.7e+181], 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[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{+170}:\\
\;\;\;\;\frac{{\left(\frac{-1 + x}{1 - x \cdot x}\right)}^{-1}}{B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+181}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -9.00000000000000044e170Initial program 26.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.f6421.2
Applied rewrites21.2%
Taylor expanded in F around -inf
Applied rewrites50.5%
Applied rewrites50.5%
if -9.00000000000000044e170 < F < 2.70000000000000007e181Initial program 89.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.f6451.6
Applied rewrites51.6%
Applied rewrites51.6%
if 2.70000000000000007e181 < F Initial program 41.9%
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 rewrites51.2%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites15.6%
Taylor expanded in F around inf
Applied rewrites48.3%
Final simplification51.1%
(FPCore (F B x) :precision binary64 (if (<= B 3.5e-9) (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (fma -1.0 (/ -1.0 B) (/ (- x) (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.5e-9) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = fma(-1.0, (-1.0 / B), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.5e-9) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.5e-9], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.5 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if B < 3.4999999999999999e-9Initial program 70.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.f6454.5
Applied rewrites54.5%
Applied rewrites54.5%
if 3.4999999999999999e-9 < B Initial program 89.4%
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 rewrites89.6%
Taylor expanded in B around 0
lower-/.f6469.4
Applied rewrites69.4%
Taylor expanded in F around inf
Applied rewrites59.5%
Final simplification55.7%
(FPCore (F B x) :precision binary64 (if (<= B 3.2e-9) (/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B) (- (/ -1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 3.2e-9) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (-1.0 / B) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 3.2e-9) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 3.2e-9], 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[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 3.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 3.20000000000000012e-9Initial program 70.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.f6454.5
Applied rewrites54.5%
Applied rewrites54.5%
if 3.20000000000000012e-9 < B Initial program 89.4%
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 rewrites89.6%
Applied rewrites89.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6462.0
Applied rewrites62.0%
Taylor expanded in B around 0
Applied rewrites59.4%
Final simplification55.6%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0235)
(/ (fma 0.5 (/ (/ (fma 2.0 x 2.0) F) F) (- -1.0 x)) B)
(if (<= F 2.7e+181)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(/
(- (fma (fma 0.3333333333333333 x 0.16666666666666666) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0235) {
tmp = fma(0.5, ((fma(2.0, x, 2.0) / F) / F), (-1.0 - x)) / B;
} else if (F <= 2.7e+181) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (fma(fma(0.3333333333333333, x, 0.16666666666666666), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -0.0235) tmp = Float64(fma(0.5, Float64(Float64(fma(2.0, x, 2.0) / F) / F), Float64(-1.0 - x)) / B); elseif (F <= 2.7e+181) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(fma(fma(0.3333333333333333, x, 0.16666666666666666), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -0.0235], N[(N[(0.5 * N[(N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] / F), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.7e+181], 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[(N[(0.3333333333333333 * x + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0235:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\frac{\mathsf{fma}\left(2, x, 2\right)}{F}}{F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+181}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, 0.16666666666666666\right), B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -0.0235Initial program 48.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.f6436.7
Applied rewrites36.7%
Taylor expanded in F around -inf
Applied rewrites52.3%
Applied rewrites52.3%
if -0.0235 < F < 2.70000000000000007e181Initial program 93.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.f6450.9
Applied rewrites50.9%
Applied rewrites50.9%
if 2.70000000000000007e181 < F Initial program 41.9%
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 rewrites51.2%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites15.6%
Taylor expanded in F around inf
Applied rewrites48.3%
Final simplification51.1%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e-94) (/ (- -1.0 x) B) (if (<= F 1.95e-80) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-94) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.95e-80) {
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 <= (-2.1d-94)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.95d-80) 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 <= -2.1e-94) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.95e-80) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-94: tmp = (-1.0 - x) / B elif F <= 1.95e-80: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-94) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.95e-80) 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 <= -2.1e-94) tmp = (-1.0 - x) / B; elseif (F <= 1.95e-80) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-94], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.95e-80], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.95 \cdot 10^{-80}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.1000000000000001e-94Initial program 56.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.f6436.8
Applied rewrites36.8%
Taylor expanded in F around -inf
Applied rewrites46.2%
if -2.1000000000000001e-94 < F < 1.9499999999999999e-80Initial program 99.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.8
Applied rewrites49.8%
Taylor expanded in F around 0
Applied rewrites43.1%
if 1.9499999999999999e-80 < F Initial program 71.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.f6443.4
Applied rewrites43.4%
Taylor expanded in F around inf
Applied rewrites45.0%
Final simplification44.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e-94) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e-94) {
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 <= (-2.1d-94)) 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 <= -2.1e-94) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e-94: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e-94) 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 <= -2.1e-94) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e-94], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{-94}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.1000000000000001e-94Initial program 56.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.f6436.8
Applied rewrites36.8%
Taylor expanded in F around -inf
Applied rewrites46.2%
if -2.1000000000000001e-94 < F Initial program 85.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.f6446.7
Applied rewrites46.7%
Taylor expanded in F around 0
Applied rewrites32.3%
Final simplification37.5%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 74.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.f6443.0
Applied rewrites43.0%
Taylor expanded in F around 0
Applied rewrites29.2%
Final simplification29.2%
herbie shell --seed 2024326
(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))))))