
(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 -1.5e+139)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.5e+21)
(fma (/ (pow (fma 2.0 x (fma F F 2.0)) -0.5) (sin B)) F (- t_0))
(fma (/ -1.0 (tan B)) x (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.5e+139) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.5e+21) {
tmp = fma((pow(fma(2.0, x, fma(F, F, 2.0)), -0.5) / sin(B)), F, -t_0);
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5e+139) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.5e+21) tmp = fma(Float64((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5) / sin(B)), F, Float64(-t_0)); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e+139], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.5e+21], N[(N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + (-t$95$0)), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{+139}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B}, F, -t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.5e139Initial program 42.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites56.0%
Applied rewrites56.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -1.5e139 < F < 1.5e21Initial program 98.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.7%
if 1.5e21 < F Initial program 59.8%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1
(+
t_0
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 2.0 x)) (/ -1.0 2.0)))))
(t_2 (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))))
(t_3 (/ (fma F t_2 (- x)) (sin B)))
(t_4 (+ t_0 (* t_2 (/ F B)))))
(if (<= t_1 -200.0)
t_4
(if (<= t_1 -1e-154)
t_3
(if (<= t_1 1e-12)
t_4
(if (<= t_1 10.0) t_3 (if (<= t_1 1e+308) t_4 (/ (- 1.0 x) B))))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = t_0 + ((F / sin(B)) * pow(((2.0 + (F * F)) + (2.0 * x)), (-1.0 / 2.0)));
double t_2 = sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))));
double t_3 = fma(F, t_2, -x) / sin(B);
double t_4 = t_0 + (t_2 * (F / B));
double tmp;
if (t_1 <= -200.0) {
tmp = t_4;
} else if (t_1 <= -1e-154) {
tmp = t_3;
} else if (t_1 <= 1e-12) {
tmp = t_4;
} else if (t_1 <= 10.0) {
tmp = t_3;
} else if (t_1 <= 1e+308) {
tmp = t_4;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) t_2 = sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) t_3 = Float64(fma(F, t_2, Float64(-x)) / sin(B)) t_4 = Float64(t_0 + Float64(t_2 * Float64(F / B))) tmp = 0.0 if (t_1 <= -200.0) tmp = t_4; elseif (t_1 <= -1e-154) tmp = t_3; elseif (t_1 <= 1e-12) tmp = t_4; elseif (t_1 <= 10.0) tmp = t_3; elseif (t_1 <= 1e+308) tmp = t_4; else tmp = Float64(Float64(1.0 - x) / B); 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[(t$95$0 + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(F * t$95$2 + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 + N[(t$95$2 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -200.0], t$95$4, If[LessEqual[t$95$1, -1e-154], t$95$3, If[LessEqual[t$95$1, 1e-12], t$95$4, If[LessEqual[t$95$1, 10.0], t$95$3, If[LessEqual[t$95$1, 1e+308], t$95$4, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := t\_0 + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
t_2 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
t_3 := \frac{\mathsf{fma}\left(F, t\_2, -x\right)}{\sin B}\\
t_4 := t\_0 + t\_2 \cdot \frac{F}{B}\\
\mathbf{if}\;t\_1 \leq -200:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{-154}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 10^{-12}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 10^{+308}:\\
\;\;\;\;t\_4\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\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)))))) < -200 or -9.9999999999999997e-155 < (+.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)))))) < 9.9999999999999998e-13 or 10 < (+.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)))))) < 1e308Initial program 87.7%
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.3
Applied rewrites82.3%
if -200 < (+.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)))))) < -9.9999999999999997e-155 or 9.9999999999999998e-13 < (+.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)))))) < 10Initial program 88.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites88.0%
Applied rewrites87.9%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6474.5
Applied rewrites74.5%
if 1e308 < (+.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 20.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.f6451.6
Applied rewrites51.6%
Taylor expanded in F around inf
Applied rewrites80.2%
Final simplification80.3%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+75)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 1.5e+21)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) (/ x (tan B)))
(fma (/ -1.0 (tan B)) x (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+75) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 1.5e+21) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - (x / tan(B));
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+75) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 1.5e+21) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - Float64(x / tan(B))); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+75], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e+21], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+75}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+21}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -5.0000000000000002e75Initial program 60.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites69.8%
Applied rewrites69.8%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-neg.f6499.7
Applied rewrites99.7%
if -5.0000000000000002e75 < F < 1.5e21Initial program 98.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.6%
if 1.5e21 < F Initial program 59.8%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Applied rewrites99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.65)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.001)
(- (/ F (* (sin B) (sqrt (fma x 2.0 2.0)))) t_0)
(fma (/ -1.0 (tan B)) x (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.65) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.001) {
tmp = (F / (sin(B) * sqrt(fma(x, 2.0, 2.0)))) - t_0;
} else {
tmp = fma((-1.0 / tan(B)), x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.65) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.001) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(x, 2.0, 2.0)))) - t_0); else tmp = fma(Float64(-1.0 / tan(B)), x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.65], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.001], 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[Tan[B], $MachinePrecision]), $MachinePrecision] * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.65:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.001:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\tan B}, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.6499999999999999Initial program 65.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites75.2%
Applied rewrites75.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -1.6499999999999999 < F < 1e-3Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.6%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.4
Applied rewrites99.4%
if 1e-3 < F Initial program 62.4%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.2
Applied rewrites99.2%
Applied rewrites99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ -1.0 (tan B))))
(if (<= F -165000000000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.02e-5)
(+ (* x t_0) (* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B)))
(fma t_0 x (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = -1.0 / tan(B);
double tmp;
if (F <= -165000000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.02e-5) {
tmp = (x * t_0) + (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B));
} else {
tmp = fma(t_0, x, (1.0 / sin(B)));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-1.0 / tan(B)) tmp = 0.0 if (F <= -165000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.02e-5) tmp = Float64(Float64(x * t_0) + Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B))); else tmp = fma(t_0, x, Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -165000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(x * t$95$0), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * x + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -165000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;x \cdot t\_0 + \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_0, x, \frac{1}{\sin B}\right)\\
\end{array}
\end{array}
if F < -1.65e11Initial program 65.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.8%
Applied rewrites74.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -1.65e11 < F < 1.0200000000000001e-5Initial program 99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6486.6
Applied rewrites86.6%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6498.1
Applied rewrites98.1%
Applied rewrites98.2%
Final simplification93.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))))
(if (<= F -8.8e+111)
(- (/ x (tan B)))
(if (<= F -6e-100)
(/ (fma F t_0 (- x)) (sin B))
(if (<= F 1.02e-5)
(+ (* x (/ -1.0 (tan B))) (* t_0 (/ F B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0))));
double tmp;
if (F <= -8.8e+111) {
tmp = -(x / tan(B));
} else if (F <= -6e-100) {
tmp = fma(F, t_0, -x) / sin(B);
} else if (F <= 1.02e-5) {
tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) tmp = 0.0 if (F <= -8.8e+111) tmp = Float64(-Float64(x / tan(B))); elseif (F <= -6e-100) tmp = Float64(fma(F, t_0, Float64(-x)) / sin(B)); elseif (F <= 1.02e-5) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_0 * Float64(F / B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[F, -8.8e+111], (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), If[LessEqual[F, -6e-100], N[(N[(F * t$95$0 + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}\\
\mathbf{if}\;F \leq -8.8 \cdot 10^{+111}:\\
\;\;\;\;-\frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-100}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, t\_0, -x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0 \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -8.79999999999999994e111Initial program 52.4%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6461.6
Applied rewrites61.6%
Applied rewrites61.6%
if -8.79999999999999994e111 < F < -6.0000000000000001e-100Initial program 96.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.5%
Applied rewrites99.5%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6483.9
Applied rewrites83.9%
if -6.0000000000000001e-100 < F < 1.0200000000000001e-5Initial program 99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6489.6
Applied rewrites89.6%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6498.1
Applied rewrites98.1%
Applied rewrites98.1%
Final simplification86.5%
(FPCore (F B x)
:precision binary64
(if (<= F -165000000000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.02e-5)
(+
(* x (/ -1.0 (tan B)))
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -165000000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.02e-5) {
tmp = (x * (-1.0 / tan(B))) + (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -165000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.02e-5) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -165000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -165000000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.65e11Initial program 65.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.8%
Applied rewrites74.8%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -1.65e11 < F < 1.0200000000000001e-5Initial program 99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6486.6
Applied rewrites86.6%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6498.1
Applied rewrites98.1%
Applied rewrites98.1%
Final simplification93.4%
(FPCore (F B x)
:precision binary64
(if (<= F -165000000000.0)
(/ (fma (cos B) (- x) -1.0) (sin B))
(if (<= F 1.02e-5)
(+
(* x (/ -1.0 (tan B)))
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B)))
(/ (- 1.0 (* x (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -165000000000.0) {
tmp = fma(cos(B), -x, -1.0) / sin(B);
} else if (F <= 1.02e-5) {
tmp = (x * (-1.0 / tan(B))) + (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -165000000000.0) tmp = Float64(fma(cos(B), Float64(-x), -1.0) / sin(B)); elseif (F <= 1.02e-5) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -165000000000.0], N[(N[(N[Cos[B], $MachinePrecision] * (-x) + -1.0), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.02e-5], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -165000000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(\cos B, -x, -1\right)}{\sin B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{-5}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.65e11Initial program 65.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites74.8%
Applied rewrites74.8%
Taylor expanded in F around -inf
mul-1-negN/A
+-commutativeN/A
distribute-neg-inN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-cos.f64N/A
lower-neg.f6499.6
Applied rewrites99.6%
if -1.65e11 < F < 1.0200000000000001e-5Initial program 99.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6486.6
Applied rewrites86.6%
if 1.0200000000000001e-5 < F Initial program 62.9%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6498.1
Applied rewrites98.1%
Applied rewrites98.1%
Final simplification93.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -0.16)
t_0
(if (<= x 2.2e-64)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) (sin B))
t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -0.16) {
tmp = t_0;
} else if (x <= 2.2e-64) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / 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 <= -0.16) tmp = t_0; elseif (x <= 2.2e-64) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / 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, -0.16], t$95$0, If[LessEqual[x, 2.2e-64], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -0.16:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-64}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -0.160000000000000003 or 2.2e-64 < x Initial program 84.9%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6490.0
Applied rewrites90.0%
Applied rewrites90.2%
if -0.160000000000000003 < x < 2.2e-64Initial program 75.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites77.1%
Applied rewrites77.2%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6466.5
Applied rewrites66.5%
Final simplification77.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -2.05e-81)
t_0
(if (<= x 7e-112) (/ F (* (sin B) (sqrt (fma F F 2.0)))) t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -2.05e-81) {
tmp = t_0;
} else if (x <= 7e-112) {
tmp = F / (sin(B) * sqrt(fma(F, F, 2.0)));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (x <= -2.05e-81) tmp = t_0; elseif (x <= 7e-112) tmp = Float64(F / Float64(sin(B) * sqrt(fma(F, F, 2.0)))); 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, -2.05e-81], t$95$0, If[LessEqual[x, 7e-112], N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{-81}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-112}:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(F, F, 2\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.04999999999999992e-81 or 6.99999999999999988e-112 < x Initial program 83.9%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6482.7
Applied rewrites82.7%
Applied rewrites82.7%
if -2.04999999999999992e-81 < x < 6.99999999999999988e-112Initial program 74.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites76.3%
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.f6457.5
Applied rewrites57.5%
Applied rewrites59.3%
Final simplification72.9%
(FPCore (F B x)
:precision binary64
(if (<= F -7.5e+161)
(/ -1.0 (sin B))
(if (<= F 3.6e+21)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.5e+161) {
tmp = -1.0 / sin(B);
} else if (F <= 3.6e+21) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7.5e+161) tmp = Float64(-1.0 / sin(B)); elseif (F <= 3.6e+21) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7.5e+161], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e+21], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.5 \cdot 10^{+161}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -7.4999999999999995e161Initial program 40.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites52.2%
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.f641.9
Applied rewrites1.9%
Taylor expanded in F around -inf
Applied rewrites47.7%
if -7.4999999999999995e161 < F < 3.6e21Initial program 98.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6450.2
Applied rewrites50.2%
if 3.6e21 < F Initial program 59.2%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites58.4%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+79)
(/ (- -1.0 x) B)
(if (<= F 3.6e+21)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) B)
(/ 1.0 (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+79) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.6e+21) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1e+79) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.6e+21) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1e+79], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.6e+21], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+79}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{+21}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -9.99999999999999967e78Initial program 58.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.f6427.0
Applied rewrites27.0%
Taylor expanded in F around -inf
Applied rewrites38.7%
if -9.99999999999999967e78 < F < 3.6e21Initial 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.f6451.3
Applied rewrites51.3%
if 3.6e21 < F Initial program 59.2%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in x around 0
Applied rewrites58.4%
(FPCore (F B x)
:precision binary64
(if (<= B 0.112)
(/
(fma
(sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0))))
(fma 0.16666666666666666 (* F (* B B)) F)
(- (* (* x (* B B)) 0.3333333333333333) x))
B)
(- (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.112) {
tmp = fma(sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, (F * (B * B)), F), (((x * (B * B)) * 0.3333333333333333) - x)) / B;
} else {
tmp = -(x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.112) tmp = Float64(fma(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), fma(0.16666666666666666, Float64(F * Float64(B * B)), F), Float64(Float64(Float64(x * Float64(B * B)) * 0.3333333333333333) - x)) / B); else tmp = Float64(-Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.112], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(0.16666666666666666 * N[(F * N[(B * B), $MachinePrecision]), $MachinePrecision] + F), $MachinePrecision] + N[(N[(N[(x * N[(B * B), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.112:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, \mathsf{fma}\left(0.16666666666666666, F \cdot \left(B \cdot B\right), F\right), \left(x \cdot \left(B \cdot B\right)\right) \cdot 0.3333333333333333 - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.112000000000000002Initial program 79.9%
Taylor expanded in B around 0
Applied rewrites54.7%
if 0.112000000000000002 < B Initial program 79.6%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6457.3
Applied rewrites57.3%
Applied rewrites57.4%
Final simplification55.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.5)
(/ (- -1.0 x) B)
(if (<= F 140000.0)
(/ (fma F (sqrt (/ 1.0 (fma 2.0 x 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 <= -1.5) {
tmp = (-1.0 - x) / B;
} else if (F <= 140000.0) {
tmp = fma(F, sqrt((1.0 / fma(2.0, x, 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 <= -1.5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 140000.0) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(2.0, x, 2.0))), Float64(-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.5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 140000.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 * x + 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 -1.5:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 140000:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(2, x, 2\right)}}, -x\right)}{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.5Initial program 65.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.f6432.2
Applied rewrites32.2%
Taylor expanded in F around -inf
Applied rewrites41.4%
if -1.5 < F < 1.4e5Initial 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.f6450.4
Applied rewrites50.4%
Taylor expanded in F around 0
Applied rewrites50.4%
if 1.4e5 < F Initial program 61.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.f6427.8
Applied rewrites27.8%
Taylor expanded in F around inf
Applied rewrites43.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.42)
(/ (- -1.0 x) B)
(if (<= F 140000.0)
(/ (fma F (sqrt 0.5) (- 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.42) {
tmp = (-1.0 - x) / B;
} else if (F <= 140000.0) {
tmp = fma(F, sqrt(0.5), -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.42) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 140000.0) tmp = Float64(fma(F, sqrt(0.5), Float64(-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.42], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 140000.0], N[(N[(F * N[Sqrt[0.5], $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.42:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 140000:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{0.5}, -x\right)}{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.4199999999999999Initial program 65.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.f6432.2
Applied rewrites32.2%
Taylor expanded in F around -inf
Applied rewrites41.4%
if -1.4199999999999999 < F < 1.4e5Initial 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.f6450.4
Applied rewrites50.4%
Taylor expanded in F around 0
Applied rewrites50.4%
Taylor expanded in x around 0
Applied rewrites50.4%
if 1.4e5 < F Initial program 61.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.f6427.8
Applied rewrites27.8%
Taylor expanded in F around inf
Applied rewrites43.6%
(FPCore (F B x) :precision binary64 (if (<= F -1.42) (/ (- -1.0 x) B) (if (<= F 140000.0) (/ (fma F (sqrt 0.5) (- x)) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.42) {
tmp = (-1.0 - x) / B;
} else if (F <= 140000.0) {
tmp = fma(F, sqrt(0.5), -x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 140000.0) tmp = Float64(fma(F, sqrt(0.5), Float64(-x)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.42], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 140000.0], N[(N[(F * N[Sqrt[0.5], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 140000:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{0.5}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 65.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.f6432.2
Applied rewrites32.2%
Taylor expanded in F around -inf
Applied rewrites41.4%
if -1.4199999999999999 < F < 1.4e5Initial 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.f6450.4
Applied rewrites50.4%
Taylor expanded in F around 0
Applied rewrites50.4%
Taylor expanded in x around 0
Applied rewrites50.4%
if 1.4e5 < F Initial program 61.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.f6427.8
Applied rewrites27.8%
Taylor expanded in F around inf
Applied rewrites43.5%
(FPCore (F B x)
:precision binary64
(if (<= F -2.65e-64)
(/ (- -1.0 x) B)
(if (<= F 0.00105)
(/ (* x (fma 0.3333333333333333 (* B B) -1.0)) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-64) {
tmp = (-1.0 - x) / B;
} else if (F <= 0.00105) {
tmp = (x * fma(0.3333333333333333, (B * B), -1.0)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.65e-64) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 0.00105) tmp = Float64(Float64(x * fma(0.3333333333333333, Float64(B * B), -1.0)) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.65e-64], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 0.00105], N[(N[(x * N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.65 \cdot 10^{-64}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 0.00105:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.6500000000000001e-64Initial program 68.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.f6433.9
Applied rewrites33.9%
Taylor expanded in F around -inf
Applied rewrites39.9%
if -2.6500000000000001e-64 < F < 0.00104999999999999994Initial program 99.5%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6467.7
Applied rewrites67.7%
Taylor expanded in B around 0
Applied rewrites32.9%
if 0.00104999999999999994 < 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.f6427.6
Applied rewrites27.6%
Taylor expanded in F around inf
Applied rewrites43.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.48e-77) (/ (- -1.0 x) B) (if (<= F 1.9e-16) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.48e-77) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.9e-16) {
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.48d-77)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.9d-16) 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.48e-77) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.9e-16) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.48e-77: tmp = (-1.0 - x) / B elif F <= 1.9e-16: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.48e-77) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.9e-16) 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.48e-77) tmp = (-1.0 - x) / B; elseif (F <= 1.9e-16) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.48e-77], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e-16], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.48 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-16}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.48000000000000002e-77Initial 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.f6433.9
Applied rewrites33.9%
Taylor expanded in F around -inf
Applied rewrites38.5%
if -1.48000000000000002e-77 < F < 1.90000000000000006e-16Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.1
Applied rewrites51.1%
Taylor expanded in F around 0
Applied rewrites32.8%
if 1.90000000000000006e-16 < F Initial program 62.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.f6428.1
Applied rewrites28.1%
Taylor expanded in F around inf
Applied rewrites43.2%
(FPCore (F B x) :precision binary64 (if (<= F -1.48e-77) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.48e-77) {
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.48d-77)) 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.48e-77) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.48e-77: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.48e-77) 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.48e-77) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.48e-77], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.48 \cdot 10^{-77}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.48000000000000002e-77Initial 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.f6433.9
Applied rewrites33.9%
Taylor expanded in F around -inf
Applied rewrites38.5%
if -1.48000000000000002e-77 < F Initial program 83.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6441.3
Applied rewrites41.3%
Taylor expanded in F around 0
Applied rewrites26.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 79.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.f6439.2
Applied rewrites39.2%
Taylor expanded in F around 0
Applied rewrites25.5%
(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 79.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.f6439.2
Applied rewrites39.2%
Taylor expanded in F around -inf
Applied rewrites23.3%
Taylor expanded in x around 0
Applied rewrites7.4%
herbie shell --seed 2024237
(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))))))