
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))) (t_2 (/ -1.0 (sin B))))
(if (<= F -1e+154)
(+ (* x (* (cos B) t_2)) t_2)
(if (<= F 100000000.0)
(fma (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) t_0 (- t_1))
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double t_2 = -1.0 / sin(B);
double tmp;
if (F <= -1e+154) {
tmp = (x * (cos(B) * t_2)) + t_2;
} else if (F <= 100000000.0) {
tmp = fma((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))), t_0, -t_1);
} else {
tmp = t_0 - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) t_2 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -1e+154) tmp = Float64(Float64(x * Float64(cos(B) * t_2)) + t_2); elseif (F <= 100000000.0) tmp = fma(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))), t_0, Float64(-t_1)); else tmp = Float64(t_0 - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+154], N[(N[(x * N[(N[Cos[B], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0 + (-t$95$1)), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
t_2 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+154}:\\
\;\;\;\;x \cdot \left(\cos B \cdot t\_2\right) + t\_2\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}, t\_0, -t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -1.00000000000000004e154Initial program 35.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
tan-quotN/A
lift-sin.f64N/A
associate-/r/N/A
lift-/.f64N/A
lower-*.f64N/A
lower-cos.f6499.7
Applied rewrites99.7%
if -1.00000000000000004e154 < F < 1e8Initial program 97.5%
Applied rewrites99.6%
Applied rewrites99.7%
if 1e8 < F Initial program 61.9%
Applied rewrites76.8%
Applied rewrites77.0%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -1e+154)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 100000000.0)
(fma (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) t_0 (- t_1))
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -1e+154) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 100000000.0) {
tmp = fma((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))), t_0, -t_1);
} else {
tmp = t_0 - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+154) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 100000000.0) tmp = fma(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))), t_0, Float64(-t_1)); else tmp = Float64(t_0 - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+154], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0 + (-t$95$1)), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+154}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}, t\_0, -t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -1.00000000000000004e154Initial program 35.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
lift-tan.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
unsub-negN/A
lower--.f6499.6
Applied rewrites99.6%
if -1.00000000000000004e154 < F < 1e8Initial program 97.5%
Applied rewrites99.6%
Applied rewrites99.7%
if 1e8 < F Initial program 61.9%
Applied rewrites76.8%
Applied rewrites77.0%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8e+153)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 200000000.0)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8e+153) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 200000000.0) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8e+153) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 200000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+153], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 200000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+153}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 200000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -8e153Initial program 35.3%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
lift-tan.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
unsub-negN/A
lower--.f6499.6
Applied rewrites99.6%
if -8e153 < F < 2e8Initial program 97.5%
Applied rewrites99.6%
Applied rewrites99.7%
if 2e8 < F Initial program 61.9%
Applied rewrites76.8%
Applied rewrites77.0%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites76.9%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Applied rewrites99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.6)
(- (/ F (* (sin B) (sqrt (fma x 2.0 2.0)))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.6) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, 2.0)))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.6) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, 2.0)))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.6], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.6:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 53.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6498.9
Applied rewrites98.9%
lift-tan.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
unsub-negN/A
lower--.f6498.9
Applied rewrites98.9%
if -1.4199999999999999 < F < 1.6000000000000001Initial program 99.5%
Applied rewrites99.6%
Applied rewrites99.6%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites99.6%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.9
Applied rewrites98.9%
if 1.6000000000000001 < F Initial program 62.4%
Applied rewrites77.1%
Applied rewrites77.2%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites77.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.5
Applied rewrites99.5%
Final simplification99.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -2.9e-34)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.4e-79)
(fma (/ F (sqrt (fma F F 2.0))) t_0 (- (/ x B)))
(if (<= F 1.82e-63)
(-
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B))
(* x (/ 1.0 (tan B))))
(- t_0 t_1))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -2.9e-34) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.4e-79) {
tmp = fma((F / sqrt(fma(F, F, 2.0))), t_0, -(x / B));
} else if (F <= 1.82e-63) {
tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x * (1.0 / tan(B)));
} else {
tmp = t_0 - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.9e-34) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.4e-79) tmp = fma(Float64(F / sqrt(fma(F, F, 2.0))), t_0, Float64(-Float64(x / B))); elseif (F <= 1.82e-63) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(t_0 - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.9e-34], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.4e-79], N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0 + (-N[(x / B), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.82e-63], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{-34}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -3.4 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}, t\_0, -\frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 1.82 \cdot 10^{-63}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -2.9000000000000002e-34Initial program 58.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6497.8
Applied rewrites97.8%
lift-tan.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
unsub-negN/A
lower--.f6497.8
Applied rewrites97.8%
if -2.9000000000000002e-34 < F < -3.39999999999999976e-79Initial program 99.0%
Applied rewrites99.3%
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f6489.6
Applied rewrites89.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6489.6
Applied rewrites89.6%
if -3.39999999999999976e-79 < F < 1.81999999999999994e-63Initial program 99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6484.9
Applied rewrites84.9%
if 1.81999999999999994e-63 < F Initial program 65.0%
Applied rewrites78.7%
Applied rewrites78.8%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-/.f64N/A
lift-sin.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-tan.f64N/A
lift-/.f64N/A
unsub-negN/A
lower--.f64N/A
Applied rewrites78.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6495.3
Applied rewrites95.3%
Final simplification92.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))))
(if (<= F -2.9e-34)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -3.4e-79)
(fma (/ F (sqrt (fma F F 2.0))) t_0 (- (/ x B)))
(if (<= F 102000000000.0)
(-
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B))
(* x (/ 1.0 (tan B))))
(- t_0 (/ x B)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double tmp;
if (F <= -2.9e-34) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -3.4e-79) {
tmp = fma((F / sqrt(fma(F, F, 2.0))), t_0, -(x / B));
} else if (F <= 102000000000.0) {
tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x * (1.0 / tan(B)));
} else {
tmp = t_0 - (x / B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -2.9e-34) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -3.4e-79) tmp = fma(Float64(F / sqrt(fma(F, F, 2.0))), t_0, Float64(-Float64(x / B))); elseif (F <= 102000000000.0) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(t_0 - Float64(x / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.9e-34], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.4e-79], N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * t$95$0 + (-N[(x / B), $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 102000000000.0], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -2.9 \cdot 10^{-34}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -3.4 \cdot 10^{-79}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}, t\_0, -\frac{x}{B}\right)\\
\mathbf{elif}\;F \leq 102000000000:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 - \frac{x}{B}\\
\end{array}
\end{array}
if F < -2.9000000000000002e-34Initial program 58.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6497.8
Applied rewrites97.8%
lift-tan.f64N/A
clear-numN/A
clear-numN/A
lift-/.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
lift-sin.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
unsub-negN/A
lower--.f6497.8
Applied rewrites97.8%
if -2.9000000000000002e-34 < F < -3.39999999999999976e-79Initial program 99.0%
Applied rewrites99.3%
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f6489.6
Applied rewrites89.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6489.6
Applied rewrites89.6%
if -3.39999999999999976e-79 < F < 1.02e11Initial program 99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6482.2
Applied rewrites82.2%
if 1.02e11 < F Initial program 60.9%
Applied rewrites76.2%
Applied rewrites76.4%
Taylor expanded in B around 0
lower-/.f6454.9
Applied rewrites54.9%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f6478.5
Applied rewrites78.5%
Final simplification86.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -5.8e-85)
t_0
(if (<= x 1.8e-77)
(fma (/ F (sqrt (fma F F 2.0))) (/ 1.0 (sin B)) (- (/ x B)))
t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -5.8e-85) {
tmp = t_0;
} else if (x <= 1.8e-77) {
tmp = fma((F / sqrt(fma(F, F, 2.0))), (1.0 / sin(B)), -(x / B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (x <= -5.8e-85) tmp = t_0; elseif (x <= 1.8e-77) tmp = fma(Float64(F / sqrt(fma(F, F, 2.0))), Float64(1.0 / sin(B)), Float64(-Float64(x / B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -5.8e-85], t$95$0, If[LessEqual[x, 1.8e-77], N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] + (-N[(x / B), $MachinePrecision])), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{-85}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-77}:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}, \frac{1}{\sin B}, -\frac{x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5.8000000000000004e-85 or 1.8e-77 < x Initial program 81.5%
Taylor expanded in x around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-neg.f64N/A
lower-sin.f6488.3
Applied rewrites88.3%
lift-cos.f64N/A
lift-sin.f64N/A
lift-neg.f64N/A
associate-/l*N/A
remove-double-negN/A
lift-neg.f64N/A
clear-numN/A
lift-neg.f64N/A
distribute-neg-fracN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
div-invN/A
frac-2negN/A
lift-/.f6488.4
Applied rewrites88.4%
if -5.8000000000000004e-85 < x < 1.8e-77Initial program 69.7%
Applied rewrites71.7%
Applied rewrites71.8%
Taylor expanded in B around 0
lower-/.f6463.1
Applied rewrites63.1%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6463.1
Applied rewrites63.1%
Final simplification76.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -5.8e-85)
t_0
(if (<= x 1.8e-77)
(- (/ F (* (sin B) (sqrt (fma F F (fma 2.0 x 2.0))))) (/ x B))
t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -5.8e-85) {
tmp = t_0;
} else if (x <= 1.8e-77) {
tmp = (F / (sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (x <= -5.8e-85) tmp = t_0; elseif (x <= 1.8e-77) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(F, F, fma(2.0, x, 2.0))))) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -5.8e-85], t$95$0, If[LessEqual[x, 1.8e-77], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{-85}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -5.8000000000000004e-85 or 1.8e-77 < x Initial program 81.5%
Taylor expanded in x around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-neg.f64N/A
lower-sin.f6488.3
Applied rewrites88.3%
lift-cos.f64N/A
lift-sin.f64N/A
lift-neg.f64N/A
associate-/l*N/A
remove-double-negN/A
lift-neg.f64N/A
clear-numN/A
lift-neg.f64N/A
distribute-neg-fracN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
div-invN/A
frac-2negN/A
lift-/.f6488.4
Applied rewrites88.4%
if -5.8000000000000004e-85 < x < 1.8e-77Initial program 69.7%
Applied rewrites71.7%
Applied rewrites71.8%
Taylor expanded in B around 0
lower-/.f6463.1
Applied rewrites63.1%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
lift-sin.f64N/A
clear-numN/A
frac-timesN/A
*-rgt-identityN/A
/-rgt-identityN/A
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-negN/A
lower--.f6463.1
Applied rewrites63.1%
Final simplification76.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -3.7e-86)
t_0
(if (<= x 7.6e-134)
(* (/ F (sin B)) (sqrt (/ 1.0 (fma F F 2.0))))
(if (<= x 1.5e-97) (/ -1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -3.7e-86) {
tmp = t_0;
} else if (x <= 7.6e-134) {
tmp = (F / sin(B)) * sqrt((1.0 / fma(F, F, 2.0)));
} else if (x <= 1.5e-97) {
tmp = -1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (x <= -3.7e-86) tmp = t_0; elseif (x <= 7.6e-134) tmp = Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / fma(F, F, 2.0)))); elseif (x <= 1.5e-97) tmp = Float64(-1.0 / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -3.7e-86], t$95$0, If[LessEqual[x, 7.6e-134], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.5e-97], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{-86}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-134}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-97}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.6999999999999998e-86 or 1.50000000000000012e-97 < x Initial program 79.9%
Taylor expanded in x around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-neg.f64N/A
lower-sin.f6484.8
Applied rewrites84.8%
lift-cos.f64N/A
lift-sin.f64N/A
lift-neg.f64N/A
associate-/l*N/A
remove-double-negN/A
lift-neg.f64N/A
clear-numN/A
lift-neg.f64N/A
distribute-neg-fracN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
div-invN/A
frac-2negN/A
lift-/.f6484.9
Applied rewrites84.9%
if -3.6999999999999998e-86 < x < 7.60000000000000006e-134Initial program 75.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6462.0
Applied rewrites62.0%
if 7.60000000000000006e-134 < x < 1.50000000000000012e-97Initial program 34.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6467.2
Applied rewrites67.2%
Taylor expanded in x around 0
lower-/.f64N/A
lower-sin.f6467.2
Applied rewrites67.2%
Final simplification75.3%
(FPCore (F B x) :precision binary64 (if (<= B 1.3e-12) (/ (- (/ 1.0 (/ (sqrt (fma 2.0 x (fma F F 2.0))) F)) x) B) (- (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 1.3e-12) {
tmp = ((1.0 / (sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)) - x) / B;
} else {
tmp = -(x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 1.3e-12) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)) - x) / B); else tmp = Float64(-Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 1.3e-12], N[(N[(N[(1.0 / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 1.3 \cdot 10^{-12}:\\
\;\;\;\;\frac{\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 1.29999999999999991e-12Initial program 73.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6453.0
Applied rewrites53.0%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6453.0
Applied rewrites53.1%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6453.1
Applied rewrites53.1%
if 1.29999999999999991e-12 < B Initial program 83.2%
Taylor expanded in x around inf
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-neg.f64N/A
lower-sin.f6457.0
Applied rewrites57.0%
lift-cos.f64N/A
lift-sin.f64N/A
lift-neg.f64N/A
associate-/l*N/A
remove-double-negN/A
lift-neg.f64N/A
clear-numN/A
lift-neg.f64N/A
distribute-neg-fracN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
div-invN/A
frac-2negN/A
lift-/.f6457.2
Applied rewrites57.2%
Final simplification54.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45e+181)
(/ -1.0 (sin B))
(if (<= F 1.1e-13)
(/ (- (/ 1.0 (/ (sqrt (fma 2.0 x (fma F F 2.0))) F)) x) B)
(/ (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) (- 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e+181) {
tmp = -1.0 / sin(B);
} else if (F <= 1.1e-13) {
tmp = ((1.0 / (sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)) - x) / B;
} else {
tmp = fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.45e+181) tmp = Float64(-1.0 / sin(B)); elseif (F <= 1.1e-13) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)) - x) / B); else tmp = Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.45e+181], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.1e-13], N[(N[(N[(1.0 / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45 \cdot 10^{+181}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.45e181Initial program 31.9%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
lower-/.f64N/A
lower-sin.f6458.2
Applied rewrites58.2%
if -1.45e181 < F < 1.09999999999999998e-13Initial program 94.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6446.7
Applied rewrites46.7%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6446.7
Applied rewrites46.8%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6446.8
Applied rewrites46.8%
if 1.09999999999999998e-13 < F Initial program 63.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6438.5
Applied rewrites38.5%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/A
associate-+l+N/A
sub-negN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f6452.0
Applied rewrites52.0%
(FPCore (F B x)
:precision binary64
(if (<= F -3.3e+101)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 1.1e-13)
(/ (- (/ 1.0 (/ (sqrt (fma 2.0 x (fma F F 2.0))) F)) x) B)
(/ (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) (- 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e+101) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 1.1e-13) {
tmp = ((1.0 / (sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)) - x) / B;
} else {
tmp = fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.3e+101) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 1.1e-13) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F)) - x) / B); else tmp = Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.3e+101], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.1e-13], N[(N[(N[(1.0 / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.3 \cdot 10^{+101}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -3.30000000000000011e101Initial program 42.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6445.4
Applied rewrites45.4%
if -3.30000000000000011e101 < F < 1.09999999999999998e-13Initial program 98.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6446.4
Applied rewrites46.4%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6446.4
Applied rewrites46.6%
lift-fma.f64N/A
lift-fma.f64N/A
lift-sqrt.f64N/A
clear-numN/A
lower-/.f64N/A
lower-/.f6446.6
Applied rewrites46.6%
if 1.09999999999999998e-13 < F Initial program 63.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6438.5
Applied rewrites38.5%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/A
associate-+l+N/A
sub-negN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f6452.0
Applied rewrites52.0%
(FPCore (F B x)
:precision binary64
(if (<= F -3.3e+101)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 1.1e-13)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/ (fma -0.5 (/ (fma 2.0 x 2.0) (* F F)) (- 1.0 x)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e+101) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 1.1e-13) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = fma(-0.5, (fma(2.0, x, 2.0) / (F * F)), (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3.3e+101) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 1.1e-13) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(fma(-0.5, Float64(fma(2.0, x, 2.0) / Float64(F * F)), Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3.3e+101], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.1e-13], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(-0.5 * N[(N[(2.0 * x + 2.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.3 \cdot 10^{+101}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-13}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.5, \frac{\mathsf{fma}\left(2, x, 2\right)}{F \cdot F}, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -3.30000000000000011e101Initial program 42.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6445.4
Applied rewrites45.4%
if -3.30000000000000011e101 < F < 1.09999999999999998e-13Initial program 98.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6446.4
Applied rewrites46.4%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6446.4
Applied rewrites46.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6446.6
Applied rewrites46.6%
if 1.09999999999999998e-13 < F Initial program 63.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6438.5
Applied rewrites38.5%
Taylor expanded in F around inf
sub-negN/A
+-commutativeN/A
associate-+l+N/A
sub-negN/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower--.f6452.0
Applied rewrites52.0%
(FPCore (F B x)
:precision binary64
(if (<= F -3.3e+101)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 400000.0)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e+101) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 400000.0) {
tmp = ((F / sqrt(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 <= -3.3e+101) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 400000.0) tmp = Float64(Float64(Float64(F / sqrt(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, -3.3e+101], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 400000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $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 -3.3 \cdot 10^{+101}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 400000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.30000000000000011e101Initial program 42.7%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6445.4
Applied rewrites45.4%
if -3.30000000000000011e101 < F < 4e5Initial program 98.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6445.8
Applied rewrites45.8%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6445.8
Applied rewrites46.0%
Taylor expanded in x around 0
lower-sqrt.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6446.0
Applied rewrites46.0%
if 4e5 < F Initial program 61.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6439.1
Applied rewrites39.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6453.2
Applied rewrites53.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e-22)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 1.65e-63) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e-22) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 1.65e-63) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e-22) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 1.65e-63) tmp = Float64(-Float64(x / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e-22], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.65e-63], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{-22}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-63}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.94999999999999999e-22Initial program 57.6%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6497.8
Applied rewrites97.8%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6444.6
Applied rewrites44.6%
if -1.94999999999999999e-22 < F < 1.64999999999999997e-63Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6448.1
Applied rewrites48.1%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6430.5
Applied rewrites30.5%
if 1.64999999999999997e-63 < F Initial program 65.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6437.3
Applied rewrites37.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Final simplification41.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.25e-175) (/ (- -1.0 x) B) (if (<= F 1.65e-63) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-175) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.65e-63) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.25d-175)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.65d-63) then
tmp = -(x / b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-175) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.65e-63) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e-175: tmp = (-1.0 - x) / B elif F <= 1.65e-63: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e-175) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.65e-63) tmp = Float64(-Float64(x / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.25e-175) tmp = (-1.0 - x) / B; elseif (F <= 1.65e-63) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-175], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.65e-63], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-175}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-63}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.25e-175Initial program 69.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6431.3
Applied rewrites31.3%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6436.0
Applied rewrites36.0%
if -1.25e-175 < F < 1.64999999999999997e-63Initial program 99.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6455.8
Applied rewrites55.8%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6437.0
Applied rewrites37.0%
if 1.64999999999999997e-63 < F Initial program 65.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6437.3
Applied rewrites37.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6450.0
Applied rewrites50.0%
Final simplification40.9%
(FPCore (F B x) :precision binary64 (let* ((t_0 (- (/ x B)))) (if (<= x -1e-96) t_0 (if (<= x 1.3e-204) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -1e-96) {
tmp = t_0;
} else if (x <= 1.3e-204) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -(x / b)
if (x <= (-1d-96)) then
tmp = t_0
else if (x <= 1.3d-204) then
tmp = (-1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -(x / B);
double tmp;
if (x <= -1e-96) {
tmp = t_0;
} else if (x <= 1.3e-204) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -(x / B) tmp = 0 if x <= -1e-96: tmp = t_0 elif x <= 1.3e-204: tmp = -1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(-Float64(x / B)) tmp = 0.0 if (x <= -1e-96) tmp = t_0; elseif (x <= 1.3e-204) tmp = Float64(-1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -(x / B); tmp = 0.0; if (x <= -1e-96) tmp = t_0; elseif (x <= 1.3e-204) tmp = -1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / B), $MachinePrecision])}, If[LessEqual[x, -1e-96], t$95$0, If[LessEqual[x, 1.3e-204], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{B}\\
\mathbf{if}\;x \leq -1 \cdot 10^{-96}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-204}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -9.9999999999999991e-97 or 1.29999999999999991e-204 < x Initial program 77.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6440.5
Applied rewrites40.5%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6437.1
Applied rewrites37.1%
if -9.9999999999999991e-97 < x < 1.29999999999999991e-204Initial program 73.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6438.1
Applied rewrites38.1%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6418.1
Applied rewrites18.1%
Taylor expanded in x around 0
lower-/.f6418.1
Applied rewrites18.1%
Final simplification30.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.25e-175) (/ (- -1.0 x) B) (- (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-175) {
tmp = (-1.0 - x) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.25d-175)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -(x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-175) {
tmp = (-1.0 - x) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e-175: tmp = (-1.0 - x) / B else: tmp = -(x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e-175) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(-Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.25e-175) tmp = (-1.0 - x) / B; else tmp = -(x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-175], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.25 \cdot 10^{-175}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\
\end{array}
\end{array}
if F < -1.25e-175Initial program 69.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6431.3
Applied rewrites31.3%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6436.0
Applied rewrites36.0%
if -1.25e-175 < F Initial program 80.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6445.5
Applied rewrites45.5%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6430.2
Applied rewrites30.2%
Final simplification32.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
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6439.7
Applied rewrites39.7%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6427.3
Applied rewrites27.3%
Taylor expanded in x around 0
lower-/.f6410.1
Applied rewrites10.1%
herbie shell --seed 2024219
(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))))))