
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 120000000.0)
(- (/ F (* (sin B) (sqrt (fma x 2.0 (fma F F 2.0))))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 120000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, fma(F, F, 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -7000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7e9Initial program 70.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites78.4%
Applied rewrites78.5%
Taylor expanded in F around -inf
Applied rewrites99.9%
if -7e9 < F < 1.2e8Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
if 1.2e8 < F Initial program 52.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.8%
Applied rewrites73.9%
Taylor expanded in F around inf
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1 (/ F (sin B)))
(t_2 (+ t_0 (* t_1 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
(if (<= t_2 -15.0)
(fma
(- F)
(/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (- B))
(/ (- x) (tan B)))
(if (<= t_2 5.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_1)
(if (<= t_2 1e+257)
(- (/ (/ F B) (sqrt (fma x 2.0 (fma F F 2.0)))) (/ x (tan B)))
(+ t_0 (pow B -1.0)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = F / sin(B);
double t_2 = t_0 + (t_1 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double tmp;
if (t_2 <= -15.0) {
tmp = fma(-F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / -B), (-x / tan(B)));
} else if (t_2 <= 5.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_1;
} else if (t_2 <= 1e+257) {
tmp = ((F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (x / tan(B));
} else {
tmp = t_0 + pow(B, -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(F / sin(B)) t_2 = Float64(t_0 + Float64(t_1 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_2 <= -15.0) tmp = fma(Float64(-F), Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); elseif (t_2 <= 5.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_1); elseif (t_2 <= 1e+257) tmp = Float64(Float64(Float64(F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(x / tan(B))); else tmp = Float64(t_0 + (B ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + N[(t$95$1 * 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]}, If[LessEqual[t$95$2, -15.0], N[((-F) * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+257], N[(N[(N[(F / B), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{F}{\sin B}\\
t_2 := t\_0 + t\_1 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_2 \leq -15:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;t\_2 \leq 5:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+257}:\\
\;\;\;\;\frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + {B}^{-1}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -15Initial program 95.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
lower-neg.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6499.6
Applied rewrites99.6%
if -15 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 5Initial program 76.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6454.0
Applied rewrites54.0%
if 5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.00000000000000003e257Initial program 99.5%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6497.5
Applied rewrites97.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
lower-neg.f64N/A
unsub-negN/A
lower--.f6497.7
Applied rewrites97.8%
if 1.00000000000000003e257 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 35.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6435.1
Applied rewrites35.1%
Taylor expanded in F around inf
Applied rewrites81.7%
Final simplification81.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1 (- (/ (/ F B) (sqrt (fma x 2.0 (fma F F 2.0)))) (/ x (tan B))))
(t_2 (/ F (sin B)))
(t_3 (+ t_0 (* t_2 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
(if (<= t_3 -15.0)
t_1
(if (<= t_3 5.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_2)
(if (<= t_3 1e+257) t_1 (+ t_0 (pow B -1.0)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = ((F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - (x / tan(B));
double t_2 = F / sin(B);
double t_3 = t_0 + (t_2 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double tmp;
if (t_3 <= -15.0) {
tmp = t_1;
} else if (t_3 <= 5.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_2;
} else if (t_3 <= 1e+257) {
tmp = t_1;
} else {
tmp = t_0 + pow(B, -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(Float64(Float64(F / B) / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - Float64(x / tan(B))) t_2 = Float64(F / sin(B)) t_3 = Float64(t_0 + Float64(t_2 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_3 <= -15.0) tmp = t_1; elseif (t_3 <= 5.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_2); elseif (t_3 <= 1e+257) tmp = t_1; else tmp = Float64(t_0 + (B ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(F / B), $MachinePrecision] / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(t$95$2 * 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]}, If[LessEqual[t$95$3, -15.0], t$95$1, If[LessEqual[t$95$3, 5.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 1e+257], t$95$1, N[(t$95$0 + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
t_2 := \frac{F}{\sin B}\\
t_3 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_3 \leq -15:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 5:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_2\\
\mathbf{elif}\;t\_3 \leq 10^{+257}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 + {B}^{-1}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -15 or 5 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 1.00000000000000003e257Initial program 97.3%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6496.4
Applied rewrites96.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
lower-neg.f64N/A
unsub-negN/A
lower--.f6496.6
Applied rewrites96.6%
if -15 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < 5Initial program 76.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6454.0
Applied rewrites54.0%
if 1.00000000000000003e257 < (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) Initial program 35.1%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6435.1
Applied rewrites35.1%
Taylor expanded in F around inf
Applied rewrites81.7%
Final simplification80.6%
(FPCore (F B x)
:precision binary64
(if (<= B 0.33)
(/
(fma
(fma (* B B) 0.16666666666666666 1.0)
(* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F)
(fma
(fma
(*
(* (fma 0.00205026455026455 (* B B) 0.019444444444444445) F)
(sqrt (pow (fma F F 2.0) -1.0)))
(* B B)
(* 0.3333333333333333 x))
(* B B)
(- x)))
B)
(+ (* x (/ -1.0 (tan B))) (* (/ F B) (pow F -1.0)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.33) {
tmp = fma(fma((B * B), 0.16666666666666666, 1.0), (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * F), fma(fma(((fma(0.00205026455026455, (B * B), 0.019444444444444445) * F) * sqrt(pow(fma(F, F, 2.0), -1.0))), (B * B), (0.3333333333333333 * x)), (B * B), -x)) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * pow(F, -1.0));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.33) tmp = Float64(fma(fma(Float64(B * B), 0.16666666666666666, 1.0), Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * F), fma(fma(Float64(Float64(fma(0.00205026455026455, Float64(B * B), 0.019444444444444445) * F) * sqrt((fma(F, F, 2.0) ^ -1.0))), Float64(B * B), Float64(0.3333333333333333 * x)), Float64(B * B), Float64(-x))) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * (F ^ -1.0))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.33], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] + N[(N[(N[(N[(N[(0.00205026455026455 * N[(B * B), $MachinePrecision] + 0.019444444444444445), $MachinePrecision] * F), $MachinePrecision] * N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Power[F, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.33:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right), \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot F, \mathsf{fma}\left(\mathsf{fma}\left(\left(\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right) \cdot F\right) \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot {F}^{-1}\\
\end{array}
\end{array}
if B < 0.330000000000000016Initial program 77.6%
Taylor expanded in B around 0
Applied rewrites61.3%
Taylor expanded in x around 0
Applied rewrites61.4%
if 0.330000000000000016 < B Initial program 82.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6457.6
Applied rewrites57.6%
Taylor expanded in F around inf
Applied rewrites56.2%
Final simplification60.1%
(FPCore (F B x)
:precision binary64
(if (<= B 0.33)
(/
(fma
(fma (* B B) 0.16666666666666666 1.0)
(* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F)
(fma
(fma
(*
(* (fma 0.00205026455026455 (* B B) 0.019444444444444445) F)
(sqrt (pow (fma F F 2.0) -1.0)))
(* B B)
(* 0.3333333333333333 x))
(* B B)
(- x)))
B)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.33) {
tmp = fma(fma((B * B), 0.16666666666666666, 1.0), (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * F), fma(fma(((fma(0.00205026455026455, (B * B), 0.019444444444444445) * F) * sqrt(pow(fma(F, F, 2.0), -1.0))), (B * B), (0.3333333333333333 * x)), (B * B), -x)) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.33) tmp = Float64(fma(fma(Float64(B * B), 0.16666666666666666, 1.0), Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * F), fma(fma(Float64(Float64(fma(0.00205026455026455, Float64(B * B), 0.019444444444444445) * F) * sqrt((fma(F, F, 2.0) ^ -1.0))), Float64(B * B), Float64(0.3333333333333333 * x)), Float64(B * B), Float64(-x))) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.33], N[(N[(N[(N[(B * B), $MachinePrecision] * 0.16666666666666666 + 1.0), $MachinePrecision] * N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] + N[(N[(N[(N[(N[(0.00205026455026455 * N[(B * B), $MachinePrecision] + 0.019444444444444445), $MachinePrecision] * F), $MachinePrecision] * N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.33:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(B \cdot B, 0.16666666666666666, 1\right), \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot F, \mathsf{fma}\left(\mathsf{fma}\left(\left(\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right) \cdot F\right) \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}}, B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 0.330000000000000016Initial program 77.6%
Taylor expanded in B around 0
Applied rewrites61.3%
Taylor expanded in x around 0
Applied rewrites61.4%
if 0.330000000000000016 < B Initial program 82.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
Applied rewrites56.3%
Final simplification60.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))))
(if (<= B 0.33)
(/
(fma
(fma
t_0
(fma (* (* B B) F) 0.019444444444444445 (* 0.16666666666666666 F))
(* x (fma 0.022222222222222223 (* B B) 0.3333333333333333)))
(* B B)
(fma t_0 F (- x)))
B)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0));
double tmp;
if (B <= 0.33) {
tmp = fma(fma(t_0, fma(((B * B) * F), 0.019444444444444445, (0.16666666666666666 * F)), (x * fma(0.022222222222222223, (B * B), 0.3333333333333333))), (B * B), fma(t_0, F, -x)) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) tmp = 0.0 if (B <= 0.33) tmp = Float64(fma(fma(t_0, fma(Float64(Float64(B * B) * F), 0.019444444444444445, Float64(0.16666666666666666 * F)), Float64(x * fma(0.022222222222222223, Float64(B * B), 0.3333333333333333))), Float64(B * B), fma(t_0, F, Float64(-x))) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.33], N[(N[(N[(t$95$0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.019444444444444445 + N[(0.16666666666666666 * F), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\
\mathbf{if}\;B \leq 0.33:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_0, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.019444444444444445, 0.16666666666666666 \cdot F\right), x \cdot \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right)\right), B \cdot B, \mathsf{fma}\left(t\_0, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 0.330000000000000016Initial program 77.6%
Taylor expanded in B around 0
Applied rewrites61.1%
if 0.330000000000000016 < B Initial program 82.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
Applied rewrites56.3%
Final simplification59.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0))))
(if (<= B 0.196)
(/
(fma
t_0
F
(fma
(fma (* 0.16666666666666666 F) t_0 (* 0.3333333333333333 x))
(* B B)
(- x)))
B)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B)))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0));
double tmp;
if (B <= 0.196) {
tmp = fma(t_0, F, fma(fma((0.16666666666666666 * F), t_0, (0.3333333333333333 * x)), (B * B), -x)) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) tmp = 0.0 if (B <= 0.196) 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(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.196], 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[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}\\
\mathbf{if}\;B \leq 0.196:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\end{array}
\end{array}
if B < 0.19600000000000001Initial program 77.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites88.1%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Applied rewrites61.5%
if 0.19600000000000001 < B Initial program 82.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6457.6
Applied rewrites57.6%
Taylor expanded in F around -inf
Applied rewrites56.3%
Final simplification60.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.85e-18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2.5e-59)
(* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))
(if (<= F 47000.0)
(fma
(- F)
(/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (- B))
(/ (- x) (tan B)))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.85e-18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2.5e-59) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
} else if (F <= 47000.0) {
tmp = fma(-F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / -B), (-x / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.85e-18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2.5e-59) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); elseif (F <= 47000.0) tmp = fma(Float64(-F), Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.85e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.5e-59], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 47000.0], N[((-F) * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2.5 \cdot 10^{-59}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\mathbf{elif}\;F \leq 47000:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.8500000000000002e-18Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites79.6%
Applied rewrites79.7%
Taylor expanded in F around -inf
Applied rewrites98.7%
if -1.8500000000000002e-18 < F < -2.5000000000000001e-59Initial program 99.3%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6489.5
Applied rewrites89.5%
if -2.5000000000000001e-59 < F < 47000Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
lower-neg.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6484.9
Applied rewrites84.9%
if 47000 < F Initial program 52.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.8%
Applied rewrites73.9%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification93.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))))
(if (<= F -1.85e-18)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -2.5e-59)
t_0
(if (<= F 2.4e-11)
(fma
(- F)
(/ (sqrt (pow (+ (fma 2.0 x (* F F)) 2.0) -1.0)) (- B))
(/ (- x) (tan B)))
(if (<= F 4.5e+30) t_0 (+ (* x (/ -1.0 (tan B))) (pow B -1.0))))))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
double tmp;
if (F <= -1.85e-18) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -2.5e-59) {
tmp = t_0;
} else if (F <= 2.4e-11) {
tmp = fma(-F, (sqrt(pow((fma(2.0, x, (F * F)) + 2.0), -1.0)) / -B), (-x / tan(B)));
} else if (F <= 4.5e+30) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + pow(B, -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))) tmp = 0.0 if (F <= -1.85e-18) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -2.5e-59) tmp = t_0; elseif (F <= 2.4e-11) tmp = fma(Float64(-F), Float64(sqrt((Float64(fma(2.0, x, Float64(F * F)) + 2.0) ^ -1.0)) / Float64(-B)), Float64(Float64(-x) / tan(B))); elseif (F <= 4.5e+30) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (B ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.85e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.5e-59], t$95$0, If[LessEqual[F, 2.4e-11], N[((-F) * N[(N[Sqrt[N[Power[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] / (-B)), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.5e+30], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -2.5 \cdot 10^{-59}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.4 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(-F, \frac{\sqrt{{\left(\mathsf{fma}\left(2, x, F \cdot F\right) + 2\right)}^{-1}}}{-B}, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{+30}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {B}^{-1}\\
\end{array}
\end{array}
if F < -1.8500000000000002e-18Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites79.6%
Applied rewrites79.7%
Taylor expanded in F around -inf
Applied rewrites98.7%
if -1.8500000000000002e-18 < F < -2.5000000000000001e-59 or 2.4000000000000001e-11 < F < 4.49999999999999995e30Initial program 99.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6493.2
Applied rewrites93.2%
if -2.5000000000000001e-59 < F < 2.4000000000000001e-11Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in B around 0
mul-1-negN/A
lower-neg.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6486.3
Applied rewrites86.3%
if 4.49999999999999995e30 < F Initial program 49.9%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6441.2
Applied rewrites41.2%
Taylor expanded in F around inf
Applied rewrites76.7%
Final simplification87.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.85e-18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -4.2e-116)
(+ (- (/ x B)) (/ (* (pow (fma x 2.0 (fma F F 2.0)) -0.5) F) (sin B)))
(if (<= F 47000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F B) (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.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.85e-18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -4.2e-116) {
tmp = -(x / B) + ((pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) * F) / sin(B));
} else if (F <= 47000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / B) * sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.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.85e-18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -4.2e-116) tmp = Float64(Float64(-Float64(x / B)) + Float64(Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) * F) / sin(B))); elseif (F <= 47000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / B) * sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.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.85e-18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -4.2e-116], N[((-N[(x / B), $MachinePrecision]) + N[(N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 47000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.85 \cdot 10^{-18}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -4.2 \cdot 10^{-116}:\\
\;\;\;\;\left(-\frac{x}{B}\right) + \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5} \cdot F}{\sin B}\\
\mathbf{elif}\;F \leq 47000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{B} \cdot \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.8500000000000002e-18Initial program 72.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites79.6%
Applied rewrites79.7%
Taylor expanded in F around -inf
Applied rewrites98.7%
if -1.8500000000000002e-18 < F < -4.1999999999999998e-116Initial program 99.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites99.1%
Taylor expanded in B around 0
lower-/.f6488.0
Applied rewrites88.0%
if -4.1999999999999998e-116 < F < 47000Initial program 99.6%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6487.9
Applied rewrites87.9%
if 47000 < F Initial program 52.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
frac-2negN/A
div-invN/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites73.8%
Applied rewrites73.9%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification94.3%
(FPCore (F B x)
:precision binary64
(if (<= F -230000000000.0)
(/
(- (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) -1.0) x)
B)
(if (<= F 1.42)
(fma (/ F B) (sqrt (pow (fma 2.0 x 2.0) -1.0)) (/ (- x) B))
(/ (- (- 1.0 (pow (* F F) -1.0)) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -230000000000.0) {
tmp = (fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), -1.0) - x) / B;
} else if (F <= 1.42) {
tmp = fma((F / B), sqrt(pow(fma(2.0, x, 2.0), -1.0)), (-x / B));
} else {
tmp = ((1.0 - pow((F * F), -1.0)) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -230000000000.0) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), -1.0) - x) / B); elseif (F <= 1.42) tmp = fma(Float64(F / B), sqrt((fma(2.0, x, 2.0) ^ -1.0)), Float64(Float64(-x) / B)); else tmp = Float64(Float64(Float64(1.0 - (Float64(F * F) ^ -1.0)) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -230000000000.0], N[(N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] + N[((-x) / B), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - N[Power[N[(F * F), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -230000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{B}, \sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, \frac{-x}{B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - {\left(F \cdot F\right)}^{-1}\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.3e11Initial program 70.5%
Taylor expanded in B around 0
Applied rewrites45.7%
Taylor expanded in F around -inf
Applied rewrites56.0%
Taylor expanded in B around 0
Applied rewrites56.4%
if -2.3e11 < F < 1.4199999999999999Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.8
Applied rewrites51.8%
Taylor expanded in F around 0
Applied rewrites51.8%
if 1.4199999999999999 < F Initial program 53.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.f6440.7
Applied rewrites40.7%
Taylor expanded in F around inf
Applied rewrites53.1%
Taylor expanded in x around 0
Applied rewrites53.1%
Final simplification53.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma 0.16666666666666666 (* B B) 1.0)))
(if (<= F -6.8e+44)
(/
(-
(fma
(fma
(- (fma 0.00205026455026455 (* B B) 0.019444444444444445))
(* B B)
(* 0.3333333333333333 x))
(* B B)
(- t_0))
x)
B)
(if (<= F 1.8e+34)
(/ (fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (- x)) B)
(/
(-
(+
t_0
(*
(fma
(-
(fma
(fma 0.0021164021164021165 (* B B) 0.022222222222222223)
x
0.019444444444444445)
(* -0.00205026455026455 (* B B)))
(* B B)
(* 0.3333333333333333 x))
(* B B)))
x)
B)))))
double code(double F, double B, double x) {
double t_0 = fma(0.16666666666666666, (B * B), 1.0);
double tmp;
if (F <= -6.8e+44) {
tmp = (fma(fma(-fma(0.00205026455026455, (B * B), 0.019444444444444445), (B * B), (0.3333333333333333 * x)), (B * B), -t_0) - x) / B;
} else if (F <= 1.8e+34) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, -x) / B;
} else {
tmp = ((t_0 + (fma((fma(fma(0.0021164021164021165, (B * B), 0.022222222222222223), x, 0.019444444444444445) - (-0.00205026455026455 * (B * B))), (B * B), (0.3333333333333333 * x)) * (B * B))) - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = fma(0.16666666666666666, Float64(B * B), 1.0) tmp = 0.0 if (F <= -6.8e+44) tmp = Float64(Float64(fma(fma(Float64(-fma(0.00205026455026455, Float64(B * B), 0.019444444444444445)), Float64(B * B), Float64(0.3333333333333333 * x)), Float64(B * B), Float64(-t_0)) - x) / B); elseif (F <= 1.8e+34) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(t_0 + Float64(fma(Float64(fma(fma(0.0021164021164021165, Float64(B * B), 0.022222222222222223), x, 0.019444444444444445) - Float64(-0.00205026455026455 * Float64(B * B))), Float64(B * B), Float64(0.3333333333333333 * x)) * Float64(B * B))) - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[F, -6.8e+44], N[(N[(N[(N[((-N[(0.00205026455026455 * N[(B * B), $MachinePrecision] + 0.019444444444444445), $MachinePrecision]) * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-t$95$0)), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.8e+34], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(t$95$0 + N[(N[(N[(N[(N[(0.0021164021164021165 * N[(B * B), $MachinePrecision] + 0.022222222222222223), $MachinePrecision] * x + 0.019444444444444445), $MachinePrecision] - N[(-0.00205026455026455 * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\\
\mathbf{if}\;F \leq -6.8 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -t\_0\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+34}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(t\_0 + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, B \cdot B, 0.022222222222222223\right), x, 0.019444444444444445\right) - -0.00205026455026455 \cdot \left(B \cdot B\right), B \cdot B, 0.3333333333333333 \cdot x\right) \cdot \left(B \cdot B\right)\right) - x}{B}\\
\end{array}
\end{array}
if F < -6.8e44Initial program 66.0%
Taylor expanded in B around 0
Applied rewrites47.4%
Taylor expanded in F around -inf
Applied rewrites59.4%
Taylor expanded in x around 0
Applied rewrites59.8%
if -6.8e44 < F < 1.8e34Initial 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.f6450.4
Applied rewrites50.4%
if 1.8e34 < F Initial program 49.9%
Taylor expanded in B around 0
Applied rewrites40.0%
Taylor expanded in F around inf
Applied rewrites53.7%
Final simplification53.4%
(FPCore (F B x)
:precision binary64
(if (<= F -6.8e+44)
(/
(-
(fma
(fma
(- (fma 0.00205026455026455 (* B B) 0.019444444444444445))
(* B B)
(* 0.3333333333333333 x))
(* B B)
(- (fma 0.16666666666666666 (* B B) 1.0)))
x)
B)
(if (<= F 50000.0)
(/ (fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.8e+44) {
tmp = (fma(fma(-fma(0.00205026455026455, (B * B), 0.019444444444444445), (B * B), (0.3333333333333333 * x)), (B * B), -fma(0.16666666666666666, (B * B), 1.0)) - x) / B;
} else if (F <= 50000.0) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -6.8e+44) tmp = Float64(Float64(fma(fma(Float64(-fma(0.00205026455026455, Float64(B * B), 0.019444444444444445)), Float64(B * B), Float64(0.3333333333333333 * x)), Float64(B * B), Float64(-fma(0.16666666666666666, Float64(B * B), 1.0))) - x) / B); elseif (F <= 50000.0) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -6.8e+44], N[(N[(N[(N[((-N[(0.00205026455026455 * N[(B * B), $MachinePrecision] + 0.019444444444444445), $MachinePrecision]) * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + (-N[(0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision])), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 50000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.8 \cdot 10^{+44}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(-\mathsf{fma}\left(0.00205026455026455, B \cdot B, 0.019444444444444445\right), B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, -\mathsf{fma}\left(0.16666666666666666, B \cdot B, 1\right)\right) - x}{B}\\
\mathbf{elif}\;F \leq 50000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.8e44Initial program 66.0%
Taylor expanded in B around 0
Applied rewrites47.4%
Taylor expanded in F around -inf
Applied rewrites59.4%
Taylor expanded in x around 0
Applied rewrites59.8%
if -6.8e44 < F < 5e4Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.0
Applied rewrites51.0%
if 5e4 < F Initial program 52.7%
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.9
Applied rewrites39.9%
Taylor expanded in F around inf
Applied rewrites52.4%
Final simplification53.4%
(FPCore (F B x)
:precision binary64
(if (<= F -4.5e+59)
(/
(-
(fma
(fma
0.3333333333333333
x
(fma
(fma
0.022222222222222223
x
(fma
(fma 0.0021164021164021165 x -0.00205026455026455)
(* B B)
-0.019444444444444445))
(* B B)
-0.16666666666666666))
(* B B)
-1.0)
x)
B)
(if (<= F 50000.0)
(/ (fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (- x)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e+59) {
tmp = (fma(fma(0.3333333333333333, x, fma(fma(0.022222222222222223, x, fma(fma(0.0021164021164021165, x, -0.00205026455026455), (B * B), -0.019444444444444445)), (B * B), -0.16666666666666666)), (B * B), -1.0) - x) / B;
} else if (F <= 50000.0) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.5e+59) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, fma(fma(0.022222222222222223, x, fma(fma(0.0021164021164021165, x, -0.00205026455026455), Float64(B * B), -0.019444444444444445)), Float64(B * B), -0.16666666666666666)), Float64(B * B), -1.0) - x) / B); elseif (F <= 50000.0) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.5e+59], N[(N[(N[(N[(0.3333333333333333 * x + N[(N[(0.022222222222222223 * x + N[(N[(0.0021164021164021165 * x + -0.00205026455026455), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.019444444444444445), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 50000.0], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.5 \cdot 10^{+59}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, \mathsf{fma}\left(\mathsf{fma}\left(0.022222222222222223, x, \mathsf{fma}\left(\mathsf{fma}\left(0.0021164021164021165, x, -0.00205026455026455\right), B \cdot B, -0.019444444444444445\right)\right), B \cdot B, -0.16666666666666666\right)\right), B \cdot B, -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 50000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.49999999999999959e59Initial program 64.1%
Taylor expanded in B around 0
Applied rewrites48.1%
Taylor expanded in F around -inf
Applied rewrites60.7%
Taylor expanded in B around 0
Applied rewrites61.0%
if -4.49999999999999959e59 < F < 5e4Initial 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.f6450.7
Applied rewrites50.7%
if 5e4 < F Initial program 52.7%
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.9
Applied rewrites39.9%
Taylor expanded in F around inf
Applied rewrites52.4%
Final simplification53.4%
(FPCore (F B x)
:precision binary64
(if (<= F -230000000000.0)
(/
(- (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) -1.0) x)
B)
(if (<= F 1.42)
(/ (fma (sqrt (pow (fma 2.0 x 2.0) -1.0)) F (- x)) B)
(/ (- (- 1.0 (pow (* F F) -1.0)) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -230000000000.0) {
tmp = (fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), -1.0) - x) / B;
} else if (F <= 1.42) {
tmp = fma(sqrt(pow(fma(2.0, x, 2.0), -1.0)), F, -x) / B;
} else {
tmp = ((1.0 - pow((F * F), -1.0)) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -230000000000.0) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), -1.0) - x) / B); elseif (F <= 1.42) tmp = Float64(fma(sqrt((fma(2.0, x, 2.0) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(1.0 - (Float64(F * F) ^ -1.0)) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -230000000000.0], N[(N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(N[Sqrt[N[Power[N[(2.0 * x + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[Power[N[(F * F), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -230000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(2, x, 2\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - {\left(F \cdot F\right)}^{-1}\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.3e11Initial program 70.5%
Taylor expanded in B around 0
Applied rewrites45.7%
Taylor expanded in F around -inf
Applied rewrites56.0%
Taylor expanded in B around 0
Applied rewrites56.4%
if -2.3e11 < F < 1.4199999999999999Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.8
Applied rewrites51.8%
Taylor expanded in F around 0
Applied rewrites51.8%
if 1.4199999999999999 < F Initial program 53.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.f6440.7
Applied rewrites40.7%
Taylor expanded in F around inf
Applied rewrites53.1%
Taylor expanded in x around 0
Applied rewrites53.1%
Final simplification53.3%
(FPCore (F B x)
:precision binary64
(if (<= F -230000000000.0)
(/
(- (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) -1.0) x)
B)
(if (<= F 1.42)
(/ (fma (sqrt 0.5) F (- x)) B)
(/ (- (- 1.0 (pow (* F F) -1.0)) x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -230000000000.0) {
tmp = (fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), -1.0) - x) / B;
} else if (F <= 1.42) {
tmp = fma(sqrt(0.5), F, -x) / B;
} else {
tmp = ((1.0 - pow((F * F), -1.0)) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -230000000000.0) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), -1.0) - x) / B); elseif (F <= 1.42) tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(1.0 - (Float64(F * F) ^ -1.0)) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -230000000000.0], N[(N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(1.0 - N[Power[N[(F * F), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -230000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.42:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(1 - {\left(F \cdot F\right)}^{-1}\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.3e11Initial program 70.5%
Taylor expanded in B around 0
Applied rewrites45.7%
Taylor expanded in F around -inf
Applied rewrites56.0%
Taylor expanded in B around 0
Applied rewrites56.4%
if -2.3e11 < F < 1.4199999999999999Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.8
Applied rewrites51.8%
Taylor expanded in F around 0
Applied rewrites51.8%
Taylor expanded in x around 0
Applied rewrites51.8%
if 1.4199999999999999 < F Initial program 53.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.f6440.7
Applied rewrites40.7%
Taylor expanded in F around inf
Applied rewrites53.1%
Taylor expanded in x around 0
Applied rewrites53.1%
Final simplification53.3%
(FPCore (F B x)
:precision binary64
(if (<= F -230000000000.0)
(/
(- (fma (fma 0.3333333333333333 x -0.16666666666666666) (* B B) -1.0) x)
B)
(if (<= F 2.5e-12) (/ (fma (sqrt 0.5) F (- x)) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -230000000000.0) {
tmp = (fma(fma(0.3333333333333333, x, -0.16666666666666666), (B * B), -1.0) - x) / B;
} else if (F <= 2.5e-12) {
tmp = fma(sqrt(0.5), F, -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -230000000000.0) tmp = Float64(Float64(fma(fma(0.3333333333333333, x, -0.16666666666666666), Float64(B * B), -1.0) - x) / B); elseif (F <= 2.5e-12) tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -230000000000.0], N[(N[(N[(N[(0.3333333333333333 * x + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-12], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -230000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.16666666666666666\right), B \cdot B, -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.3e11Initial program 70.5%
Taylor expanded in B around 0
Applied rewrites45.7%
Taylor expanded in F around -inf
Applied rewrites56.0%
Taylor expanded in B around 0
Applied rewrites56.4%
if -2.3e11 < F < 2.49999999999999985e-12Initial 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.f6452.1
Applied rewrites52.1%
Taylor expanded in F around 0
Applied rewrites52.1%
Taylor expanded in x around 0
Applied rewrites52.1%
if 2.49999999999999985e-12 < F Initial program 55.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.f6440.6
Applied rewrites40.6%
Taylor expanded in F around inf
Applied rewrites52.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.9e-23) (/ (- -1.0 x) B) (if (<= F 2.5e-12) (/ (fma (sqrt 0.5) F (- x)) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.9e-23) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-12) {
tmp = fma(sqrt(0.5), F, -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.9e-23) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.5e-12) tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.9e-23], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-12], N[(N[(N[Sqrt[0.5], $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.9 \cdot 10^{-23}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-12}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.90000000000000006e-23Initial program 72.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.f6444.6
Applied rewrites44.6%
Taylor expanded in F around -inf
Applied rewrites54.1%
if -1.90000000000000006e-23 < F < 2.49999999999999985e-12Initial 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.1
Applied rewrites53.1%
Taylor expanded in F around 0
Applied rewrites53.1%
Taylor expanded in x around 0
Applied rewrites53.1%
if 2.49999999999999985e-12 < F Initial program 55.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.f6440.6
Applied rewrites40.6%
Taylor expanded in F around inf
Applied rewrites52.0%
(FPCore (F B x) :precision binary64 (if (<= F -4e-60) (/ (- -1.0 x) B) (if (<= F 5.4e-24) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-60) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.4e-24) {
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 <= (-4d-60)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 5.4d-24) 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 <= -4e-60) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.4e-24) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4e-60: tmp = (-1.0 - x) / B elif F <= 5.4e-24: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4e-60) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 5.4e-24) 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 <= -4e-60) tmp = (-1.0 - x) / B; elseif (F <= 5.4e-24) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4e-60], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.4e-24], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-60}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-24}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.9999999999999999e-60Initial program 76.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.1
Applied rewrites45.1%
Taylor expanded in F around -inf
Applied rewrites48.8%
if -3.9999999999999999e-60 < F < 5.40000000000000014e-24Initial 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.1
Applied rewrites53.1%
Taylor expanded in F around 0
Applied rewrites42.5%
if 5.40000000000000014e-24 < F Initial program 56.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.f6441.6
Applied rewrites41.6%
Taylor expanded in F around inf
Applied rewrites51.5%
(FPCore (F B x) :precision binary64 (if (<= F -4e-60) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -4e-60) {
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 <= (-4d-60)) 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 <= -4e-60) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4e-60: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4e-60) 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 <= -4e-60) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4e-60], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4 \cdot 10^{-60}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -3.9999999999999999e-60Initial program 76.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.1
Applied rewrites45.1%
Taylor expanded in F around -inf
Applied rewrites48.8%
if -3.9999999999999999e-60 < F Initial program 80.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.f6447.9
Applied rewrites47.9%
Taylor expanded in F around 0
Applied rewrites32.7%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 78.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.f6447.0
Applied rewrites47.0%
Taylor expanded in F around 0
Applied rewrites29.8%
herbie shell --seed 2024314
(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))))))