
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(if (<= F -1.85e+161)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 0.00032)
(fma
(pow (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0)))) -1.0)
F
(/ (- x) (tan B)))
(- (pow (sin B) -1.0) (* (cos B) (/ x (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.85e+161) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 0.00032) {
tmp = fma(pow((sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))), -1.0), F, (-x / tan(B)));
} else {
tmp = pow(sin(B), -1.0) - (cos(B) * (x / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.85e+161) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 0.00032) tmp = fma((Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))) ^ -1.0), F, Float64(Float64(-x) / tan(B))); else tmp = Float64((sin(B) ^ -1.0) - Float64(cos(B) * Float64(x / sin(B)))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.85e+161], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00032], N[(N[Power[N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * N[(x / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.85 \cdot 10^{+161}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.00032:\\
\;\;\;\;\mathsf{fma}\left({\left(\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-1}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1} - \cos B \cdot \frac{x}{\sin B}\\
\end{array}
\end{array}
if F < -1.8499999999999999e161Initial program 30.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -1.8499999999999999e161 < F < 3.20000000000000026e-4Initial program 97.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lift-pow.f64N/A
pow-flipN/A
metadata-evalN/A
pow1/2N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites99.7%
if 3.20000000000000026e-4 < F Initial program 59.4%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -1.85e+161)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 5e+15)
(fma
(pow (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0)))) -1.0)
F
(/ (- x) (tan B)))
(+ t_0 (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.85e+161) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 5e+15) {
tmp = fma(pow((sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))), -1.0), F, (-x / tan(B)));
} else {
tmp = t_0 + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.85e+161) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 5e+15) tmp = fma((Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0)))) ^ -1.0), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(t_0 + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.85e+161], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e+15], N[(N[Power[N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{+161}:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left({\left(\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}\right)}^{-1}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.8499999999999999e161Initial program 30.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -1.8499999999999999e161 < F < 5e15Initial program 97.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lift-pow.f64N/A
pow-flipN/A
metadata-evalN/A
pow1/2N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites99.7%
if 5e15 < F Initial program 58.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+93)
(fma (/ (/ -1.0 F) (sin B)) F (/ (- x) (tan B)))
(if (<= F 5e+15)
(- (/ F (* (sin B) (sqrt (fma F F 2.0)))) (/ x (tan B)))
(+ (* x (/ -1.0 (tan B))) (pow (sin B) -1.0)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+93) {
tmp = fma(((-1.0 / F) / sin(B)), F, (-x / tan(B)));
} else if (F <= 5e+15) {
tmp = (F / (sin(B) * sqrt(fma(F, F, 2.0)))) - (x / tan(B));
} else {
tmp = (x * (-1.0 / tan(B))) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+93) tmp = fma(Float64(Float64(-1.0 / F) / sin(B)), F, Float64(Float64(-x) / tan(B))); elseif (F <= 5e+15) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))) - Float64(x / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+93], N[(N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e+15], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{-1}{F}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+15}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.9500000000000001e93Initial program 47.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites67.4%
Taylor expanded in F around -inf
lower-/.f6499.8
Applied rewrites99.8%
if -1.9500000000000001e93 < F < 5e15Initial program 98.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
if 5e15 < F Initial program 58.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(fma (/ (/ -1.0 F) (sin B)) F (/ (- x) (tan B)))
(if (<= F 0.00032)
(- (/ F (* (sin B) (sqrt 2.0))) (/ x (tan B)))
(+ (* x (/ -1.0 (tan B))) (pow (sin B) -1.0)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = fma(((-1.0 / F) / sin(B)), F, (-x / tan(B)));
} else if (F <= 0.00032) {
tmp = (F / (sin(B) * sqrt(2.0))) - (x / tan(B));
} else {
tmp = (x * (-1.0 / tan(B))) + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = fma(Float64(Float64(-1.0 / F) / sin(B)), F, Float64(Float64(-x) / tan(B))); elseif (F <= 0.00032) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(2.0))) - Float64(x / tan(B))); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(N[(-1.0 / F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00032], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{-1}{F}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 0.00032:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 56.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.0%
Taylor expanded in F around -inf
lower-/.f6498.5
Applied rewrites98.5%
if -1.3999999999999999 < F < 3.20000000000000026e-4Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in F around 0
Applied rewrites99.6%
if 3.20000000000000026e-4 < F Initial program 59.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -1.5)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 0.00032)
(- (/ F (* (sin B) (sqrt 2.0))) (/ x (tan B)))
(+ t_0 (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -1.5) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 0.00032) {
tmp = (F / (sin(B) * sqrt(2.0))) - (x / tan(B));
} else {
tmp = t_0 + pow(sin(B), -1.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 * ((-1.0d0) / tan(b))
if (f <= (-1.5d0)) then
tmp = t_0 + ((-1.0d0) / sin(b))
else if (f <= 0.00032d0) then
tmp = (f / (sin(b) * sqrt(2.0d0))) - (x / tan(b))
else
tmp = t_0 + (sin(b) ** (-1.0d0))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -1.5) {
tmp = t_0 + (-1.0 / Math.sin(B));
} else if (F <= 0.00032) {
tmp = (F / (Math.sin(B) * Math.sqrt(2.0))) - (x / Math.tan(B));
} else {
tmp = t_0 + Math.pow(Math.sin(B), -1.0);
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -1.5: tmp = t_0 + (-1.0 / math.sin(B)) elif F <= 0.00032: tmp = (F / (math.sin(B) * math.sqrt(2.0))) - (x / math.tan(B)) else: tmp = t_0 + math.pow(math.sin(B), -1.0) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -1.5) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 0.00032) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(2.0))) - Float64(x / tan(B))); else tmp = Float64(t_0 + (sin(B) ^ -1.0)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -1.5) tmp = t_0 + (-1.0 / sin(B)); elseif (F <= 0.00032) tmp = (F / (sin(B) * sqrt(2.0))) - (x / tan(B)); else tmp = t_0 + (sin(B) ^ -1.0); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.00032], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -1.5:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 0.00032:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -1.5Initial program 56.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.5
Applied rewrites98.5%
if -1.5 < F < 3.20000000000000026e-4Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in F around 0
Applied rewrites99.6%
if 3.20000000000000026e-4 < F Initial program 59.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -80.0)
(+ t_0 (/ -1.0 (sin B)))
(if (<= F 5.8e-45)
(- (/ F (* (sqrt (fma F F (fma x 2.0 2.0))) B)) (/ x (tan B)))
(+ t_0 (pow (sin B) -1.0))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -80.0) {
tmp = t_0 + (-1.0 / sin(B));
} else if (F <= 5.8e-45) {
tmp = (F / (sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - (x / tan(B));
} else {
tmp = t_0 + pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -80.0) tmp = Float64(t_0 + Float64(-1.0 / sin(B))); elseif (F <= 5.8e-45) tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - Float64(x / tan(B))); else tmp = Float64(t_0 + (sin(B) ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -80.0], N[(t$95$0 + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.8e-45], N[(N[(F / N[(N[Sqrt[N[(F * F + N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -80:\\
\;\;\;\;t\_0 + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-45}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)} \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + {\sin B}^{-1}\\
\end{array}
\end{array}
if F < -80Initial program 55.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -80 < F < 5.8e-45Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.4
Applied rewrites84.4%
if 5.8e-45 < F Initial program 61.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6498.6
Applied rewrites98.6%
Final simplification92.8%
(FPCore (F B x)
:precision binary64
(if (<= F 2.65e-23)
(fma
(pow (* (sqrt (fma (+ 1.0 x) 2.0 (* F F))) B) -1.0)
F
(/ (- x) (tan B)))
(- (/ F (* (sin B) F)) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.65e-23) {
tmp = fma(pow((sqrt(fma((1.0 + x), 2.0, (F * F))) * B), -1.0), F, (-x / tan(B)));
} else {
tmp = (F / (sin(B) * F)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= 2.65e-23) tmp = fma((Float64(sqrt(fma(Float64(1.0 + x), 2.0, Float64(F * F))) * B) ^ -1.0), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(F / Float64(sin(B) * F)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, 2.65e-23], N[(N[Power[N[(N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.65 \cdot 10^{-23}:\\
\;\;\;\;\mathsf{fma}\left({\left(\sqrt{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)} \cdot B\right)}^{-1}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot F} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < 2.65000000000000021e-23Initial program 83.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites90.2%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lift-pow.f64N/A
pow-flipN/A
metadata-evalN/A
pow1/2N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites90.2%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6477.9
Applied rewrites77.9%
if 2.65000000000000021e-23 < F Initial program 60.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.7%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites79.6%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6498.6
Applied rewrites98.6%
Final simplification84.6%
(FPCore (F B x)
:precision binary64
(if (<= x -7.8e-210)
(fma
(pow (* (sqrt (fma (+ 1.0 x) 2.0 (* F F))) B) -1.0)
F
(/ (- x) (tan B)))
(if (<= x 6.6e-168)
(/ F (* (sqrt (fma F F 2.0)) (sin B)))
(- (/ F (* (sqrt (fma F F (fma x 2.0 2.0))) B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -7.8e-210) {
tmp = fma(pow((sqrt(fma((1.0 + x), 2.0, (F * F))) * B), -1.0), F, (-x / tan(B)));
} else if (x <= 6.6e-168) {
tmp = F / (sqrt(fma(F, F, 2.0)) * sin(B));
} else {
tmp = (F / (sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (x <= -7.8e-210) tmp = fma((Float64(sqrt(fma(Float64(1.0 + x), 2.0, Float64(F * F))) * B) ^ -1.0), F, Float64(Float64(-x) / tan(B))); elseif (x <= 6.6e-168) tmp = Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))); else tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[x, -7.8e-210], N[(N[Power[N[(N[Sqrt[N[(N[(1.0 + x), $MachinePrecision] * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.6e-168], N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(N[Sqrt[N[(F * F + N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{-210}:\\
\;\;\;\;\mathsf{fma}\left({\left(\sqrt{\mathsf{fma}\left(1 + x, 2, F \cdot F\right)} \cdot B\right)}^{-1}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;x \leq 6.6 \cdot 10^{-168}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)} \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if x < -7.7999999999999995e-210Initial program 70.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites87.2%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
div-invN/A
lift-pow.f64N/A
pow-flipN/A
metadata-evalN/A
pow1/2N/A
lift-fma.f64N/A
+-commutativeN/A
lift-fma.f64N/A
*-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lift-fma.f64N/A
lift-fma.f64N/A
lower-*.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
*-commutativeN/A
Applied rewrites87.3%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
associate-+r+N/A
*-commutativeN/A
distribute-rgt1-inN/A
+-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
unpow2N/A
lower-*.f6478.5
Applied rewrites78.5%
if -7.7999999999999995e-210 < x < 6.6000000000000003e-168Initial program 74.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites76.1%
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.f6466.0
Applied rewrites66.0%
Applied rewrites67.6%
if 6.6000000000000003e-168 < x Initial program 81.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites93.3%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites93.3%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6493.3
Applied rewrites93.3%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.8
Applied rewrites87.8%
Final simplification79.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -80.0)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 2.65e-23)
(- (/ F (* (sqrt (fma F F (fma x 2.0 2.0))) B)) t_0)
(- (/ F (* (sin B) F)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -80.0) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 2.65e-23) {
tmp = (F / (sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - t_0;
} else {
tmp = (F / (sin(B) * F)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -80.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 2.65e-23) tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - t_0); else tmp = Float64(Float64(F / Float64(sin(B) * F)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -80.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e-23], N[(N[(F / N[(N[Sqrt[N[(F * F + N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -80:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{-23}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)} \cdot B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot F} - t\_0\\
\end{array}
\end{array}
if F < -80Initial program 55.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -80 < F < 2.65000000000000021e-23Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6484.7
Applied rewrites84.7%
if 2.65000000000000021e-23 < F Initial program 60.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.7%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites79.6%
Taylor expanded in F around inf
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6498.6
Applied rewrites98.6%
Final simplification92.8%
(FPCore (F B x) :precision binary64 (if (<= B 2.9e-12) (/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B) (+ (* x (/ -1.0 (tan B))) (* (/ F B) (pow F -1.0)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.9e-12) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * pow(F, -1.0));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.9e-12) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * (F ^ -1.0))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.9e-12], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Power[F, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.9 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot {F}^{-1}\\
\end{array}
\end{array}
if B < 2.9000000000000002e-12Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6460.8
Applied rewrites60.8%
Applied rewrites60.8%
if 2.9000000000000002e-12 < B Initial program 88.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6461.2
Applied rewrites61.2%
Taylor expanded in F around inf
Applied rewrites62.7%
Final simplification61.3%
(FPCore (F B x) :precision binary64 (if (<= B 2.9e-12) (/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B) (+ (* x (/ -1.0 (tan B))) (pow B -1.0))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.9e-12) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + pow(B, -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.9e-12) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (B ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.9e-12], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.9 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {B}^{-1}\\
\end{array}
\end{array}
if B < 2.9000000000000002e-12Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6460.8
Applied rewrites60.8%
Applied rewrites60.8%
if 2.9000000000000002e-12 < B Initial program 88.0%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6461.2
Applied rewrites61.2%
Taylor expanded in F around inf
Applied rewrites61.2%
Final simplification60.9%
(FPCore (F B x)
:precision binary64
(if (<= B 2.9e-12)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(if (<= B 5.2e+116)
(pow (sin B) -1.0)
(/ F (* (sqrt (fma F F 2.0)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.9e-12) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else if (B <= 5.2e+116) {
tmp = pow(sin(B), -1.0);
} else {
tmp = F / (sqrt(fma(F, F, 2.0)) * sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.9e-12) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); elseif (B <= 5.2e+116) tmp = sin(B) ^ -1.0; else tmp = Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.9e-12], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 5.2e+116], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision], N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.9 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{elif}\;B \leq 5.2 \cdot 10^{+116}:\\
\;\;\;\;{\sin B}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}\\
\end{array}
\end{array}
if B < 2.9000000000000002e-12Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6460.8
Applied rewrites60.8%
Applied rewrites60.8%
if 2.9000000000000002e-12 < B < 5.19999999999999973e116Initial program 74.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.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.f6416.9
Applied rewrites16.9%
Taylor expanded in F around inf
Applied rewrites31.8%
if 5.19999999999999973e116 < B Initial program 98.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.0%
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.f6438.9
Applied rewrites38.9%
Applied rewrites39.0%
Final simplification54.7%
(FPCore (F B x) :precision binary64 (if (<= B 2.9e-12) (/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B) (if (<= B 1.85e+117) (pow (sin B) -1.0) (/ (* (sqrt 0.5) F) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.9e-12) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else if (B <= 1.85e+117) {
tmp = pow(sin(B), -1.0);
} else {
tmp = (sqrt(0.5) * F) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.9e-12) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); elseif (B <= 1.85e+117) tmp = sin(B) ^ -1.0; else tmp = Float64(Float64(sqrt(0.5) * F) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.9e-12], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 1.85e+117], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.9 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{elif}\;B \leq 1.85 \cdot 10^{+117}:\\
\;\;\;\;{\sin B}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B}\\
\end{array}
\end{array}
if B < 2.9000000000000002e-12Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6460.8
Applied rewrites60.8%
Applied rewrites60.8%
if 2.9000000000000002e-12 < B < 1.8499999999999999e117Initial program 74.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.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.f6416.9
Applied rewrites16.9%
Taylor expanded in F around inf
Applied rewrites31.8%
if 1.8499999999999999e117 < B Initial program 98.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.0%
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.f6438.9
Applied rewrites38.9%
Taylor expanded in F around 0
Applied rewrites20.6%
Final simplification52.2%
(FPCore (F B x) :precision binary64 (if (<= B 2.9e-12) (/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B) (pow (sin B) -1.0)))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.9e-12) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = pow(sin(B), -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 2.9e-12) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = sin(B) ^ -1.0; end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 2.9e-12], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.9 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;{\sin B}^{-1}\\
\end{array}
\end{array}
if B < 2.9000000000000002e-12Initial program 72.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6460.8
Applied rewrites60.8%
Applied rewrites60.8%
if 2.9000000000000002e-12 < B Initial program 88.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites88.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6429.3
Applied rewrites29.3%
Taylor expanded in F around inf
Applied rewrites21.8%
Final simplification51.4%
(FPCore (F B x) :precision binary64 (if (or (<= x -7.8e-210) (not (<= x 6.6e-168))) (- (/ F (* (sqrt (fma F F (fma x 2.0 2.0))) B)) (/ x (tan B))) (/ F (* (sqrt (fma F F 2.0)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -7.8e-210) || !(x <= 6.6e-168)) {
tmp = (F / (sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - (x / tan(B));
} else {
tmp = F / (sqrt(fma(F, F, 2.0)) * sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -7.8e-210) || !(x <= 6.6e-168)) tmp = Float64(Float64(F / Float64(sqrt(fma(F, F, fma(x, 2.0, 2.0))) * B)) - Float64(x / tan(B))); else tmp = Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -7.8e-210], N[Not[LessEqual[x, 6.6e-168]], $MachinePrecision]], N[(N[(F / N[(N[Sqrt[N[(F * F + N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{-210} \lor \neg \left(x \leq 6.6 \cdot 10^{-168}\right):\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(x, 2, 2\right)\right)} \cdot B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}\\
\end{array}
\end{array}
if x < -7.7999999999999995e-210 or 6.6000000000000003e-168 < x Initial program 76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites90.5%
lift-fma.f64N/A
lift-/.f64N/A
div-invN/A
lift-neg.f64N/A
lift-/.f64N/A
distribute-lft-neg-inN/A
lift-*.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites90.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6490.5
Applied rewrites90.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6483.6
Applied rewrites83.6%
if -7.7999999999999995e-210 < x < 6.6000000000000003e-168Initial program 74.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites76.1%
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.f6466.0
Applied rewrites66.0%
Applied rewrites67.6%
Final simplification79.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2.0)
(/ (fma 0.5 (/ (fma x 2.0 2.0) (* F F)) (- -1.0 x)) B)
(if (<= F 5.8e-45)
(/ (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 <= -2.0) {
tmp = fma(0.5, (fma(x, 2.0, 2.0) / (F * F)), (-1.0 - x)) / B;
} else if (F <= 5.8e-45) {
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 <= -2.0) tmp = Float64(fma(0.5, Float64(fma(x, 2.0, 2.0) / Float64(F * F)), Float64(-1.0 - x)) / B); elseif (F <= 5.8e-45) 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, -2.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, 5.8e-45], 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 -2:\\
\;\;\;\;\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 5.8 \cdot 10^{-45}:\\
\;\;\;\;\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 < -2Initial program 56.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.f6445.8
Applied rewrites45.8%
Taylor expanded in F around -inf
Applied rewrites59.6%
Applied rewrites59.6%
if -2 < F < 5.8e-45Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.2
Applied rewrites51.2%
Taylor expanded in F around 0
Applied rewrites51.2%
if 5.8e-45 < F Initial program 61.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in F around inf
Applied rewrites52.0%
Final simplification53.6%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-5)
(/ (- -1.0 x) B)
(if (<= F -3.5e-147)
(/ (* (sqrt (pow (fma F F 2.0) -1.0)) F) B)
(if (<= F 2.95e-83) (/ (- x) B) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= -3.5e-147) {
tmp = (sqrt(pow(fma(F, F, 2.0), -1.0)) * F) / B;
} else if (F <= 2.95e-83) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -3.5e-147) tmp = Float64(Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * F) / B); elseif (F <= 2.95e-83) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3.5e-147], N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.95e-83], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -3.5 \cdot 10^{-147}:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot F}{B}\\
\mathbf{elif}\;F \leq 2.95 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 57.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.4
Applied rewrites47.4%
Taylor expanded in F around -inf
Applied rewrites60.8%
if -6.9999999999999994e-5 < F < -3.50000000000000004e-147Initial 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.f6450.4
Applied rewrites50.4%
Taylor expanded in x around 0
Applied rewrites42.4%
if -3.50000000000000004e-147 < F < 2.9499999999999998e-83Initial 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.9
Applied rewrites49.9%
Taylor expanded in F around 0
Applied rewrites39.6%
if 2.9499999999999998e-83 < F Initial program 63.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.f6443.5
Applied rewrites43.5%
Taylor expanded in F around inf
Applied rewrites50.0%
Final simplification49.1%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-5)
(/ (- -1.0 x) B)
(if (<= F -3.5e-147)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F B))
(if (<= F 2.95e-83) (/ (- x) B) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-5) {
tmp = (-1.0 - x) / B;
} else if (F <= -3.5e-147) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / B);
} else if (F <= 2.95e-83) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -3.5e-147) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / B)); elseif (F <= 2.95e-83) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3.5e-147], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.95e-83], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -3.5 \cdot 10^{-147}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{B}\\
\mathbf{elif}\;F \leq 2.95 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.9999999999999994e-5Initial program 57.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.4
Applied rewrites47.4%
Taylor expanded in F around -inf
Applied rewrites60.8%
if -6.9999999999999994e-5 < F < -3.50000000000000004e-147Initial 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.f6450.4
Applied rewrites50.4%
Taylor expanded in x around 0
Applied rewrites42.2%
if -3.50000000000000004e-147 < F < 2.9499999999999998e-83Initial 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.9
Applied rewrites49.9%
Taylor expanded in F around 0
Applied rewrites39.6%
if 2.9499999999999998e-83 < F Initial program 63.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.f6443.5
Applied rewrites43.5%
Taylor expanded in F around inf
Applied rewrites50.0%
Final simplification49.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.85e+161)
(/ (- -1.0 x) B)
(if (<= F 5.8e-45)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.85e+161) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.8e-45) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.85e+161) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 5.8e-45) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.85e+161], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.8e-45], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.85 \cdot 10^{+161}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-45}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.8499999999999999e161Initial program 30.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.f6435.8
Applied rewrites35.8%
Taylor expanded in F around -inf
Applied rewrites62.4%
if -1.8499999999999999e161 < F < 5.8e-45Initial program 97.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6452.7
Applied rewrites52.7%
Applied rewrites52.7%
if 5.8e-45 < F Initial program 61.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6442.8
Applied rewrites42.8%
Taylor expanded in F around inf
Applied rewrites52.0%
(FPCore (F B x) :precision binary64 (if (<= F -2.7e-92) (/ (- -1.0 x) B) (if (<= F 2.95e-83) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-92) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.95e-83) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.7d-92)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.95d-83) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-92) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.95e-83) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.7e-92: tmp = (-1.0 - x) / B elif F <= 2.95e-83: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.7e-92) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.95e-83) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.7e-92) tmp = (-1.0 - x) / B; elseif (F <= 2.95e-83) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.7e-92], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.95e-83], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{-92}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.95 \cdot 10^{-83}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.69999999999999995e-92Initial program 67.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.f6445.8
Applied rewrites45.8%
Taylor expanded in F around -inf
Applied rewrites47.5%
if -2.69999999999999995e-92 < F < 2.9499999999999998e-83Initial 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.f6452.5
Applied rewrites52.5%
Taylor expanded in F around 0
Applied rewrites36.6%
if 2.9499999999999998e-83 < F Initial program 63.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.f6443.5
Applied rewrites43.5%
Taylor expanded in F around inf
Applied rewrites50.0%
(FPCore (F B x) :precision binary64 (if (<= F -2.7e-92) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-92) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.7d-92)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.7e-92) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.7e-92: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.7e-92) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.7e-92) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.7e-92], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.7 \cdot 10^{-92}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.69999999999999995e-92Initial program 67.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.f6445.8
Applied rewrites45.8%
Taylor expanded in F around -inf
Applied rewrites47.5%
if -2.69999999999999995e-92 < F Initial program 80.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6447.7
Applied rewrites47.7%
Taylor expanded in F around 0
Applied rewrites32.6%
(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 76.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.f6447.1
Applied rewrites47.1%
Taylor expanded in F around 0
Applied rewrites30.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 76.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.f6447.1
Applied rewrites47.1%
Taylor expanded in F around -inf
Applied rewrites31.3%
Taylor expanded in x around 0
Applied rewrites10.3%
herbie shell --seed 2024309
(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))))))