
(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 -8.5e+153)
(fma (/ -1.0 (* (sin B) F)) F t_0)
(if (<= F 6e+60)
(fma (/ (sqrt (/ 1.0 (fma F F 2.0))) (sin B)) F t_0)
(- (/ 1.0 (sin B)) (* (/ 1.0 (tan B)) x))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -8.5e+153) {
tmp = fma((-1.0 / (sin(B) * F)), F, t_0);
} else if (F <= 6e+60) {
tmp = fma((sqrt((1.0 / fma(F, F, 2.0))) / sin(B)), F, t_0);
} else {
tmp = (1.0 / sin(B)) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -8.5e+153) tmp = fma(Float64(-1.0 / Float64(sin(B) * F)), F, t_0); elseif (F <= 6e+60) tmp = fma(Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B)), F, t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.5e+153], N[(N[(-1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], If[LessEqual[F, 6e+60], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\sin B \cdot F}, F, t\_0\right)\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B}, F, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if F < -8.49999999999999935e153Initial program 50.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 rewrites63.4%
Taylor expanded in F around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -8.49999999999999935e153 < F < 5.9999999999999997e60Initial program 97.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
if 5.9999999999999997e60 < F Initial program 51.5%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (pow (+ (* 2.0 x) (+ (* F F) 2.0)) (/ -1.0 2.0)) (/ F (sin B)))
(* (/ 1.0 (tan B)) x)))
(t_1
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))))
(if (<= t_0 -200000000.0)
t_1
(if (<= t_0 100.0)
(/ F (* (sqrt (fma F F 2.0)) (sin B)))
(if (<= t_0 2e+305) t_1 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (pow(((2.0 * x) + ((F * F) + 2.0)), (-1.0 / 2.0)) * (F / sin(B))) - ((1.0 / tan(B)) * x);
double t_1 = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
double tmp;
if (t_0 <= -200000000.0) {
tmp = t_1;
} else if (t_0 <= 100.0) {
tmp = F / (sqrt(fma(F, F, 2.0)) * sin(B));
} else if (t_0 <= 2e+305) {
tmp = t_1;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64((Float64(Float64(2.0 * x) + Float64(Float64(F * F) + 2.0)) ^ Float64(-1.0 / 2.0)) * Float64(F / sin(B))) - Float64(Float64(1.0 / tan(B)) * x)) t_1 = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)) tmp = 0.0 if (t_0 <= -200000000.0) tmp = t_1; elseif (t_0 <= 100.0) tmp = Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))); elseif (t_0 <= 2e+305) tmp = t_1; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[Power[N[(N[(2.0 * x), $MachinePrecision] + N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -200000000.0], t$95$1, If[LessEqual[t$95$0, 100.0], N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 2e+305], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{if}\;t\_0 \leq -200000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 100:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}\\
\mathbf{elif}\;t\_0 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;t\_1\\
\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)))))) < -2e8 or 100 < (+.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.9999999999999999e305Initial program 97.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.f6496.9
Applied rewrites96.9%
if -2e8 < (+.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)))))) < 100Initial program 82.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6482.5
Applied rewrites82.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-sin.f6456.5
Applied rewrites56.5%
Applied rewrites56.5%
if 1.9999999999999999e305 < (+.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 25.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6469.0
Applied rewrites69.0%
Taylor expanded in F around inf
Applied rewrites85.7%
Final simplification80.6%
(FPCore (F B x)
:precision binary64
(if (<= F -1.1e+154)
(fma (/ -1.0 (* (sin B) F)) F (/ (- x) (tan B)))
(if (<= F 2e+152)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) (* (cos B) x)) (sin B))
(- (/ 1.0 (sin B)) (* (/ 1.0 (tan B)) x)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e+154) {
tmp = fma((-1.0 / (sin(B) * F)), F, (-x / tan(B)));
} else if (F <= 2e+152) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (cos(B) * x)) / sin(B);
} else {
tmp = (1.0 / sin(B)) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.1e+154) tmp = fma(Float64(-1.0 / Float64(sin(B) * F)), F, Float64(Float64(-x) / tan(B))); elseif (F <= 2e+152) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(cos(B) * x)) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.1e+154], N[(N[(-1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e+152], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.1 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\sin B \cdot F}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+152}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \cos B \cdot x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if F < -1.1000000000000001e154Initial program 50.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 rewrites63.4%
Taylor expanded in F around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -1.1000000000000001e154 < F < 2.0000000000000001e152Initial program 95.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 rewrites99.6%
Applied rewrites99.6%
if 2.0000000000000001e152 < F Initial program 36.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F -4.8)
(fma (/ -1.0 (* (sin B) F)) F t_0)
(if (<= F 1.45)
(fma (/ (sqrt 0.5) (sin B)) F t_0)
(- (/ 1.0 (sin B)) (* (/ 1.0 (tan B)) x))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= -4.8) {
tmp = fma((-1.0 / (sin(B) * F)), F, t_0);
} else if (F <= 1.45) {
tmp = fma((sqrt(0.5) / sin(B)), F, t_0);
} else {
tmp = (1.0 / sin(B)) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= -4.8) tmp = fma(Float64(-1.0 / Float64(sin(B) * F)), F, t_0); elseif (F <= 1.45) tmp = fma(Float64(sqrt(0.5) / sin(B)), F, t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -4.8], N[(N[(-1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], If[LessEqual[F, 1.45], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * F + t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq -4.8:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\sin B \cdot F}, F, t\_0\right)\\
\mathbf{elif}\;F \leq 1.45:\\
\;\;\;\;\mathsf{fma}\left(\frac{\sqrt{0.5}}{\sin B}, F, t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if F < -4.79999999999999982Initial program 71.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 rewrites80.4%
Taylor expanded in F around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6498.6
Applied rewrites98.6%
if -4.79999999999999982 < F < 1.44999999999999996Initial 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%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.6
Applied rewrites99.6%
Taylor expanded in F around 0
Applied rewrites99.6%
if 1.44999999999999996 < F Initial program 56.1%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(if (<= F -3300000.0)
(fma (/ -1.0 (* (sin B) F)) F (/ (- x) (tan B)))
(if (<= F 1.72e-34)
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))
(- (/ 1.0 (sin B)) (* (/ 1.0 (tan B)) x)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3300000.0) {
tmp = fma((-1.0 / (sin(B) * F)), F, (-x / tan(B)));
} else if (F <= 1.72e-34) {
tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
} else {
tmp = (1.0 / sin(B)) - ((1.0 / tan(B)) * x);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3300000.0) tmp = fma(Float64(-1.0 / Float64(sin(B) * F)), F, Float64(Float64(-x) / tan(B))); elseif (F <= 1.72e-34) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3300000.0], N[(N[(-1.0 / N[(N[Sin[B], $MachinePrecision] * F), $MachinePrecision]), $MachinePrecision] * F + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.72e-34], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3300000:\\
\;\;\;\;\mathsf{fma}\left(\frac{-1}{\sin B \cdot F}, F, \frac{-x}{\tan B}\right)\\
\mathbf{elif}\;F \leq 1.72 \cdot 10^{-34}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\end{array}
\end{array}
if F < -3.3e6Initial program 71.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
associate-/r/N/A
associate-*r*N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.8%
Taylor expanded in F around -inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
if -3.3e6 < F < 1.7200000000000001e-34Initial 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.f6482.7
Applied rewrites82.7%
if 1.7200000000000001e-34 < F Initial program 58.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6497.4
Applied rewrites97.4%
Final simplification91.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ 1.0 (tan B)) x)))
(if (<= F -3300000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.72e-34)
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (1.0 / tan(B)) * x;
double tmp;
if (F <= -3300000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.72e-34) {
tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(1.0 / tan(B)) * x) tmp = 0.0 if (F <= -3300000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.72e-34) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[F, -3300000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.72e-34], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\tan B} \cdot x\\
\mathbf{if}\;F \leq -3300000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.72 \cdot 10^{-34}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.3e6Initial program 71.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -3.3e6 < F < 1.7200000000000001e-34Initial 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.f6482.7
Applied rewrites82.7%
if 1.7200000000000001e-34 < F Initial program 58.3%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6497.4
Applied rewrites97.4%
Final simplification91.6%
(FPCore (F B x)
:precision binary64
(if (<= F -3300000.0)
(- (/ -1.0 (sin B)) (* (/ 1.0 (tan B)) x))
(if (<= F 7.5e+118)
(+
(* (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) (/ F B))
(* (/ -1.0 (tan B)) x))
(if (<= F 6e+242) (/ 1.0 (sin B)) (/ (* (- (cos B)) x) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3300000.0) {
tmp = (-1.0 / sin(B)) - ((1.0 / tan(B)) * x);
} else if (F <= 7.5e+118) {
tmp = (sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))) * (F / B)) + ((-1.0 / tan(B)) * x);
} else if (F <= 6e+242) {
tmp = 1.0 / sin(B);
} else {
tmp = (-cos(B) * x) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3300000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 7.5e+118) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) * Float64(F / B)) + Float64(Float64(-1.0 / tan(B)) * x)); elseif (F <= 6e+242) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(Float64(-cos(B)) * x) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3300000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.5e+118], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e+242], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[((-N[Cos[B], $MachinePrecision]) * x), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3300000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 7.5 \cdot 10^{+118}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} \cdot \frac{F}{B} + \frac{-1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 6 \cdot 10^{+242}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-\cos B\right) \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -3.3e6Initial program 71.1%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.6
Applied rewrites99.6%
if -3.3e6 < F < 7.50000000000000003e118Initial program 97.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.f6480.5
Applied rewrites80.5%
if 7.50000000000000003e118 < F < 6.0000000000000001e242Initial program 49.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.7
Applied rewrites49.8%
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.f6421.6
Applied rewrites21.6%
Taylor expanded in F around inf
Applied rewrites68.7%
if 6.0000000000000001e242 < F Initial program 32.3%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6469.2
Applied rewrites69.2%
Applied rewrites69.3%
Final simplification83.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= x -3.6e-27)
t_0
(if (<= x 6.2e-86) (/ F (* (sqrt (fma F F 2.0)) (sin B))) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (x <= -3.6e-27) {
tmp = t_0;
} else if (x <= 6.2e-86) {
tmp = F / (sqrt(fma(F, F, 2.0)) * sin(B));
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (x <= -3.6e-27) tmp = t_0; elseif (x <= 6.2e-86) tmp = Float64(F / Float64(sqrt(fma(F, F, 2.0)) * sin(B))); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.6e-27], t$95$0, If[LessEqual[x, 6.2e-86], N[(F / N[(N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;x \leq -3.6 \cdot 10^{-27}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{-86}:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)} \cdot \sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.5999999999999999e-27 or 6.19999999999999977e-86 < x Initial program 84.7%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6492.4
Applied rewrites92.4%
Applied rewrites92.6%
if -3.5999999999999999e-27 < x < 6.19999999999999977e-86Initial program 72.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6472.9
Applied rewrites72.9%
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.f6458.4
Applied rewrites58.4%
Applied rewrites63.5%
Final simplification79.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+180)
(/ (- -1.0 x) B)
(if (<= F -7000000.0)
(/ -1.0 (sin B))
(if (<= F 4.7e+117)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(if (<= F 1.75e+243)
(/ 1.0 (sin B))
(+ (/ (- 1.0 x) B) (/ (- -1.0 x) (* (* F F) B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+180) {
tmp = (-1.0 - x) / B;
} else if (F <= -7000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 4.7e+117) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else if (F <= 1.75e+243) {
tmp = 1.0 / sin(B);
} else {
tmp = ((1.0 - x) / B) + ((-1.0 - x) / ((F * F) * B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+180) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -7000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 4.7e+117) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); elseif (F <= 1.75e+243) tmp = Float64(1.0 / sin(B)); else tmp = Float64(Float64(Float64(1.0 - x) / B) + Float64(Float64(-1.0 - x) / Float64(Float64(F * F) * B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+180], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -7000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.7e+117], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.75e+243], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / N[(N[(F * F), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+180}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -7000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 4.7 \cdot 10^{+117}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{elif}\;F \leq 1.75 \cdot 10^{+243}:\\
\;\;\;\;\frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B} + \frac{-1 - x}{\left(F \cdot F\right) \cdot B}\\
\end{array}
\end{array}
if F < -1.35000000000000008e180Initial program 54.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6425.4
Applied rewrites25.4%
Taylor expanded in F around -inf
Applied rewrites47.2%
if -1.35000000000000008e180 < F < -7e6Initial program 80.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.8
Applied rewrites80.8%
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.f6449.0
Applied rewrites49.0%
Taylor expanded in F around -inf
Applied rewrites61.0%
if -7e6 < F < 4.70000000000000006e117Initial program 97.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%
Applied rewrites50.7%
if 4.70000000000000006e117 < F < 1.74999999999999994e243Initial program 49.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6449.7
Applied rewrites49.8%
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.f6421.6
Applied rewrites21.6%
Taylor expanded in F around inf
Applied rewrites68.7%
if 1.74999999999999994e243 < F Initial program 32.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.f6438.6
Applied rewrites38.6%
Taylor expanded in F around 0
Applied rewrites38.6%
Taylor expanded in F around inf
Applied rewrites60.3%
Final simplification55.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.35e+180)
(/ (- -1.0 x) B)
(if (<= F -7000000.0)
(/ -1.0 (sin B))
(if (<= F 8.8e-32)
(/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
(/ (- (/ (- -1.0 x) (* F F)) (+ x -1.0)) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.35e+180) {
tmp = (-1.0 - x) / B;
} else if (F <= -7000000.0) {
tmp = -1.0 / sin(B);
} else if (F <= 8.8e-32) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = (((-1.0 - x) / (F * F)) - (x + -1.0)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.35e+180) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -7000000.0) tmp = Float64(-1.0 / sin(B)); elseif (F <= 8.8e-32) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(Float64(-1.0 - x) / Float64(F * F)) - Float64(x + -1.0)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.35e+180], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -7000000.0], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.8e-32], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-1.0 - x), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.35 \cdot 10^{+180}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -7000000:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1 - x}{F \cdot F} - \left(x + -1\right)}{B}\\
\end{array}
\end{array}
if F < -1.35000000000000008e180Initial program 54.0%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6425.4
Applied rewrites25.4%
Taylor expanded in F around -inf
Applied rewrites47.2%
if -1.35000000000000008e180 < F < -7e6Initial program 80.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.8
Applied rewrites80.8%
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.f6449.0
Applied rewrites49.0%
Taylor expanded in F around -inf
Applied rewrites61.0%
if -7e6 < F < 8.7999999999999999e-32Initial 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.f6448.7
Applied rewrites48.7%
if 8.7999999999999999e-32 < F Initial program 57.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in F around 0
Applied rewrites23.8%
Taylor expanded in F around inf
Applied rewrites54.5%
Final simplification52.4%
(FPCore (F B x)
:precision binary64
(if (<= B 0.015)
(/
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* B B) (* 0.16666666666666666 F) F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.015) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma((B * B), (0.16666666666666666 * F), F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else {
tmp = -x / tan(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.015) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(Float64(B * B), Float64(0.16666666666666666 * F), F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.015], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.015:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 0.014999999999999999Initial program 76.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites55.1%
if 0.014999999999999999 < B Initial program 87.9%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6462.9
Applied rewrites62.9%
Applied rewrites63.1%
(FPCore (F B x)
:precision binary64
(if (<= F -3200000.0)
(/ (- (/ (- x -1.0) (* F F)) (- x -1.0)) B)
(if (<= F 8.8e-32)
(/ (fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)) B)
(/ (- (/ (- -1.0 x) (* F F)) (+ x -1.0)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3200000.0) {
tmp = (((x - -1.0) / (F * F)) - (x - -1.0)) / B;
} else if (F <= 8.8e-32) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x) / B;
} else {
tmp = (((-1.0 - x) / (F * F)) - (x + -1.0)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3200000.0) tmp = Float64(Float64(Float64(Float64(x - -1.0) / Float64(F * F)) - Float64(x - -1.0)) / B); elseif (F <= 8.8e-32) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(Float64(-1.0 - x) / Float64(F * F)) - Float64(x + -1.0)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3200000.0], N[(N[(N[(N[(x - -1.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-32], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-1.0 - x), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3200000:\\
\;\;\;\;\frac{\frac{x - -1}{F \cdot F} - \left(x - -1\right)}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1 - x}{F \cdot F} - \left(x + -1\right)}{B}\\
\end{array}
\end{array}
if F < -3.2e6Initial program 71.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.f6432.4
Applied rewrites32.4%
Taylor expanded in F around 0
Applied rewrites20.2%
Taylor expanded in F around -inf
Applied rewrites44.5%
if -3.2e6 < F < 8.7999999999999999e-32Initial 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.f6448.3
Applied rewrites48.3%
if 8.7999999999999999e-32 < F Initial program 57.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in F around 0
Applied rewrites23.8%
Taylor expanded in F around inf
Applied rewrites54.5%
Final simplification49.2%
(FPCore (F B x)
:precision binary64
(if (<= F -3200000.0)
(/ (- (/ (- x -1.0) (* F F)) (- x -1.0)) B)
(if (<= F 8.8e-32)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(/ (- (/ (- -1.0 x) (* F F)) (+ x -1.0)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3200000.0) {
tmp = (((x - -1.0) / (F * F)) - (x - -1.0)) / B;
} else if (F <= 8.8e-32) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (((-1.0 - x) / (F * F)) - (x + -1.0)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3200000.0) tmp = Float64(Float64(Float64(Float64(x - -1.0) / Float64(F * F)) - Float64(x - -1.0)) / B); elseif (F <= 8.8e-32) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(Float64(Float64(-1.0 - x) / Float64(F * F)) - Float64(x + -1.0)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3200000.0], N[(N[(N[(N[(x - -1.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-32], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-1.0 - x), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3200000:\\
\;\;\;\;\frac{\frac{x - -1}{F \cdot F} - \left(x - -1\right)}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1 - x}{F \cdot F} - \left(x + -1\right)}{B}\\
\end{array}
\end{array}
if F < -3.2e6Initial program 71.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.f6432.4
Applied rewrites32.4%
Taylor expanded in F around 0
Applied rewrites20.2%
Taylor expanded in F around -inf
Applied rewrites44.5%
if -3.2e6 < F < 8.7999999999999999e-32Initial 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.f6448.3
Applied rewrites48.3%
Applied rewrites48.3%
if 8.7999999999999999e-32 < F Initial program 57.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in F around 0
Applied rewrites23.8%
Taylor expanded in F around inf
Applied rewrites54.5%
Final simplification49.2%
(FPCore (F B x)
:precision binary64
(if (<= F -5.1)
(/ (- (/ (- x -1.0) (* F F)) (- x -1.0)) B)
(if (<= F 8.8e-32)
(/ (fma (sqrt 0.5) F (- x)) B)
(/ (- (/ (- -1.0 x) (* F F)) (+ x -1.0)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.1) {
tmp = (((x - -1.0) / (F * F)) - (x - -1.0)) / B;
} else if (F <= 8.8e-32) {
tmp = fma(sqrt(0.5), F, -x) / B;
} else {
tmp = (((-1.0 - x) / (F * F)) - (x + -1.0)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.1) tmp = Float64(Float64(Float64(Float64(x - -1.0) / Float64(F * F)) - Float64(x - -1.0)) / B); elseif (F <= 8.8e-32) tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(Float64(-1.0 - x) / Float64(F * F)) - Float64(x + -1.0)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.1], N[(N[(N[(N[(x - -1.0), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x - -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-32], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-1.0 - x), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.1:\\
\;\;\;\;\frac{\frac{x - -1}{F \cdot F} - \left(x - -1\right)}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1 - x}{F \cdot F} - \left(x + -1\right)}{B}\\
\end{array}
\end{array}
if F < -5.0999999999999996Initial program 71.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.f6433.4
Applied rewrites33.4%
Taylor expanded in F around 0
Applied rewrites20.0%
Taylor expanded in F around -inf
Applied rewrites44.8%
if -5.0999999999999996 < F < 8.7999999999999999e-32Initial 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.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites47.8%
Taylor expanded in x around 0
Applied rewrites47.8%
if 8.7999999999999999e-32 < F Initial program 57.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in F around 0
Applied rewrites23.8%
Taylor expanded in F around inf
Applied rewrites54.5%
Final simplification49.1%
(FPCore (F B x)
:precision binary64
(if (<= F -4.8)
(/ (- -1.0 x) B)
(if (<= F 8.8e-32)
(/ (fma (sqrt 0.5) F (- x)) B)
(/ (- (/ (- -1.0 x) (* F F)) (+ x -1.0)) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.8) {
tmp = (-1.0 - x) / B;
} else if (F <= 8.8e-32) {
tmp = fma(sqrt(0.5), F, -x) / B;
} else {
tmp = (((-1.0 - x) / (F * F)) - (x + -1.0)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.8) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 8.8e-32) tmp = Float64(fma(sqrt(0.5), F, Float64(-x)) / B); else tmp = Float64(Float64(Float64(Float64(-1.0 - x) / Float64(F * F)) - Float64(x + -1.0)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.8], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 8.8e-32], N[(N[(N[Sqrt[0.5], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(-1.0 - x), $MachinePrecision] / N[(F * F), $MachinePrecision]), $MachinePrecision] - N[(x + -1.0), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.8:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 8.8 \cdot 10^{-32}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{-1 - x}{F \cdot F} - \left(x + -1\right)}{B}\\
\end{array}
\end{array}
if F < -4.79999999999999982Initial program 71.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.f6433.4
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites44.3%
if -4.79999999999999982 < F < 8.7999999999999999e-32Initial 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.f6447.8
Applied rewrites47.8%
Taylor expanded in F around 0
Applied rewrites47.8%
Taylor expanded in x around 0
Applied rewrites47.8%
if 8.7999999999999999e-32 < F Initial program 57.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6439.8
Applied rewrites39.8%
Taylor expanded in F around 0
Applied rewrites23.8%
Taylor expanded in F around inf
Applied rewrites54.5%
Final simplification48.9%
(FPCore (F B x) :precision binary64 (if (<= F -4.8) (/ (- -1.0 x) B) (if (<= F 1.72e-34) (/ (fma (sqrt 0.5) F (- x)) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.8) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.72e-34) {
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 <= -4.8) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.72e-34) 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, -4.8], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.72e-34], 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 -4.8:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.72 \cdot 10^{-34}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{0.5}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.79999999999999982Initial program 71.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.f6433.4
Applied rewrites33.4%
Taylor expanded in F around -inf
Applied rewrites44.3%
if -4.79999999999999982 < F < 1.7200000000000001e-34Initial 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.f6448.2
Applied rewrites48.2%
Taylor expanded in F around 0
Applied rewrites48.2%
Taylor expanded in x around 0
Applied rewrites48.2%
if 1.7200000000000001e-34 < F Initial program 58.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.f6439.4
Applied rewrites39.4%
Taylor expanded in F around inf
Applied rewrites53.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.5e-52)
(/ (- -1.0 x) B)
(if (<= F 1.65e-46)
(/ (* (fma 0.3333333333333333 (* B B) -1.0) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.65e-46) {
tmp = (fma(0.3333333333333333, (B * B), -1.0) * x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-52) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.65e-46) tmp = Float64(Float64(fma(0.3333333333333333, Float64(B * B), -1.0) * x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.65e-46], N[(N[(N[(0.3333333333333333 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] * x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{-46}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.3333333333333333, B \cdot B, -1\right) \cdot x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.5e-52Initial program 75.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6435.8
Applied rewrites35.8%
Taylor expanded in F around -inf
Applied rewrites43.0%
if -1.5e-52 < F < 1.65000000000000007e-46Initial program 99.5%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6468.8
Applied rewrites68.8%
Taylor expanded in B around 0
Applied rewrites33.2%
if 1.65000000000000007e-46 < F Initial program 58.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.f6440.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites53.3%
Final simplification42.5%
(FPCore (F B x) :precision binary64 (if (<= F -4.3e-100) (/ (- -1.0 x) B) (if (<= F 1.08e-48) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.3e-100) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.08e-48) {
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 <= (-4.3d-100)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.08d-48) 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 <= -4.3e-100) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.08e-48) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.3e-100: tmp = (-1.0 - x) / B elif F <= 1.08e-48: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.3e-100) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.08e-48) 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 <= -4.3e-100) tmp = (-1.0 - x) / B; elseif (F <= 1.08e-48) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.3e-100], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.08e-48], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-100}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.08 \cdot 10^{-48}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.29999999999999998e-100Initial program 78.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6435.7
Applied rewrites35.7%
Taylor expanded in F around -inf
Applied rewrites39.8%
if -4.29999999999999998e-100 < F < 1.08e-48Initial 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.f6449.0
Applied rewrites49.0%
Taylor expanded in F around 0
Applied rewrites34.7%
if 1.08e-48 < F Initial program 58.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.f6440.1
Applied rewrites40.1%
Taylor expanded in F around inf
Applied rewrites53.3%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (- x) B))) (if (<= x -1.04e-209) t_0 (if (<= x 1.4e-65) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.04e-209) {
tmp = t_0;
} else if (x <= 1.4e-65) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -x / b
if (x <= (-1.04d-209)) then
tmp = t_0
else if (x <= 1.4d-65) then
tmp = (-1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.04e-209) {
tmp = t_0;
} else if (x <= 1.4e-65) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if x <= -1.04e-209: tmp = t_0 elif x <= 1.4e-65: tmp = -1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (x <= -1.04e-209) tmp = t_0; elseif (x <= 1.4e-65) tmp = Float64(-1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / B; tmp = 0.0; if (x <= -1.04e-209) tmp = t_0; elseif (x <= 1.4e-65) tmp = -1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[x, -1.04e-209], t$95$0, If[LessEqual[x, 1.4e-65], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -1.04 \cdot 10^{-209}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-65}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.0399999999999999e-209 or 1.4e-65 < x Initial program 80.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6443.8
Applied rewrites43.8%
Taylor expanded in F around 0
Applied rewrites36.4%
if -1.0399999999999999e-209 < x < 1.4e-65Initial program 76.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.f6436.6
Applied rewrites36.6%
Taylor expanded in F around -inf
Applied rewrites17.6%
Taylor expanded in x around 0
Applied rewrites17.6%
(FPCore (F B x) :precision binary64 (if (<= F -4.3e-100) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.3e-100) {
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 <= (-4.3d-100)) 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 <= -4.3e-100) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.3e-100: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.3e-100) 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 <= -4.3e-100) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.3e-100], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.3 \cdot 10^{-100}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -4.29999999999999998e-100Initial program 78.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6435.7
Applied rewrites35.7%
Taylor expanded in F around -inf
Applied rewrites39.8%
if -4.29999999999999998e-100 < F Initial program 79.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6444.7
Applied rewrites44.7%
Taylor expanded in F around 0
Applied rewrites29.1%
(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.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.f6441.5
Applied rewrites41.5%
Taylor expanded in F around -inf
Applied rewrites29.5%
Taylor expanded in x around 0
Applied rewrites9.5%
herbie shell --seed 2024272
(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))))))