
(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 27 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 -6.5e+22)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 200000000.0)
(- (/ F (* (sin B) (sqrt (fma F F (fma 2.0 x 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 <= -6.5e+22) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 200000000.0) {
tmp = (F / (sin(B) * sqrt(fma(F, F, fma(2.0, x, 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 <= -6.5e+22) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 200000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, fma(2.0, x, 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, -6.5e+22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + N[(2.0 * x + 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 -6.5 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.49999999999999979e22Initial program 60.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.6%
Applied rewrites73.7%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -6.49999999999999979e22 < F < 2e8Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.7
Applied rewrites99.7%
if 2e8 < F Initial program 59.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6499.7
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6.5e+22)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 105000000.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 <= -6.5e+22) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 105000000.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 <= -6.5e+22) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 105000000.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, -6.5e+22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 105000000.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 -6.5 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 105000000:\\
\;\;\;\;\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 < -6.49999999999999979e22Initial program 60.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.6%
Applied rewrites73.7%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -6.49999999999999979e22 < F < 1.05e8Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6498.9
Applied rewrites98.9%
if 1.05e8 < F Initial program 59.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6499.7
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1200.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2800.0)
(- (* (/ F B) (sqrt (/ 1.0 (fma F F (fma 2.0 x 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 <= -1200.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2800.0) {
tmp = ((F / B) * sqrt((1.0 / fma(F, F, fma(2.0, x, 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 <= -1200.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2800.0) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 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, -1200.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2800.0], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 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 -1200:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1200Initial program 61.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites75.9%
Applied rewrites76.0%
Taylor expanded in F around -inf
Applied rewrites98.7%
if -1200 < F < 2800Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.7%
Applied rewrites99.7%
Taylor expanded in B around 0
lower-*.f64N/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.f6485.7
Applied rewrites85.7%
if 2800 < F Initial program 59.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6499.7
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5e+27)
(fma (/ -1.0 (tan B)) x (/ -1.0 B))
(if (<= F 2800.0)
(- (/ F (* 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 <= -5e+27) {
tmp = fma((-1.0 / tan(B)), x, (-1.0 / B));
} else if (F <= 2800.0) {
tmp = (F / (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 <= -5e+27) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 / B)); elseif (F <= 2800.0) tmp = Float64(Float64(F / Float64(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, -5e+27], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2800.0], N[(N[(F / N[(B * 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 -5 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{-1}{B}\right)\\
\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;\frac{F}{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 < -4.99999999999999979e27Initial program 60.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6460.1
Applied rewrites60.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6450.2
Applied rewrites50.2%
Taylor expanded in F around -inf
Applied rewrites74.8%
if -4.99999999999999979e27 < F < 2800Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6485.0
Applied rewrites85.0%
if 2800 < F Initial program 59.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
unsub-negN/A
lower--.f6499.7
lift-*.f64N/A
lift-/.f64N/A
un-div-invN/A
lower-/.f6499.9
Applied rewrites99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ F (* B (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x (tan B)))))
(if (<= x -6.4e-107)
t_0
(if (<= x 3.6e-99)
(- (/ (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) (sin B)) (/ x B))
t_0))))
double code(double F, double B, double x) {
double t_0 = (F / (B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / tan(B));
double tmp;
if (x <= -6.4e-107) {
tmp = t_0;
} else if (x <= 3.6e-99) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / Float64(B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / tan(B))) tmp = 0.0 if (x <= -6.4e-107) tmp = t_0; elseif (x <= 3.6e-99) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[(B * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.4e-107], t$95$0, If[LessEqual[x, 3.6e-99], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -6.4 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-99}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.40000000000000025e-107 or 3.6000000000000001e-99 < x Initial program 85.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites95.1%
Applied rewrites95.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6495.0
Applied rewrites95.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6490.6
Applied rewrites90.6%
if -6.40000000000000025e-107 < x < 3.6000000000000001e-99Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.6%
Applied rewrites74.8%
Taylor expanded in B around 0
lower-/.f6466.1
Applied rewrites66.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ F (* B (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x (tan B)))))
(if (<= x -6.4e-107)
t_0
(if (<= x 3.6e-99)
(- (/ F (* (sin B) (sqrt (fma F F (fma 2.0 x 2.0))))) (/ x B))
t_0))))
double code(double F, double B, double x) {
double t_0 = (F / (B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / tan(B));
double tmp;
if (x <= -6.4e-107) {
tmp = t_0;
} else if (x <= 3.6e-99) {
tmp = (F / (sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(F / Float64(B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / tan(B))) tmp = 0.0 if (x <= -6.4e-107) tmp = t_0; elseif (x <= 3.6e-99) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[(B * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.4e-107], t$95$0, If[LessEqual[x, 3.6e-99], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -6.4 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-99}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -6.40000000000000025e-107 or 3.6000000000000001e-99 < x Initial program 85.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites95.1%
Applied rewrites95.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6495.0
Applied rewrites95.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6490.6
Applied rewrites90.6%
if -6.40000000000000025e-107 < x < 3.6000000000000001e-99Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites74.6%
Applied rewrites74.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6474.8
Applied rewrites74.8%
Taylor expanded in B around 0
lower-/.f6466.0
Applied rewrites66.0%
Final simplification81.7%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+27)
(fma (/ -1.0 (tan B)) x (/ -1.0 B))
(if (<= F 7e+102)
(- (/ F (* B (sqrt (fma x 2.0 (fma F F 2.0))))) (/ x (tan B)))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+27) {
tmp = fma((-1.0 / tan(B)), x, (-1.0 / B));
} else if (F <= 7e+102) {
tmp = (F / (B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - (x / tan(B));
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+27) tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 / B)); elseif (F <= 7e+102) tmp = Float64(Float64(F / Float64(B * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+27], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e+102], N[(N[(F / N[(B * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{-1}{B}\right)\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+102}:\\
\;\;\;\;\frac{F}{B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.99999999999999979e27Initial program 60.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6460.1
Applied rewrites60.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6450.2
Applied rewrites50.2%
Taylor expanded in F around -inf
Applied rewrites74.8%
if -4.99999999999999979e27 < F < 7.00000000000000021e102Initial program 98.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6484.2
Applied rewrites84.2%
if 7.00000000000000021e102 < F Initial program 44.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6478.2
Applied rewrites78.2%
Final simplification81.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))))
(if (<= B 0.56)
(/
(fma
(* B B)
(fma
t_0
(fma (* F (* B B)) 0.019444444444444445 (* F 0.16666666666666666))
(* x (fma 0.022222222222222223 (* B B) 0.3333333333333333)))
(fma F t_0 (- x)))
B)
(+
(* x (/ -1.0 (tan B)))
(/ 1.0 (fma B (* (* B B) -0.16666666666666666) B))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))));
double tmp;
if (B <= 0.56) {
tmp = fma((B * B), fma(t_0, fma((F * (B * B)), 0.019444444444444445, (F * 0.16666666666666666)), (x * fma(0.022222222222222223, (B * B), 0.3333333333333333))), fma(F, t_0, -x)) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / fma(B, ((B * B) * -0.16666666666666666), B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) tmp = 0.0 if (B <= 0.56) tmp = Float64(fma(Float64(B * B), fma(t_0, fma(Float64(F * Float64(B * B)), 0.019444444444444445, Float64(F * 0.16666666666666666)), Float64(x * fma(0.022222222222222223, Float64(B * B), 0.3333333333333333))), fma(F, t_0, Float64(-x))) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / fma(B, Float64(Float64(B * B) * -0.16666666666666666), B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.56], N[(N[(N[(B * B), $MachinePrecision] * N[(t$95$0 * N[(N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.019444444444444445 + N[(F * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F * t$95$0 + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[(B * N[(N[(B * B), $MachinePrecision] * -0.16666666666666666), $MachinePrecision] + B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.56:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(t\_0, \mathsf{fma}\left(F \cdot \left(B \cdot B\right), 0.019444444444444445, F \cdot 0.16666666666666666\right), x \cdot \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right)\right), \mathsf{fma}\left(F, t\_0, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\mathsf{fma}\left(B, \left(B \cdot B\right) \cdot -0.16666666666666666, B\right)}\\
\end{array}
\end{array}
if B < 0.56000000000000005Initial program 77.3%
Taylor expanded in B around 0
Applied rewrites62.9%
if 0.56000000000000005 < B Initial program 90.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6445.3
Applied rewrites45.3%
Taylor expanded in B around 0
Applied rewrites58.7%
Final simplification61.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))))
(if (<= B 0.56)
(/
(fma
(* B B)
(fma
t_0
(fma (* F (* B B)) 0.019444444444444445 (* F 0.16666666666666666))
(* x (fma 0.022222222222222223 (* B B) 0.3333333333333333)))
(fma F t_0 (- x)))
B)
(fma (/ -1.0 (tan B)) x (* (/ F B) (/ 1.0 F))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))));
double tmp;
if (B <= 0.56) {
tmp = fma((B * B), fma(t_0, fma((F * (B * B)), 0.019444444444444445, (F * 0.16666666666666666)), (x * fma(0.022222222222222223, (B * B), 0.3333333333333333))), fma(F, t_0, -x)) / B;
} else {
tmp = fma((-1.0 / tan(B)), x, ((F / B) * (1.0 / F)));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) tmp = 0.0 if (B <= 0.56) tmp = Float64(fma(Float64(B * B), fma(t_0, fma(Float64(F * Float64(B * B)), 0.019444444444444445, Float64(F * 0.16666666666666666)), Float64(x * fma(0.022222222222222223, Float64(B * B), 0.3333333333333333))), fma(F, t_0, Float64(-x))) / B); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(Float64(F / B) * Float64(1.0 / F))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.56], N[(N[(N[(B * B), $MachinePrecision] * N[(t$95$0 * N[(N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.019444444444444445 + N[(F * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F * t$95$0 + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(N[(F / B), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.56:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(t\_0, \mathsf{fma}\left(F \cdot \left(B \cdot B\right), 0.019444444444444445, F \cdot 0.16666666666666666\right), x \cdot \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right)\right), \mathsf{fma}\left(F, t\_0, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{F}{B} \cdot \frac{1}{F}\right)\\
\end{array}
\end{array}
if B < 0.56000000000000005Initial program 77.3%
Taylor expanded in B around 0
Applied rewrites62.9%
if 0.56000000000000005 < B Initial program 90.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6490.1
Applied rewrites90.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6462.3
Applied rewrites62.3%
Taylor expanded in F around inf
Applied rewrites58.4%
Final simplification61.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))))
(if (<= B 0.34)
(/
(fma
(* B B)
(fma
t_0
(fma (* F (* B B)) 0.019444444444444445 (* F 0.16666666666666666))
(* x (fma 0.022222222222222223 (* B B) 0.3333333333333333)))
(fma F t_0 (- x)))
B)
(fma (/ -1.0 (tan B)) x (/ -1.0 B)))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))));
double tmp;
if (B <= 0.34) {
tmp = fma((B * B), fma(t_0, fma((F * (B * B)), 0.019444444444444445, (F * 0.16666666666666666)), (x * fma(0.022222222222222223, (B * B), 0.3333333333333333))), fma(F, t_0, -x)) / B;
} else {
tmp = fma((-1.0 / tan(B)), x, (-1.0 / B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) tmp = 0.0 if (B <= 0.34) tmp = Float64(fma(Float64(B * B), fma(t_0, fma(Float64(F * Float64(B * B)), 0.019444444444444445, Float64(F * 0.16666666666666666)), Float64(x * fma(0.022222222222222223, Float64(B * B), 0.3333333333333333))), fma(F, t_0, Float64(-x))) / B); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.34], N[(N[(N[(B * B), $MachinePrecision] * N[(t$95$0 * N[(N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.019444444444444445 + N[(F * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F * t$95$0 + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.34:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(t\_0, \mathsf{fma}\left(F \cdot \left(B \cdot B\right), 0.019444444444444445, F \cdot 0.16666666666666666\right), x \cdot \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right)\right), \mathsf{fma}\left(F, t\_0, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 0.340000000000000024Initial program 77.3%
Taylor expanded in B around 0
Applied rewrites62.9%
if 0.340000000000000024 < B Initial program 90.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6490.1
Applied rewrites90.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6462.3
Applied rewrites62.3%
Taylor expanded in F around -inf
Applied rewrites55.8%
Final simplification61.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1050000.0)
(/ (fma 0.5 (/ (fma x 2.0 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 2800.0)
(+
(/
(fma
(* B B)
(fma
(* B B)
(fma
(* B B)
(fma
x
0.009523809523809525
(* (* x 0.022222222222222223) -0.3333333333333333))
(* x 0.022222222222222223))
(* x 0.3333333333333333))
(- x))
B)
(* (/ F B) (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))))
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1050000.0) {
tmp = fma(0.5, (fma(x, 2.0, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 2800.0) {
tmp = (fma((B * B), fma((B * B), fma((B * B), fma(x, 0.009523809523809525, ((x * 0.022222222222222223) * -0.3333333333333333)), (x * 0.022222222222222223)), (x * 0.3333333333333333)), -x) / B) + ((F / B) * sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1050000.0) tmp = Float64(fma(0.5, Float64(fma(x, 2.0, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 2800.0) tmp = Float64(Float64(fma(Float64(B * B), fma(Float64(B * B), fma(Float64(B * B), fma(x, 0.009523809523809525, Float64(Float64(x * 0.022222222222222223) * -0.3333333333333333)), Float64(x * 0.022222222222222223)), Float64(x * 0.3333333333333333)), Float64(-x)) / B) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1050000.0], N[(N[(0.5 * N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2800.0], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(x * 0.009523809523809525 + N[(N[(x * 0.022222222222222223), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(x * 0.022222222222222223), $MachinePrecision]), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1050000:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 2800:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, \left(x \cdot 0.022222222222222223\right) \cdot -0.3333333333333333\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), -x\right)}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.05e6Initial program 60.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites53.9%
if -1.05e6 < F < 2800Initial program 99.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6434.3
Applied rewrites34.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites19.4%
Taylor expanded in B around 0
lower-*.f64N/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.f6452.7
Applied rewrites52.7%
if 2800 < F Initial program 59.0%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f6475.2
Applied rewrites75.2%
Final simplification58.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1050000.0)
(/ (fma 0.5 (/ (fma x 2.0 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 75000000.0)
(+
(/
(fma
(* B B)
(fma
(* B B)
(fma
(* B B)
(fma
x
0.009523809523809525
(* (* x 0.022222222222222223) -0.3333333333333333))
(* x 0.022222222222222223))
(* x 0.3333333333333333))
(- x))
B)
(* (/ F B) (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1050000.0) {
tmp = fma(0.5, (fma(x, 2.0, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 75000000.0) {
tmp = (fma((B * B), fma((B * B), fma((B * B), fma(x, 0.009523809523809525, ((x * 0.022222222222222223) * -0.3333333333333333)), (x * 0.022222222222222223)), (x * 0.3333333333333333)), -x) / B) + ((F / B) * sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1050000.0) tmp = Float64(fma(0.5, Float64(fma(x, 2.0, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 75000000.0) tmp = Float64(Float64(fma(Float64(B * B), fma(Float64(B * B), fma(Float64(B * B), fma(x, 0.009523809523809525, Float64(Float64(x * 0.022222222222222223) * -0.3333333333333333)), Float64(x * 0.022222222222222223)), Float64(x * 0.3333333333333333)), Float64(-x)) / B) + Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1050000.0], N[(N[(0.5 * N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 75000000.0], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(x * 0.009523809523809525 + N[(N[(x * 0.022222222222222223), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(x * 0.022222222222222223), $MachinePrecision]), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1050000:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 75000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.009523809523809525, \left(x \cdot 0.022222222222222223\right) \cdot -0.3333333333333333\right), x \cdot 0.022222222222222223\right), x \cdot 0.3333333333333333\right), -x\right)}{B} + \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.05e6Initial program 60.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites53.9%
if -1.05e6 < F < 7.5e7Initial program 99.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6434.3
Applied rewrites34.3%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites19.4%
Taylor expanded in B around 0
lower-*.f64N/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.f6452.7
Applied rewrites52.7%
if 7.5e7 < F Initial program 59.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.5
Applied rewrites40.5%
Taylor expanded in F around inf
Applied rewrites51.7%
(FPCore (F B x)
:precision binary64
(if (<= B 0.044)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma 0.16666666666666666 (* F (* B B)) F)
(- (* 0.3333333333333333 (* x (* B B))) x))
B)
(fma (/ -1.0 (tan B)) x (/ -1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.044) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), ((0.3333333333333333 * (x * (B * B))) - x)) / B;
} else {
tmp = fma((-1.0 / tan(B)), x, (-1.0 / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.044) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), Float64(Float64(0.3333333333333333 * Float64(x * Float64(B * B))) - x)) / B); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.044], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.044:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), 0.3333333333333333 \cdot \left(x \cdot \left(B \cdot B\right)\right) - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{-1}{B}\right)\\
\end{array}
\end{array}
if B < 0.043999999999999997Initial program 77.3%
Taylor expanded in B around 0
Applied rewrites62.7%
if 0.043999999999999997 < B Initial program 90.1%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6490.1
Applied rewrites90.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6462.3
Applied rewrites62.3%
Taylor expanded in F around -inf
Applied rewrites55.8%
Final simplification60.9%
(FPCore (F B x)
:precision binary64
(if (<= F -1150000.0)
(/ (fma 0.5 (/ (fma x 2.0 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 80000000.0)
(fma
(/
-1.0
(*
B
(fma
(* B B)
(fma (* B B) 0.13333333333333333 0.3333333333333333)
1.0)))
x
(* (/ F B) (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1150000.0) {
tmp = fma(0.5, (fma(x, 2.0, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 80000000.0) {
tmp = fma((-1.0 / (B * fma((B * B), fma((B * B), 0.13333333333333333, 0.3333333333333333), 1.0))), x, ((F / B) * sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1150000.0) tmp = Float64(fma(0.5, Float64(fma(x, 2.0, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 80000000.0) tmp = fma(Float64(-1.0 / Float64(B * fma(Float64(B * B), fma(Float64(B * B), 0.13333333333333333, 0.3333333333333333), 1.0))), x, Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1150000.0], N[(N[(0.5 * N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 80000000.0], N[(N[(-1.0 / N[(B * N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * 0.13333333333333333 + 0.3333333333333333), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1150000:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 80000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{B \cdot \mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, 0.13333333333333333, 0.3333333333333333\right), 1\right)}, x, \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.15e6Initial program 60.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites53.9%
if -1.15e6 < F < 8e7Initial program 99.5%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in B around 0
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.6
Applied rewrites52.6%
if 8e7 < F Initial program 59.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.5
Applied rewrites40.5%
Taylor expanded in F around inf
Applied rewrites51.7%
Final simplification52.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1050000.0)
(/ (fma 0.5 (/ (fma x 2.0 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 26000000.0)
(fma
(/
(fma (* B B) (fma (* B B) 0.022222222222222223 0.3333333333333333) -1.0)
B)
x
(* (/ F B) (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1050000.0) {
tmp = fma(0.5, (fma(x, 2.0, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 26000000.0) {
tmp = fma((fma((B * B), fma((B * B), 0.022222222222222223, 0.3333333333333333), -1.0) / B), x, ((F / B) * sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))))));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1050000.0) tmp = Float64(fma(0.5, Float64(fma(x, 2.0, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 26000000.0) tmp = fma(Float64(fma(Float64(B * B), fma(Float64(B * B), 0.022222222222222223, 0.3333333333333333), -1.0) / B), x, Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1050000.0], N[(N[(0.5 * N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 26000000.0], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * 0.022222222222222223 + 0.3333333333333333), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision] * x + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1050000:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 26000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(B \cdot B, 0.022222222222222223, 0.3333333333333333\right), -1\right)}{B}, x, \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.05e6Initial program 60.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites53.9%
if -1.05e6 < F < 2.6e7Initial program 99.5%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.4
Applied rewrites52.4%
if 2.6e7 < F Initial program 59.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.5
Applied rewrites40.5%
Taylor expanded in F around inf
Applied rewrites51.7%
Final simplification52.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1250000.0)
(/ (fma 0.5 (/ (fma x 2.0 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 22000000000.0)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma 0.16666666666666666 (* F (* B B)) F)
(- (* 0.3333333333333333 (* x (* B B))) x))
B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1250000.0) {
tmp = fma(0.5, (fma(x, 2.0, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 22000000000.0) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), ((0.3333333333333333 * (x * (B * B))) - x)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1250000.0) tmp = Float64(fma(0.5, Float64(fma(x, 2.0, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 22000000000.0) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), Float64(Float64(0.3333333333333333 * Float64(x * Float64(B * B))) - x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1250000.0], N[(N[(0.5 * N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 22000000000.0], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(0.3333333333333333 * N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1250000:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 22000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), 0.3333333333333333 \cdot \left(x \cdot \left(B \cdot B\right)\right) - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.25e6Initial program 60.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites53.9%
if -1.25e6 < F < 2.2e10Initial program 99.5%
Taylor expanded in B around 0
Applied rewrites52.4%
if 2.2e10 < F Initial program 59.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.5
Applied rewrites40.5%
Taylor expanded in F around inf
Applied rewrites51.7%
Final simplification52.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (fma x 2.0 2.0) (* F F))))
(if (<= F -1150000.0)
(/ (fma 0.5 t_0 (- -1.0 x)) B)
(if (<= F 2.2e+40)
(fma
(/ (fma (* B B) 0.3333333333333333 -1.0) B)
x
(* (/ F B) (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))))
(/ (fma -0.5 t_0 (- 1.0 x)) B)))))
double code(double F, double B, double x) {
double t_0 = fma(x, 2.0, 2.0) / (F * F);
double tmp;
if (F <= -1150000.0) {
tmp = fma(0.5, t_0, (-1.0 - x)) / B;
} else if (F <= 2.2e+40) {
tmp = fma((fma((B * B), 0.3333333333333333, -1.0) / B), x, ((F / B) * sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))))));
} else {
tmp = fma(-0.5, t_0, (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(fma(x, 2.0, 2.0) / Float64(F * F)) tmp = 0.0 if (F <= -1150000.0) tmp = Float64(fma(0.5, t_0, Float64(-1.0 - x)) / B); elseif (F <= 2.2e+40) tmp = fma(Float64(fma(Float64(B * B), 0.3333333333333333, -1.0) / B), x, Float64(Float64(F / B) * sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))))); else tmp = Float64(fma(-0.5, t_0, Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1150000.0], N[(N[(0.5 * t$95$0 + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e+40], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333 + -1.0), $MachinePrecision] / B), $MachinePrecision] * x + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * t$95$0 + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}\\
\mathbf{if}\;F \leq -1150000:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, t\_0, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{+40}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(B \cdot B, 0.3333333333333333, -1\right)}{B}, x, \frac{F}{B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, t\_0, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.15e6Initial program 60.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites53.9%
if -1.15e6 < F < 2.1999999999999999e40Initial program 99.5%
lift-+.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
metadata-evalN/A
lower-/.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6485.3
Applied rewrites85.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6452.7
Applied rewrites52.7%
if 2.1999999999999999e40 < F Initial program 54.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6438.4
Applied rewrites38.4%
Taylor expanded in F around inf
Applied rewrites50.8%
Final simplification52.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+80)
(/ (- -1.0 x) B)
(if (<= F 500000.0)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+80) {
tmp = (-1.0 - x) / B;
} else if (F <= 500000.0) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+80) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 500000.0) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+80], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 500000.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+80}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 500000:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2e80Initial program 56.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6436.9
Applied rewrites36.9%
Taylor expanded in F around -inf
Applied rewrites50.0%
if -2e80 < F < 5e5Initial program 98.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6452.7
Applied rewrites52.7%
if 5e5 < F Initial program 59.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.5
Applied rewrites40.5%
Taylor expanded in F around inf
Applied rewrites51.7%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+117)
(/ (- -1.0 x) B)
(if (<= F 1e+23)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) x) B)
(fma -0.5 (/ (* 2.0 x) (* B (* F F))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+117) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e+23) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B;
} else {
tmp = fma(-0.5, ((2.0 * x) / (B * (F * F))), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+117) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1e+23) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - x) / B); else tmp = fma(-0.5, Float64(Float64(2.0 * x) / Float64(B * Float64(F * F))), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+117], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e+23], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(-0.5 * N[(N[(2.0 * x), $MachinePrecision] / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+117}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 10^{+23}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{2 \cdot x}{B \cdot \left(F \cdot F\right)}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -4.99999999999999983e117Initial program 41.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6430.7
Applied rewrites30.7%
Taylor expanded in F around -inf
Applied rewrites48.1%
if -4.99999999999999983e117 < F < 9.9999999999999992e22Initial program 98.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6453.2
Applied rewrites53.2%
Applied rewrites53.2%
if 9.9999999999999992e22 < F Initial program 57.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6439.3
Applied rewrites39.3%
Taylor expanded in F around inf
Applied rewrites50.9%
Taylor expanded in x around inf
Applied rewrites50.9%
(FPCore (F B x)
:precision binary64
(if (<= F -920000.0)
(/ (fma 0.5 (/ (fma x 2.0 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 3.4e-12)
(/ (fma F (sqrt (/ 1.0 (fma F F 2.0))) (- x)) B)
(fma -0.5 (/ 2.0 (* B (* F F))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -920000.0) {
tmp = fma(0.5, (fma(x, 2.0, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 3.4e-12) {
tmp = fma(F, sqrt((1.0 / fma(F, F, 2.0))), -x) / B;
} else {
tmp = fma(-0.5, (2.0 / (B * (F * F))), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -920000.0) tmp = Float64(fma(0.5, Float64(fma(x, 2.0, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 3.4e-12) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(F, F, 2.0))), Float64(-x)) / B); else tmp = fma(-0.5, Float64(2.0 / Float64(B * Float64(F * F))), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -920000.0], N[(N[(0.5 * N[(N[(x * 2.0 + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-12], N[(N[(F * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(-0.5 * N[(2.0 / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -920000:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.5, \frac{\mathsf{fma}\left(x, 2, 2\right)}{F \cdot F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{2}{B \cdot \left(F \cdot F\right)}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -9.2e5Initial program 60.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.3
Applied rewrites43.3%
Taylor expanded in F around -inf
Applied rewrites53.9%
if -9.2e5 < F < 3.4000000000000001e-12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.8
Applied rewrites51.8%
Taylor expanded in x around 0
Applied rewrites51.8%
if 3.4000000000000001e-12 < F Initial program 60.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites50.2%
Taylor expanded in x around 0
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2)
(/ (- -1.0 x) B)
(if (<= F 3.4e-12)
(/ (fma F (sqrt (fma (* F F) -0.25 0.5)) (- x)) B)
(fma -0.5 (/ 2.0 (* B (* F F))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.4e-12) {
tmp = fma(F, sqrt(fma((F * F), -0.25, 0.5)), -x) / B;
} else {
tmp = fma(-0.5, (2.0 / (B * (F * F))), ((1.0 - x) / B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.2) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.4e-12) tmp = Float64(fma(F, sqrt(fma(Float64(F * F), -0.25, 0.5)), Float64(-x)) / B); else tmp = fma(-0.5, Float64(2.0 / Float64(B * Float64(F * F))), Float64(Float64(1.0 - x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.2], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.4e-12], N[(N[(F * N[Sqrt[N[(N[(F * F), $MachinePrecision] * -0.25 + 0.5), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(-0.5 * N[(2.0 / N[(B * N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\mathsf{fma}\left(F \cdot F, -0.25, 0.5\right)}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \frac{2}{B \cdot \left(F \cdot F\right)}, \frac{1 - x}{B}\right)\\
\end{array}
\end{array}
if F < -1.19999999999999996Initial program 61.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.5
Applied rewrites43.5%
Taylor expanded in F around -inf
Applied rewrites53.6%
if -1.19999999999999996 < F < 3.4000000000000001e-12Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.8
Applied rewrites51.8%
Taylor expanded in x around 0
Applied rewrites51.8%
Taylor expanded in F around 0
Applied rewrites51.8%
if 3.4000000000000001e-12 < F Initial program 60.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites50.2%
Taylor expanded in x around 0
Applied rewrites50.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2)
(/ (- -1.0 x) B)
(if (<= F 1.22)
(/ (fma F (sqrt (fma (* F F) -0.25 0.5)) (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.22) {
tmp = fma(F, sqrt(fma((F * F), -0.25, 0.5)), -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.2) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.22) tmp = Float64(fma(F, sqrt(fma(Float64(F * F), -0.25, 0.5)), Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.2], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22], N[(N[(F * N[Sqrt[N[(N[(F * F), $MachinePrecision] * -0.25 + 0.5), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.22:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\mathsf{fma}\left(F \cdot F, -0.25, 0.5\right)}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.19999999999999996Initial program 61.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.5
Applied rewrites43.5%
Taylor expanded in F around -inf
Applied rewrites53.6%
if -1.19999999999999996 < F < 1.21999999999999997Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites51.1%
Taylor expanded in F around 0
Applied rewrites51.0%
if 1.21999999999999997 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6441.2
Applied rewrites41.2%
Taylor expanded in F around inf
Applied rewrites51.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.45) (/ (- -1.0 x) B) (if (<= F 1.4) (/ (fma F (sqrt 0.5) (- x)) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4) {
tmp = fma(F, sqrt(0.5), -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4) tmp = Float64(fma(F, sqrt(0.5), Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.45], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[Sqrt[0.5], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{0.5}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 61.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6443.5
Applied rewrites43.5%
Taylor expanded in F around -inf
Applied rewrites53.6%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.1
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites51.1%
Taylor expanded in F around 0
Applied rewrites50.8%
if 1.3999999999999999 < F Initial program 59.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6441.2
Applied rewrites41.2%
Taylor expanded in F around inf
Applied rewrites51.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.15e-117) (/ (- -1.0 x) B) (if (<= F 1.75e-76) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-117) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.75e-76) {
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.15d-117)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.75d-76) 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.15e-117) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.75e-76) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.15e-117: tmp = (-1.0 - x) / B elif F <= 1.75e-76: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.15e-117) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.75e-76) 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.15e-117) tmp = (-1.0 - x) / B; elseif (F <= 1.75e-76) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.15e-117], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.75e-76], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{-117}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{-76}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.14999999999999997e-117Initial program 73.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6450.4
Applied rewrites50.4%
Taylor expanded in F around -inf
Applied rewrites42.2%
if -1.14999999999999997e-117 < F < 1.74999999999999999e-76Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6448.1
Applied rewrites48.1%
Taylor expanded in F around 0
Applied rewrites40.4%
if 1.74999999999999999e-76 < F Initial program 66.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6441.8
Applied rewrites41.8%
Taylor expanded in F around inf
Applied rewrites45.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.15e-117) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.15e-117) {
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.15d-117)) 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.15e-117) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.15e-117: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.15e-117) 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.15e-117) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.15e-117], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.15 \cdot 10^{-117}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.14999999999999997e-117Initial program 73.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6450.4
Applied rewrites50.4%
Taylor expanded in F around -inf
Applied rewrites42.2%
if -1.14999999999999997e-117 < F Initial program 83.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6445.1
Applied rewrites45.1%
Taylor expanded in F around 0
Applied rewrites33.2%
(FPCore (F B x) :precision binary64 (if (<= F -5.7e+48) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.7e+48) {
tmp = -1.0 / 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 <= (-5.7d+48)) then
tmp = (-1.0d0) / 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 <= -5.7e+48) {
tmp = -1.0 / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.7e+48: tmp = -1.0 / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.7e+48) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.7e+48) tmp = -1.0 / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.7e+48], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.7 \cdot 10^{+48}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -5.69999999999999968e48Initial program 56.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6438.9
Applied rewrites38.9%
Taylor expanded in F around -inf
Applied rewrites51.1%
Taylor expanded in x around 0
Applied rewrites34.3%
if -5.69999999999999968e48 < F Initial program 86.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6448.6
Applied rewrites48.6%
Taylor expanded in F around 0
Applied rewrites31.6%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 80.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6446.8
Applied rewrites46.8%
Taylor expanded in F around -inf
Applied rewrites29.1%
Taylor expanded in x around 0
Applied rewrites10.0%
herbie shell --seed 2024223
(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))))))