
(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.1e+70)
(- (/ -1.0 (sin B)) (* (/ 1.0 (tan B)) x))
(if (<= F 50000000.0)
(fma (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B)) F (/ (- x) (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e+70) {
tmp = (-1.0 / sin(B)) - ((1.0 / tan(B)) * x);
} else if (F <= 50000000.0) {
tmp = fma((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B)), F, (-x / tan(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.1e+70) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 50000000.0) tmp = fma(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.1e+70], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 50000000.0], N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.1 \cdot 10^{+70}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 50000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.1e70Initial program 52.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -1.1e70 < F < 5e7Initial 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.7%
if 5e7 < F Initial program 55.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 rewrites75.5%
Applied rewrites75.5%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -2.5e+38)
(- (/ -1.0 (sin B)) (* (/ 1.0 (tan B)) x))
(if (<= F 50000000.0)
(fma
(/ 1.0 (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B)))
F
(/ (- x) (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e+38) {
tmp = (-1.0 / sin(B)) - ((1.0 / tan(B)) * x);
} else if (F <= 50000000.0) {
tmp = fma((1.0 / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, (-x / tan(B)));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.5e+38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 50000000.0) tmp = fma(Float64(1.0 / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.5e+38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 50000000.0], N[(N[(1.0 / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 50000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.49999999999999985e38Initial program 56.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2.49999999999999985e38 < F < 5e7Initial 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-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites99.5%
if 5e7 < F Initial program 55.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 rewrites75.5%
Applied rewrites75.5%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -5e+32)
(- (/ -1.0 (sin B)) (* (/ 1.0 (tan B)) x))
(if (<= F 50000000.0)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) t_0) (sin B))
(/ (- 1.0 t_0) (sin B))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -5e+32) {
tmp = (-1.0 / sin(B)) - ((1.0 / tan(B)) * x);
} else if (F <= 50000000.0) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - t_0) / sin(B);
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -5e+32) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 50000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - t_0) / sin(B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -5e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 50000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -5 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 50000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -4.9999999999999997e32Initial program 57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -4.9999999999999997e32 < F < 5e7Initial 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%
Applied rewrites99.5%
if 5e7 < F Initial program 55.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 rewrites75.5%
Applied rewrites75.5%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ 1.0 (tan B)) x)))
(if (<= F -240000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.6)
(/ (- (/ F (sqrt (fma x 2.0 2.0))) (* (cos B) x)) (sin B))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (1.0 / tan(B)) * x;
double tmp;
if (F <= -240000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.6) {
tmp = ((F / sqrt(fma(x, 2.0, 2.0))) - (cos(B) * x)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(1.0 / tan(B)) * x) tmp = 0.0 if (F <= -240000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.6) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, 2.0))) - Float64(cos(B) * x)) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -240000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.6], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\tan B} \cdot x\\
\mathbf{if}\;F \leq -240000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.6:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - \cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.4e11Initial program 57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2.4e11 < F < 1.6000000000000001Initial 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%
Applied rewrites99.5%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.1
Applied rewrites97.1%
if 1.6000000000000001 < F Initial program 57.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.1
Applied rewrites99.1%
Final simplification98.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ 1.0 (tan B)) x)))
(if (<= F -240000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* (sqrt 0.5) (/ F (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (1.0 / tan(B)) * x;
double tmp;
if (F <= -240000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (sqrt(0.5) * (F / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (1.0d0 / tan(b)) * x
if (f <= (-240000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (sqrt(0.5d0) * (f / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (1.0 / Math.tan(B)) * x;
double tmp;
if (F <= -240000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (Math.sqrt(0.5) * (F / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (1.0 / math.tan(B)) * x tmp = 0 if F <= -240000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (math.sqrt(0.5) * (F / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(1.0 / tan(B)) * x) tmp = 0.0 if (F <= -240000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(sqrt(0.5) * Float64(F / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (1.0 / tan(B)) * x; tmp = 0.0; if (F <= -240000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (sqrt(0.5) * (F / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -240000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $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{1}{\tan B} \cdot x\\
\mathbf{if}\;F \leq -240000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.4e11Initial program 57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2.4e11 < F < 1.3999999999999999Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.5
Applied rewrites99.5%
Taylor expanded in F around 0
Applied rewrites97.1%
if 1.3999999999999999 < F Initial program 57.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.1
Applied rewrites99.1%
Final simplification98.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ 1.0 (tan B)) x)))
(if (<= F -2.5e+38)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7.5e-35)
(fma
(/ (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) B)
F
(/ (- x) (tan B)))
(if (<= F 380000.0)
(fma
(/ 1.0 (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B)))
F
(/ (- x) B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = (1.0 / tan(B)) * x;
double tmp;
if (F <= -2.5e+38) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7.5e-35) {
tmp = fma((sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) / B), F, (-x / tan(B)));
} else if (F <= 380000.0) {
tmp = fma((1.0 / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, (-x / B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(1.0 / tan(B)) * x) tmp = 0.0 if (F <= -2.5e+38) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7.5e-35) tmp = fma(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 380000.0) tmp = fma(Float64(1.0 / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, Float64(Float64(-x) / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.5e+38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.5e-35], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 380000.0], N[(N[(1.0 / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\tan B} \cdot x\\
\mathbf{if}\;F \leq -2.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 380000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}, F, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.49999999999999985e38Initial program 56.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2.49999999999999985e38 < F < 7.5e-35Initial 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.7%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.6
Applied rewrites91.6%
if 7.5e-35 < F < 3.8e5Initial program 99.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 rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6498.1
Applied rewrites98.1%
if 3.8e5 < F Initial program 56.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification96.3%
(FPCore (F B x)
:precision binary64
(if (<= F -2.5e+38)
(- (/ -1.0 (sin B)) (* (/ 1.0 (tan B)) x))
(if (<= F 7.5e-35)
(fma (/ (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) B) F (/ (- x) (tan B)))
(if (<= F 380000.0)
(fma (/ 1.0 (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B))) F (/ (- x) B))
(/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e+38) {
tmp = (-1.0 / sin(B)) - ((1.0 / tan(B)) * x);
} else if (F <= 7.5e-35) {
tmp = fma((sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) / B), F, (-x / tan(B)));
} else if (F <= 380000.0) {
tmp = fma((1.0 / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, (-x / B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.5e+38) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 7.5e-35) tmp = fma(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 380000.0) tmp = fma(Float64(1.0 / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, Float64(Float64(-x) / B)); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.5e+38], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-35], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 380000.0], N[(N[(1.0 / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 380000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}, F, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.49999999999999985e38Initial program 56.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -2.49999999999999985e38 < F < 7.5e-35Initial 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.7%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.6
Applied rewrites91.6%
if 7.5e-35 < F < 3.8e5Initial program 99.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 rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6498.1
Applied rewrites98.1%
if 3.8e5 < F Initial program 56.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 rewrites76.2%
Applied rewrites76.1%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification96.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (cos B) x)))
(if (<= F -2.5e+38)
(/ (- -1.0 t_0) (sin B))
(if (<= F 7.5e-35)
(fma
(/ (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0))) B)
F
(/ (- x) (tan B)))
(if (<= F 380000.0)
(fma
(/ 1.0 (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B)))
F
(/ (- x) B))
(/ (- 1.0 t_0) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = cos(B) * x;
double tmp;
if (F <= -2.5e+38) {
tmp = (-1.0 - t_0) / sin(B);
} else if (F <= 7.5e-35) {
tmp = fma((sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0))) / B), F, (-x / tan(B)));
} else if (F <= 380000.0) {
tmp = fma((1.0 / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, (-x / B));
} else {
tmp = (1.0 - t_0) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(cos(B) * x) tmp = 0.0 if (F <= -2.5e+38) tmp = Float64(Float64(-1.0 - t_0) / sin(B)); elseif (F <= 7.5e-35) tmp = fma(Float64(sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) / B), F, Float64(Float64(-x) / tan(B))); elseif (F <= 380000.0) tmp = fma(Float64(1.0 / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))), F, Float64(Float64(-x) / B)); else tmp = Float64(Float64(1.0 - t_0) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.5e+38], N[(N[(-1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-35], N[(N[(N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 380000.0], N[(N[(1.0 / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - t$95$0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \cos B \cdot x\\
\mathbf{if}\;F \leq -2.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{-1 - t\_0}{\sin B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}}{B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 380000:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B}, F, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - t\_0}{\sin B}\\
\end{array}
\end{array}
if F < -2.49999999999999985e38Initial 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 rewrites72.4%
Applied rewrites72.4%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -2.49999999999999985e38 < F < 7.5e-35Initial 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.7%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.6
Applied rewrites91.6%
if 7.5e-35 < F < 3.8e5Initial program 99.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 rewrites99.4%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites99.4%
Taylor expanded in B around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6498.1
Applied rewrites98.1%
if 3.8e5 < F Initial program 56.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 rewrites76.2%
Applied rewrites76.1%
Taylor expanded in F around inf
Applied rewrites99.7%
Final simplification96.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ (fma 2.0 x (* F F)) 2.0)) (t_1 (/ (- x) (tan B))))
(if (<= F -2.5e+38)
(/ (- -1.0 (* (cos B) x)) (sin B))
(if (<= F 7.5e-35)
(fma (/ (sqrt (/ 1.0 t_0)) B) F t_1)
(if (<= F 1.8e+98)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(if (<= F 4.8e+159)
(fma (/ 1.0 (* (sqrt t_0) B)) F t_1)
(-
(fma 0.16666666666666666 B (/ 1.0 B))
(* (/ 1.0 (tan B)) x))))))))
double code(double F, double B, double x) {
double t_0 = fma(2.0, x, (F * F)) + 2.0;
double t_1 = -x / tan(B);
double tmp;
if (F <= -2.5e+38) {
tmp = (-1.0 - (cos(B) * x)) / sin(B);
} else if (F <= 7.5e-35) {
tmp = fma((sqrt((1.0 / t_0)) / B), F, t_1);
} else if (F <= 1.8e+98) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else if (F <= 4.8e+159) {
tmp = fma((1.0 / (sqrt(t_0) * B)), F, t_1);
} else {
tmp = fma(0.16666666666666666, B, (1.0 / B)) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(fma(2.0, x, Float64(F * F)) + 2.0) t_1 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -2.5e+38) tmp = Float64(Float64(-1.0 - Float64(cos(B) * x)) / sin(B)); elseif (F <= 7.5e-35) tmp = fma(Float64(sqrt(Float64(1.0 / t_0)) / B), F, t_1); elseif (F <= 1.8e+98) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); elseif (F <= 4.8e+159) tmp = fma(Float64(1.0 / Float64(sqrt(t_0) * B)), F, t_1); else tmp = Float64(fma(0.16666666666666666, B, Float64(1.0 / B)) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, Block[{t$95$1 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.5e+38], N[(N[(-1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e-35], N[(N[(N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + t$95$1), $MachinePrecision], If[LessEqual[F, 1.8e+98], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.8e+159], N[(N[(1.0 / N[(N[Sqrt[t$95$0], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * F + t$95$1), $MachinePrecision], N[(N[(0.16666666666666666 * B + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(2, x, F \cdot F\right) + 2\\
t_1 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -2.5 \cdot 10^{+38}:\\
\;\;\;\;\frac{-1 - \cos B \cdot x}{\sin B}\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{-35}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{t\_0}}}{B}, F, t\_1\right)\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+98}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{t\_0} \cdot B}, F, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, B, \frac{1}{B}\right) - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if F < -2.49999999999999985e38Initial 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 rewrites72.4%
Applied rewrites72.4%
Taylor expanded in F around -inf
Applied rewrites99.7%
if -2.49999999999999985e38 < F < 7.5e-35Initial 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.7%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6491.6
Applied rewrites91.6%
if 7.5e-35 < F < 1.7999999999999999e98Initial program 94.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 rewrites99.5%
Applied rewrites99.5%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/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.f6490.3
Applied rewrites90.3%
if 1.7999999999999999e98 < F < 4.8e159Initial program 71.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 rewrites94.1%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites94.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6492.9
Applied rewrites92.9%
if 4.8e159 < F Initial program 34.4%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites30.6%
Taylor expanded in F around inf
Applied rewrites68.5%
Taylor expanded in F around inf
Applied rewrites71.4%
Final simplification90.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))) (t_1 (+ (fma 2.0 x (* F F)) 2.0)))
(if (<= x -4.4e-80)
(fma (/ 1.0 (* (sqrt t_1) B)) F t_0)
(if (<= x 1.25e-130)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(fma (/ (sqrt (/ 1.0 t_1)) B) F t_0)))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double t_1 = fma(2.0, x, (F * F)) + 2.0;
double tmp;
if (x <= -4.4e-80) {
tmp = fma((1.0 / (sqrt(t_1) * B)), F, t_0);
} else if (x <= 1.25e-130) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = fma((sqrt((1.0 / t_1)) / B), F, t_0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) t_1 = Float64(fma(2.0, x, Float64(F * F)) + 2.0) tmp = 0.0 if (x <= -4.4e-80) tmp = fma(Float64(1.0 / Float64(sqrt(t_1) * B)), F, t_0); elseif (x <= 1.25e-130) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); else tmp = fma(Float64(sqrt(Float64(1.0 / t_1)) / B), F, t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]}, If[LessEqual[x, -4.4e-80], N[(N[(1.0 / N[(N[Sqrt[t$95$1], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], If[LessEqual[x, 1.25e-130], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[Sqrt[N[(1.0 / t$95$1), $MachinePrecision]], $MachinePrecision] / B), $MachinePrecision] * F + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
t_1 := \mathsf{fma}\left(2, x, F \cdot F\right) + 2\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-80}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{t\_1} \cdot B}, F, t\_0\right)\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-130}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{t\_1}}}{B}, F, t\_0\right)\\
\end{array}
\end{array}
if x < -4.4000000000000002e-80Initial program 81.3%
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.8%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites90.9%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6488.9
Applied rewrites88.9%
if -4.4000000000000002e-80 < x < 1.2499999999999999e-130Initial program 74.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 rewrites79.2%
Applied rewrites79.1%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/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.f6474.7
Applied rewrites74.7%
if 1.2499999999999999e-130 < x Initial program 77.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.7%
Taylor expanded in B around 0
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6490.7
Applied rewrites90.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(fma
(/ 1.0 (* (sqrt (+ (fma 2.0 x (* F F)) 2.0)) B))
F
(/ (- x) (tan B)))))
(if (<= x -4.4e-80)
t_0
(if (<= x 1.25e-130)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
t_0))))
double code(double F, double B, double x) {
double t_0 = fma((1.0 / (sqrt((fma(2.0, x, (F * F)) + 2.0)) * B)), F, (-x / tan(B)));
double tmp;
if (x <= -4.4e-80) {
tmp = t_0;
} else if (x <= 1.25e-130) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = fma(Float64(1.0 / Float64(sqrt(Float64(fma(2.0, x, Float64(F * F)) + 2.0)) * B)), F, Float64(Float64(-x) / tan(B))) tmp = 0.0 if (x <= -4.4e-80) tmp = t_0; elseif (x <= 1.25e-130) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[(N[Sqrt[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e-80], t$95$0, If[LessEqual[x, 1.25e-130], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(2, x, F \cdot F\right) + 2} \cdot B}, F, \frac{-x}{\tan B}\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-80}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-130}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -4.4000000000000002e-80 or 1.2499999999999999e-130 < x Initial program 78.6%
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.7%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites90.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6490.2
Applied rewrites90.2%
if -4.4000000000000002e-80 < x < 1.2499999999999999e-130Initial program 74.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 rewrites79.2%
Applied rewrites79.1%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/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.f6474.7
Applied rewrites74.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ 1.0 (tan B)) x)))
(if (<= F -2.7e+123)
(- (/ (fma -0.16666666666666666 (* B B) -1.0) B) t_0)
(if (<= F 9.5e+155)
(/ (fma (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) F (- x)) (sin B))
(- (fma 0.16666666666666666 B (/ 1.0 B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (1.0 / tan(B)) * x;
double tmp;
if (F <= -2.7e+123) {
tmp = (fma(-0.16666666666666666, (B * B), -1.0) / B) - t_0;
} else if (F <= 9.5e+155) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, -x) / sin(B);
} else {
tmp = fma(0.16666666666666666, B, (1.0 / B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(1.0 / tan(B)) * x) tmp = 0.0 if (F <= -2.7e+123) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B) - t_0); elseif (F <= 9.5e+155) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), F, Float64(-x)) / sin(B)); else tmp = Float64(fma(0.16666666666666666, B, Float64(1.0 / B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -2.7e+123], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9.5e+155], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(0.16666666666666666 * B + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\tan B} \cdot x\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+123}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B} - t\_0\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{+155}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, F, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, B, \frac{1}{B}\right) - t\_0\\
\end{array}
\end{array}
if F < -2.70000000000000013e123Initial program 43.5%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites34.9%
Taylor expanded in F around -inf
Applied rewrites61.0%
if -2.70000000000000013e123 < F < 9.5000000000000006e155Initial program 94.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.1%
Applied rewrites99.0%
Taylor expanded in B around 0
sub-negN/A
*-commutativeN/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.f6471.8
Applied rewrites71.8%
if 9.5000000000000006e155 < F Initial program 37.8%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites29.0%
Taylor expanded in F around inf
Applied rewrites67.6%
Taylor expanded in F around inf
Applied rewrites70.3%
Final simplification69.7%
(FPCore (F B x)
:precision binary64
(if (<= B 0.0024)
(/
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* B B) (* 0.16666666666666666 F) F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(if (<= B 4.8e+160)
(- (fma 0.16666666666666666 B (/ 1.0 B)) (* (/ 1.0 (tan B)) x))
(* (sqrt (/ 1.0 (fma F F 2.0))) (/ F (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0024) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma((B * B), (0.16666666666666666 * F), F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else if (B <= 4.8e+160) {
tmp = fma(0.16666666666666666, B, (1.0 / B)) - ((1.0 / tan(B)) * x);
} else {
tmp = sqrt((1.0 / fma(F, F, 2.0))) * (F / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.0024) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(Float64(B * B), Float64(0.16666666666666666 * F), F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); elseif (B <= 4.8e+160) tmp = Float64(fma(0.16666666666666666, B, Float64(1.0 / B)) - Float64(Float64(1.0 / tan(B)) * x)); else tmp = Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) * Float64(F / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.0024], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 4.8e+160], N[(N[(0.16666666666666666 * B + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0024:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{elif}\;B \leq 4.8 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, B, \frac{1}{B}\right) - \frac{1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}} \cdot \frac{F}{\sin B}\\
\end{array}
\end{array}
if B < 0.00239999999999999979Initial program 74.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites61.1%
if 0.00239999999999999979 < B < 4.8000000000000003e160Initial program 88.3%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites28.8%
Taylor expanded in F around inf
Applied rewrites29.6%
Taylor expanded in F around inf
Applied rewrites46.6%
if 4.8000000000000003e160 < B Initial program 79.4%
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.f6427.1
Applied rewrites27.1%
Final simplification54.7%
(FPCore (F B x)
:precision binary64
(if (<= B 0.0024)
(/
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* B B) (* 0.16666666666666666 F) F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(- (fma 0.16666666666666666 B (/ 1.0 B)) (* (/ 1.0 (tan B)) x))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0024) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma((B * B), (0.16666666666666666 * F), F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else {
tmp = fma(0.16666666666666666, B, (1.0 / B)) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.0024) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(Float64(B * B), Float64(0.16666666666666666 * F), F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); else tmp = Float64(fma(0.16666666666666666, B, Float64(1.0 / B)) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.0024], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(0.16666666666666666 * B + N[(1.0 / B), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0024:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.16666666666666666, B, \frac{1}{B}\right) - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if B < 0.00239999999999999979Initial program 74.6%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites61.1%
if 0.00239999999999999979 < B Initial program 84.3%
Taylor expanded in B around 0
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
+-commutativeN/A
lower-/.f64N/A
Applied rewrites16.6%
Taylor expanded in F around inf
Applied rewrites16.8%
Taylor expanded in F around inf
Applied rewrites28.3%
Final simplification52.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ (fma 2.0 x (* F F)) 2.0)))))
(if (<= F -28000000000000.0)
(/ (- -1.0 x) B)
(if (<= F 8.2e+157)
(/
(fma
t_0
F
(fma
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B)
(- x)))
B)
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (fma(2.0, x, (F * F)) + 2.0)));
double tmp;
if (F <= -28000000000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.2e+157) {
tmp = fma(t_0, F, fma(fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)), (B * B), -x)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(fma(2.0, x, Float64(F * F)) + 2.0))) tmp = 0.0 if (F <= -28000000000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.2e+157) tmp = Float64(fma(t_0, F, fma(fma(Float64(0.16666666666666666 * F), t_0, Float64(0.3333333333333333 * x)), Float64(B * B), Float64(-x))) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -28000000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.2e+157], N[(N[(t$95$0 * F + N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * t$95$0 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}}\\
\mathbf{if}\;F \leq -28000000000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{+157}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_0, F, \mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, t\_0, 0.3333333333333333 \cdot x\right), B \cdot B, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.8e13Initial program 57.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.f6434.5
Applied rewrites34.5%
Taylor expanded in F around -inf
Applied rewrites47.4%
if -2.8e13 < F < 8.20000000000000032e157Initial program 95.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 rewrites99.0%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites54.1%
if 8.20000000000000032e157 < F Initial program 36.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.f6428.9
Applied rewrites28.9%
Taylor expanded in F around inf
Applied rewrites54.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.8e+24)
(/ (- -1.0 x) B)
(if (<= F 8.2e+157)
(fma
(/ 1.0 (* (sqrt (fma x 2.0 (fma F F 2.0))) B))
F
(/ (- (* (* (* B B) x) 0.3333333333333333) x) B))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e+24) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.2e+157) {
tmp = fma((1.0 / (sqrt(fma(x, 2.0, fma(F, F, 2.0))) * B)), F, (((((B * B) * x) * 0.3333333333333333) - x) / B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.8e+24) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.2e+157) tmp = fma(Float64(1.0 / Float64(sqrt(fma(x, 2.0, fma(F, F, 2.0))) * B)), F, Float64(Float64(Float64(Float64(Float64(B * B) * x) * 0.3333333333333333) - x) / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.8e+24], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.2e+157], N[(N[(1.0 / N[(N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] * F + N[(N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{+24}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(\frac{1}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot B}, F, \frac{\left(\left(B \cdot B\right) \cdot x\right) \cdot 0.3333333333333333 - x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.79999999999999992e24Initial program 57.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.f6434.5
Applied rewrites34.5%
Taylor expanded in F around -inf
Applied rewrites47.4%
if -1.79999999999999992e24 < F < 8.20000000000000032e157Initial program 95.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 rewrites99.0%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-pow.f64N/A
metadata-evalN/A
sqrt-pow1N/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
inv-powN/A
lift-/.f64N/A
lift-sqrt.f64N/A
div-invN/A
metadata-evalN/A
lift-sqrt.f64N/A
Applied rewrites98.9%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6458.3
Applied rewrites58.3%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6453.9
Applied rewrites53.9%
if 8.20000000000000032e157 < F Initial program 36.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.f6428.9
Applied rewrites28.9%
Taylor expanded in F around inf
Applied rewrites54.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+76)
(/ (- -1.0 x) B)
(if (<= F 8200.0)
(/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+76) {
tmp = (-1.0 - x) / B;
} else if (F <= 8200.0) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+76) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8200.0) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+76], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8200.0], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+76}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8200:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1e76Initial program 52.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.f6433.2
Applied rewrites33.2%
Taylor expanded in F around -inf
Applied rewrites47.8%
if -1e76 < F < 8200Initial 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.f6454.9
Applied rewrites54.9%
if 8200 < F Initial program 57.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6437.6
Applied rewrites37.6%
Taylor expanded in F around inf
Applied rewrites51.1%
(FPCore (F B x)
:precision binary64
(if (<= F -8.2e+154)
(/ (- -1.0 x) B)
(if (<= F 8200.0)
(/ (- (/ 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 <= -8.2e+154) {
tmp = (-1.0 - x) / B;
} else if (F <= 8200.0) {
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 <= -8.2e+154) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8200.0) 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, -8.2e+154], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8200.0], 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 -8.2 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8200:\\
\;\;\;\;\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 < -8.2e154Initial program 36.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6426.2
Applied rewrites26.2%
Taylor expanded in F around -inf
Applied rewrites47.1%
if -8.2e154 < F < 8200Initial program 98.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6454.2
Applied rewrites54.2%
Applied rewrites54.2%
if 8200 < F Initial program 57.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6437.6
Applied rewrites37.6%
Taylor expanded in F around inf
Applied rewrites51.1%
(FPCore (F B x)
:precision binary64
(if (<= F -240000000000.0)
(/ (- -1.0 x) B)
(if (<= F 1.85e+28)
(/ (fma (sqrt (/ 1.0 (fma 2.0 x 2.0))) F (- x)) B)
(/ (- (- 1.0 (/ 1.0 (* F F))) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -240000000000.0) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.85e+28) {
tmp = fma(sqrt((1.0 / fma(2.0, x, 2.0))), F, -x) / B;
} else {
tmp = ((1.0 - (1.0 / (F * F))) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -240000000000.0) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.85e+28) tmp = Float64(fma(sqrt(Float64(1.0 / fma(2.0, x, 2.0))), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(1.0 - Float64(1.0 / Float64(F * F))) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -240000000000.0], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.85e+28], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[(1.0 / N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -240000000000:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.85 \cdot 10^{+28}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - \frac{1}{F \cdot F}\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.4e11Initial program 57.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.f6434.5
Applied rewrites34.5%
Taylor expanded in F around -inf
Applied rewrites47.4%
if -2.4e11 < F < 1.85e28Initial 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.f6453.9
Applied rewrites53.9%
Taylor expanded in F around 0
Applied rewrites52.3%
if 1.85e28 < F Initial program 54.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.5
Applied rewrites39.5%
Taylor expanded in F around inf
Applied rewrites53.8%
Taylor expanded in x around 0
Applied rewrites53.8%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e+54) (/ (- -1.0 x) B) (if (<= F 1.12e-21) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e+54) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.12e-21) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.1d+54)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.12d-21) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e+54) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.12e-21) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e+54: tmp = (-1.0 - x) / B elif F <= 1.12e-21: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e+54) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.12e-21) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.1e+54) tmp = (-1.0 - x) / B; elseif (F <= 1.12e-21) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e+54], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.12e-21], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{+54}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.12 \cdot 10^{-21}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.09999999999999986e54Initial program 53.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.f6435.6
Applied rewrites35.6%
Taylor expanded in F around -inf
Applied rewrites49.6%
if -2.09999999999999986e54 < F < 1.11999999999999998e-21Initial 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.f6454.5
Applied rewrites54.5%
Taylor expanded in F around 0
Applied rewrites41.1%
if 1.11999999999999998e-21 < F Initial program 64.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.f6440.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites45.4%
(FPCore (F B x) :precision binary64 (if (<= F -2.1e+54) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e+54) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.1d+54)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.1e+54) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.1e+54: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.1e+54) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.1e+54) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.1e+54], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.1 \cdot 10^{+54}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -2.09999999999999986e54Initial program 53.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.f6435.6
Applied rewrites35.6%
Taylor expanded in F around -inf
Applied rewrites49.6%
if -2.09999999999999986e54 < F Initial program 84.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.1
Applied rewrites48.1%
Taylor expanded in F around 0
Applied rewrites33.4%
(FPCore (F B x) :precision binary64 (if (<= F -3.2e+54) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e+54) {
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 <= (-3.2d+54)) 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 <= -3.2e+54) {
tmp = -1.0 / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.2e+54: tmp = -1.0 / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.2e+54) 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 <= -3.2e+54) tmp = -1.0 / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.2e+54], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -3.2e54Initial program 53.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.f6435.6
Applied rewrites35.6%
Taylor expanded in F around -inf
Applied rewrites49.6%
Taylor expanded in x around 0
Applied rewrites30.5%
if -3.2e54 < F Initial program 84.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6448.1
Applied rewrites48.1%
Taylor expanded in F around 0
Applied rewrites33.4%
(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 77.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.f6445.3
Applied rewrites45.3%
Taylor expanded in F around -inf
Applied rewrites28.6%
Taylor expanded in x around 0
Applied rewrites9.7%
herbie shell --seed 2024248
(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))))))