
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+46)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.0024)
(- (/ (* (sqrt (pow (fma F F 2.0) -1.0)) F) (sin 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 <= -2e+46) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.0024) {
tmp = ((sqrt(pow(fma(F, F, 2.0), -1.0)) * F) / sin(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 <= -2e+46) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.0024) tmp = Float64(Float64(Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * F) / sin(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, -2e+46], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0024], N[(N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / N[Sin[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 -2 \cdot 10^{+46}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.0024:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2e46Initial program 48.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites59.6%
Applied rewrites59.8%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -2e46 < F < 0.00239999999999999979Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
if 0.00239999999999999979 < F Initial program 54.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.2%
Applied rewrites65.2%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(if (or (<= x -1.25e-125) (not (<= x 5.8e-65)))
(fma
(- F)
(/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (- B))
(/ (- x) (tan B)))
(- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.25e-125) || !(x <= 5.8e-65)) {
tmp = fma(-F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / -B), (-x / tan(B)));
} else {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -1.25e-125) || !(x <= 5.8e-65)) tmp = fma(Float64(-F), Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.25e-125], N[Not[LessEqual[x, 5.8e-65]], $MachinePrecision]], N[((-F) * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{-125} \lor \neg \left(x \leq 5.8 \cdot 10^{-65}\right):\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if x < -1.24999999999999992e-125 or 5.7999999999999996e-65 < x Initial program 79.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in B around 0
mul-1-negN/A
lower-neg.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.5
Applied rewrites84.5%
if -1.24999999999999992e-125 < x < 5.7999999999999996e-65Initial program 69.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites72.2%
Applied rewrites72.2%
Taylor expanded in B around 0
lower-/.f6466.9
Applied rewrites66.9%
Final simplification76.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2050.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.0024)
(fma
(- F)
(/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (- B))
(/ (- x) (tan B)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2050.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.0024) {
tmp = fma(-F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / -B), (-x / tan(B)));
} 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 <= -2050.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.0024) tmp = fma(Float64(-F), Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); 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, -2050.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0024], N[((-F) * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $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 -2050:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.0024:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2050Initial program 49.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites61.0%
Applied rewrites61.1%
Taylor expanded in F around -inf
Applied rewrites99.4%
if -2050 < F < 0.00239999999999999979Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
lower-neg.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.8
Applied rewrites83.8%
if 0.00239999999999999979 < F Initial program 54.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.2%
Applied rewrites65.2%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification92.0%
(FPCore (F B x)
:precision binary64
(if (<= F -2050.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 3.1e+102)
(fma
(- F)
(/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (- B))
(/ (- x) (tan B)))
(pow (sin B) -1.0))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2050.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 3.1e+102) {
tmp = fma(-F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / -B), (-x / tan(B)));
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2050.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 3.1e+102) tmp = fma(Float64(-F), Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2050.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e+102], N[((-F) * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2050:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if F < -2050Initial program 49.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites61.0%
Applied rewrites61.1%
Taylor expanded in F around -inf
Applied rewrites99.4%
if -2050 < F < 3.09999999999999987e102Initial program 97.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
lower-neg.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.3
Applied rewrites83.3%
if 3.09999999999999987e102 < F Initial program 43.9%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites43.8%
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.f6419.5
Applied rewrites19.5%
Taylor expanded in F around inf
Applied rewrites65.3%
Final simplification82.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -200000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.0024)
(- (/ F (* (sin B) (sqrt (fma x 2.0 (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 <= -200000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.0024) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, 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 <= -200000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.0024) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, 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, -200000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0024], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $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 -200000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.0024:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2e8Initial program 49.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites60.3%
Applied rewrites60.5%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -2e8 < F < 0.00239999999999999979Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.5
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
if 0.00239999999999999979 < F Initial program 54.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.2%
Applied rewrites65.2%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.0024)
(- (/ (* (sqrt 0.5) F) (sin 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 <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.0024) {
tmp = ((sqrt(0.5) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.0024d0) then
tmp = ((sqrt(0.5d0) * f) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.0024) {
tmp = ((Math.sqrt(0.5) * F) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.0024: tmp = ((math.sqrt(0.5) * F) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.0024) tmp = Float64(Float64(Float64(sqrt(0.5) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.0024) tmp = ((sqrt(0.5) * F) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0024], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[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 -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.0024:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 49.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites61.0%
Applied rewrites61.1%
Taylor expanded in F around -inf
Applied rewrites99.4%
if -1.3999999999999999 < F < 0.00239999999999999979Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in F around 0
Applied rewrites99.4%
if 0.00239999999999999979 < F Initial program 54.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites65.2%
Applied rewrites65.2%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x) :precision binary64 (if (or (<= x -9e-84) (not (<= x 4.6e-84))) (/ (- 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 <= -9e-84) || !(x <= 4.6e-84)) {
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 <= -9e-84) || !(x <= 4.6e-84)) 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, -9e-84], N[Not[LessEqual[x, 4.6e-84]], $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 -9 \cdot 10^{-84} \lor \neg \left(x \leq 4.6 \cdot 10^{-84}\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 < -9.00000000000000031e-84 or 4.59999999999999961e-84 < x Initial program 79.7%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6478.2
Applied rewrites78.2%
Applied rewrites78.4%
if -9.00000000000000031e-84 < x < 4.59999999999999961e-84Initial program 69.2%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites69.1%
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.f6456.3
Applied rewrites56.3%
Applied rewrites59.8%
Final simplification70.5%
(FPCore (F B x) :precision binary64 (if (or (<= x -4.7e-94) (not (<= x 4.6e-84))) (/ (- 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 <= -4.7e-94) || !(x <= 4.6e-84)) {
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 <= -4.7e-94) || !(x <= 4.6e-84)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(sqrt(fma(F, F, 2.0)) * Float64(sin(B) / F)) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -4.7e-94], N[Not[LessEqual[x, 4.6e-84]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[Power[N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-94} \lor \neg \left(x \leq 4.6 \cdot 10^{-84}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;{\left(\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \frac{\sin B}{F}\right)}^{-1}\\
\end{array}
\end{array}
if x < -4.70000000000000003e-94 or 4.59999999999999961e-84 < x Initial program 79.3%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6477.5
Applied rewrites77.5%
Applied rewrites77.7%
if -4.70000000000000003e-94 < x < 4.59999999999999961e-84Initial program 69.5%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites69.4%
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.f6457.3
Applied rewrites57.3%
Final simplification69.1%
(FPCore (F B x) :precision binary64 (if (or (<= x -4.7e-94) (not (<= x 4.6e-84))) (/ (- x) (tan B)) (* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -4.7e-94) || !(x <= 4.6e-84)) {
tmp = -x / tan(B);
} else {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -4.7e-94) || !(x <= 4.6e-84)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -4.7e-94], N[Not[LessEqual[x, 4.6e-84]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-94} \lor \neg \left(x \leq 4.6 \cdot 10^{-84}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\end{array}
\end{array}
if x < -4.70000000000000003e-94 or 4.59999999999999961e-84 < x Initial program 79.3%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6477.5
Applied rewrites77.5%
Applied rewrites77.7%
if -4.70000000000000003e-94 < x < 4.59999999999999961e-84Initial program 69.5%
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.f6457.2
Applied rewrites57.2%
Final simplification69.1%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+46)
(/ (- -1.0 x) B)
(if (<= F 65.0)
(/ (fma (sqrt (pow (fma F F 2.0) -1.0)) F (- x)) B)
(pow (sin B) -1.0))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+46) {
tmp = (-1.0 - x) / B;
} else if (F <= 65.0) {
tmp = fma(sqrt(pow(fma(F, F, 2.0), -1.0)), F, -x) / B;
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+46) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 65.0) tmp = Float64(fma(sqrt((fma(F, F, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+46], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 65.0], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+46}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 65:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if F < -2e46Initial program 48.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.f6424.7
Applied rewrites24.7%
Taylor expanded in F around -inf
Applied rewrites49.3%
if -2e46 < F < 65Initial 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.f6449.7
Applied rewrites49.7%
Taylor expanded in x around 0
Applied rewrites49.7%
if 65 < F Initial program 53.8%
lift-+.f64N/A
flip3-+N/A
clear-numN/A
Applied rewrites53.7%
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.f6426.2
Applied rewrites26.2%
Taylor expanded in F around inf
Applied rewrites64.5%
Final simplification53.9%
(FPCore (F B x)
:precision binary64
(if (<= B 0.009)
(/
(fma
(sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))
(fma (* B B) (* 0.16666666666666666 F) F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.009) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), fma((B * B), (0.16666666666666666 * F), F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.009) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), fma(Float64(B * B), Float64(0.16666666666666666 * F), F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.009], 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] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.009:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 0.00899999999999999932Initial program 73.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites49.0%
if 0.00899999999999999932 < B Initial program 80.6%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6458.8
Applied rewrites58.8%
Applied rewrites59.0%
Final simplification51.6%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.2e-36) (not (<= x 1.4e-60))) (/ (- x) (tan B)) (- (/ (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.2e-36) || !(x <= 1.4e-60)) {
tmp = -x / tan(B);
} else {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -1.2e-36) || !(x <= 1.4e-60)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.2e-36], N[Not[LessEqual[x, 1.4e-60]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{-36} \lor \neg \left(x \leq 1.4 \cdot 10^{-60}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if x < -1.2e-36 or 1.4000000000000001e-60 < x Initial program 85.5%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6489.7
Applied rewrites89.7%
Applied rewrites89.9%
if -1.2e-36 < x < 1.4000000000000001e-60Initial program 66.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites70.5%
Applied rewrites70.5%
Taylor expanded in B around 0
lower-/.f6461.4
Applied rewrites61.4%
Final simplification74.4%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+46)
(/ (- -1.0 x) B)
(if (<= F 0.0024)
(/ (fma (sqrt (pow (fma F F 2.0) -1.0)) F (- x)) B)
(/ (- (fma (/ -0.5 F) (/ (fma 2.0 x 2.0) F) 1.0) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+46) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.0024) {
tmp = fma(sqrt(pow(fma(F, F, 2.0), -1.0)), F, -x) / B;
} else {
tmp = (fma((-0.5 / F), (fma(2.0, x, 2.0) / F), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+46) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 0.0024) tmp = Float64(fma(sqrt((fma(F, F, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(fma(Float64(-0.5 / F), Float64(fma(2.0, x, 2.0) / F), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+46], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.0024], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+46}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 0.0024:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{-0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2e46Initial program 48.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.f6424.7
Applied rewrites24.7%
Taylor expanded in F around -inf
Applied rewrites49.3%
if -2e46 < F < 0.00239999999999999979Initial 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.f6449.3
Applied rewrites49.3%
Taylor expanded in x around 0
Applied rewrites49.3%
if 0.00239999999999999979 < F Initial program 54.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6428.4
Applied rewrites28.4%
Taylor expanded in F around inf
Applied rewrites42.4%
Final simplification47.3%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+46)
(/ (- -1.0 x) B)
(if (<= F 0.0024)
(/ (fma (sqrt (pow (fma F F 2.0) -1.0)) F (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+46) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.0024) {
tmp = fma(sqrt(pow(fma(F, F, 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 <= -2e+46) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 0.0024) tmp = Float64(fma(sqrt((fma(F, F, 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, -2e+46], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.0024], N[(N[(N[Sqrt[N[Power[N[(F * F + 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 -2 \cdot 10^{+46}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 0.0024:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2e46Initial program 48.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.f6424.7
Applied rewrites24.7%
Taylor expanded in F around -inf
Applied rewrites49.3%
if -2e46 < F < 0.00239999999999999979Initial 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.f6449.3
Applied rewrites49.3%
Taylor expanded in x around 0
Applied rewrites49.3%
if 0.00239999999999999979 < F Initial program 54.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6428.4
Applied rewrites28.4%
Taylor expanded in F around inf
Applied rewrites42.4%
Final simplification47.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(/ (- -1.0 x) B)
(if (<= F 1800000000.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 <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 1800000000.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 <= -1.4) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1800000000.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, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1800000000.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 -1.4:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1800000000:\\
\;\;\;\;\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 < -1.3999999999999999Initial program 49.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.f6425.6
Applied rewrites25.6%
Taylor expanded in F around -inf
Applied rewrites49.4%
if -1.3999999999999999 < F < 1.8e9Initial 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.f6449.4
Applied rewrites49.4%
Taylor expanded in F around 0
Applied rewrites49.2%
if 1.8e9 < F Initial program 53.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.f6427.6
Applied rewrites27.6%
Taylor expanded in F around inf
Applied rewrites42.1%
Final simplification47.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (/ F (sqrt (fma F F 2.0))) B)))
(if (<= F -4.8e-17)
(/ (- -1.0 x) B)
(if (<= F -1.12e-94)
t_0
(if (<= F 7.5e-57)
(/ (* (fma -0.3333333333333333 (* B B) 1.0) (- x)) B)
(if (<= F 0.0024) 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 <= -4.8e-17) {
tmp = (-1.0 - x) / B;
} else if (F <= -1.12e-94) {
tmp = t_0;
} else if (F <= 7.5e-57) {
tmp = (fma(-0.3333333333333333, (B * B), 1.0) * -x) / B;
} else if (F <= 0.0024) {
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 <= -4.8e-17) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -1.12e-94) tmp = t_0; elseif (F <= 7.5e-57) tmp = Float64(Float64(fma(-0.3333333333333333, Float64(B * B), 1.0) * Float64(-x)) / B); elseif (F <= 0.0024) 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, -4.8e-17], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -1.12e-94], t$95$0, If[LessEqual[F, 7.5e-57], N[(N[(N[(-0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * (-x)), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.0024], 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 -4.8 \cdot 10^{-17}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -1.12 \cdot 10^{-94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.3333333333333333, B \cdot B, 1\right) \cdot \left(-x\right)}{B}\\
\mathbf{elif}\;F \leq 0.0024:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.79999999999999973e-17Initial program 53.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.f6427.4
Applied rewrites27.4%
Taylor expanded in F around -inf
Applied rewrites48.1%
if -4.79999999999999973e-17 < F < -1.12e-94 or 7.49999999999999973e-57 < F < 0.00239999999999999979Initial 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.f6453.2
Applied rewrites53.2%
Taylor expanded in x around 0
Applied rewrites50.3%
Applied rewrites50.4%
if -1.12e-94 < F < 7.49999999999999973e-57Initial program 99.6%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6479.5
Applied rewrites79.5%
Taylor expanded in B around 0
Applied rewrites38.9%
if 0.00239999999999999979 < F Initial program 54.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6428.4
Applied rewrites28.4%
Taylor expanded in F around inf
Applied rewrites42.4%
Final simplification43.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (* (sqrt 0.5) F) B)))
(if (<= F -1.05e-17)
(/ (- -1.0 x) B)
(if (<= F -1.12e-94)
t_0
(if (<= F 7.5e-57)
(/ (* (fma -0.3333333333333333 (* B B) 1.0) (- x)) B)
(if (<= F 0.0017) 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 <= -1.05e-17) {
tmp = (-1.0 - x) / B;
} else if (F <= -1.12e-94) {
tmp = t_0;
} else if (F <= 7.5e-57) {
tmp = (fma(-0.3333333333333333, (B * B), 1.0) * -x) / B;
} else if (F <= 0.0017) {
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 <= -1.05e-17) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -1.12e-94) tmp = t_0; elseif (F <= 7.5e-57) tmp = Float64(Float64(fma(-0.3333333333333333, Float64(B * B), 1.0) * Float64(-x)) / B); elseif (F <= 0.0017) 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[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision]}, If[LessEqual[F, -1.05e-17], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -1.12e-94], t$95$0, If[LessEqual[F, 7.5e-57], N[(N[(N[(-0.3333333333333333 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * (-x)), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.0017], 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 -1.05 \cdot 10^{-17}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -1.12 \cdot 10^{-94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-57}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.3333333333333333, B \cdot B, 1\right) \cdot \left(-x\right)}{B}\\
\mathbf{elif}\;F \leq 0.0017:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.04999999999999996e-17Initial program 53.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.f6427.4
Applied rewrites27.4%
Taylor expanded in F around -inf
Applied rewrites48.1%
if -1.04999999999999996e-17 < F < -1.12e-94 or 7.49999999999999973e-57 < F < 0.00169999999999999991Initial 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.f6453.2
Applied rewrites53.2%
Taylor expanded in x around 0
Applied rewrites50.3%
Taylor expanded in F around 0
Applied rewrites50.3%
if -1.12e-94 < F < 7.49999999999999973e-57Initial program 99.6%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6479.5
Applied rewrites79.5%
Taylor expanded in B around 0
Applied rewrites38.9%
if 0.00169999999999999991 < F Initial program 54.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6428.4
Applied rewrites28.4%
Taylor expanded in F around inf
Applied rewrites42.4%
Final simplification43.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (* (sqrt 0.5) F) B)))
(if (<= F -1.05e-17)
(/ (- -1.0 x) B)
(if (<= F -1.12e-94)
t_0
(if (<= F 6e-62) (/ (- x) B) (if (<= F 0.0017) 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 <= -1.05e-17) {
tmp = (-1.0 - x) / B;
} else if (F <= -1.12e-94) {
tmp = t_0;
} else if (F <= 6e-62) {
tmp = -x / B;
} else if (F <= 0.0017) {
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 <= (-1.05d-17)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-1.12d-94)) then
tmp = t_0
else if (f <= 6d-62) then
tmp = -x / b
else if (f <= 0.0017d0) 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 <= -1.05e-17) {
tmp = (-1.0 - x) / B;
} else if (F <= -1.12e-94) {
tmp = t_0;
} else if (F <= 6e-62) {
tmp = -x / B;
} else if (F <= 0.0017) {
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 <= -1.05e-17: tmp = (-1.0 - x) / B elif F <= -1.12e-94: tmp = t_0 elif F <= 6e-62: tmp = -x / B elif F <= 0.0017: 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 <= -1.05e-17) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -1.12e-94) tmp = t_0; elseif (F <= 6e-62) tmp = Float64(Float64(-x) / B); elseif (F <= 0.0017) 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 <= -1.05e-17) tmp = (-1.0 - x) / B; elseif (F <= -1.12e-94) tmp = t_0; elseif (F <= 6e-62) tmp = -x / B; elseif (F <= 0.0017) 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, -1.05e-17], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -1.12e-94], t$95$0, If[LessEqual[F, 6e-62], N[((-x) / B), $MachinePrecision], If[LessEqual[F, 0.0017], 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 -1.05 \cdot 10^{-17}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -1.12 \cdot 10^{-94}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-62}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{elif}\;F \leq 0.0017:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.04999999999999996e-17Initial program 53.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.f6427.4
Applied rewrites27.4%
Taylor expanded in F around -inf
Applied rewrites48.1%
if -1.04999999999999996e-17 < F < -1.12e-94 or 6.0000000000000002e-62 < F < 0.00169999999999999991Initial 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.f6451.8
Applied rewrites51.8%
Taylor expanded in x around 0
Applied rewrites49.0%
Taylor expanded in F around 0
Applied rewrites49.0%
if -1.12e-94 < F < 6.0000000000000002e-62Initial 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.f6448.0
Applied rewrites48.0%
Taylor expanded in F around 0
Applied rewrites39.0%
if 0.00169999999999999991 < F Initial program 54.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6428.4
Applied rewrites28.4%
Taylor expanded in F around inf
Applied rewrites42.4%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-203) (/ (- -1.0 x) B) (if (<= F 8e-58) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-203) {
tmp = (-1.0 - x) / B;
} else if (F <= 8e-58) {
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.45d-203)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 8d-58) 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.45e-203) {
tmp = (-1.0 - x) / B;
} else if (F <= 8e-58) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-203: tmp = (-1.0 - x) / B elif F <= 8e-58: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-203) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8e-58) 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.45e-203) tmp = (-1.0 - x) / B; elseif (F <= 8e-58) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-203], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8e-58], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-203}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-58}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.4499999999999999e-203Initial program 72.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.f6435.7
Applied rewrites35.7%
Taylor expanded in F around -inf
Applied rewrites37.7%
if -1.4499999999999999e-203 < F < 8.0000000000000002e-58Initial 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.f6448.8
Applied rewrites48.8%
Taylor expanded in F around 0
Applied rewrites40.0%
if 8.0000000000000002e-58 < F Initial program 61.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.f6432.3
Applied rewrites32.3%
Taylor expanded in F around inf
Applied rewrites37.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-203) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-203) {
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.45d-203)) 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.45e-203) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-203: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-203) 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.45e-203) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-203], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{-203}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.4499999999999999e-203Initial program 72.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.f6435.7
Applied rewrites35.7%
Taylor expanded in F around -inf
Applied rewrites37.7%
if -1.4499999999999999e-203 < F Initial program 77.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.f6439.3
Applied rewrites39.3%
Taylor expanded in F around 0
Applied rewrites25.2%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 75.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.f6437.9
Applied rewrites37.9%
Taylor expanded in F around 0
Applied rewrites23.4%
herbie shell --seed 2024308
(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))))))