
(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 -6.1e+26)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1000000000000.0)
(- (/ F (* (sqrt (fma 2.0 x (fma F F 2.0))) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -6.1e+26) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1000000000000.0) {
tmp = (F / (sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -6.1e+26) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1000000000000.0) tmp = Float64(Float64(F / Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) * sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -6.1e+26], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1000000000000.0], N[(N[(F / N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -6.1 \cdot 10^{+26}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1000000000000:\\
\;\;\;\;\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)} \cdot \sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.1000000000000003e26Initial program 46.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites65.0%
Applied rewrites65.1%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -6.1000000000000003e26 < F < 1e12Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.6%
Applied rewrites99.6%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
if 1e12 < F Initial program 61.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites84.0%
Applied rewrites84.1%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ 1.0 (tan B)) x))
(t_1
(-
(* (pow (+ (* 2.0 x) (+ (* F F) 2.0)) (/ -1.0 2.0)) (/ F (sin B)))
t_0))
(t_2
(-
(/
1.0
(*
(*
(fma -0.16666666666666666 (/ (* B B) F) (/ 1.0 F))
(sqrt (+ (fma 2.0 x (* F F)) 2.0)))
B))
t_0)))
(if (<= t_1 -2e+39)
t_2
(if (<= t_1 20.0)
(- (/ 1.0 (* (/ (sqrt (fma 2.0 x (fma F F 2.0))) F) (sin B))) (/ x B))
(if (<= t_1 INFINITY) t_2 (/ (- -1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (1.0 / tan(B)) * x;
double t_1 = (pow(((2.0 * x) + ((F * F) + 2.0)), (-1.0 / 2.0)) * (F / sin(B))) - t_0;
double t_2 = (1.0 / ((fma(-0.16666666666666666, ((B * B) / F), (1.0 / F)) * sqrt((fma(2.0, x, (F * F)) + 2.0))) * B)) - t_0;
double tmp;
if (t_1 <= -2e+39) {
tmp = t_2;
} else if (t_1 <= 20.0) {
tmp = (1.0 / ((sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - (x / B);
} else if (t_1 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (-1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(1.0 / tan(B)) * x) t_1 = Float64(Float64((Float64(Float64(2.0 * x) + Float64(Float64(F * F) + 2.0)) ^ Float64(-1.0 / 2.0)) * Float64(F / sin(B))) - t_0) t_2 = Float64(Float64(1.0 / Float64(Float64(fma(-0.16666666666666666, Float64(Float64(B * B) / F), Float64(1.0 / F)) * sqrt(Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * B)) - t_0) tmp = 0.0 if (t_1 <= -2e+39) tmp = t_2; elseif (t_1 <= 20.0) tmp = Float64(Float64(1.0 / Float64(Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - Float64(x / B)); elseif (t_1 <= Inf) tmp = t_2; else tmp = Float64(Float64(-1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = 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] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1.0 / N[(N[(N[(-0.16666666666666666 * N[(N[(B * B), $MachinePrecision] / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+39], t$95$2, If[LessEqual[t$95$1, 20.0], N[(N[(1.0 / N[(N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], t$95$2, N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\tan B} \cdot x\\
t_1 := {\left(2 \cdot x + \left(F \cdot F + 2\right)\right)}^{\left(\frac{-1}{2}\right)} \cdot \frac{F}{\sin B} - t\_0\\
t_2 := \frac{1}{\left(\mathsf{fma}\left(-0.16666666666666666, \frac{B \cdot B}{F}, \frac{1}{F}\right) \cdot \sqrt{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}\right) \cdot B} - t\_0\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+39}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 20:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \frac{x}{B}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;t\_2\\
\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)))))) < -1.99999999999999988e39 or 20 < (+.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)))))) < +inf.0Initial program 94.6%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6496.1
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6496.1
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6496.1
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval96.1
Applied rewrites96.1%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites99.1%
if -1.99999999999999988e39 < (+.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)))))) < 20Initial program 78.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites78.1%
Applied rewrites78.2%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6478.2
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6478.2
Applied rewrites78.2%
Taylor expanded in B around 0
lower-/.f6455.8
Applied rewrites55.8%
if +inf.0 < (+.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 0.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.f6458.4
Applied rewrites58.4%
Taylor expanded in F around -inf
Applied rewrites82.5%
Final simplification81.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -14000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* (sqrt 0.5) (/ F (sin B))) (* (/ 1.0 (tan B)) x))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -14000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (sqrt(0.5) * (F / sin(B))) - ((1.0 / tan(B)) * x);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-14000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (sqrt(0.5d0) * (f / sin(b))) - ((1.0d0 / tan(b)) * x)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -14000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (Math.sqrt(0.5) * (F / Math.sin(B))) - ((1.0 / Math.tan(B)) * x);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -14000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (math.sqrt(0.5) * (F / math.sin(B))) - ((1.0 / math.tan(B)) * x) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -14000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(sqrt(0.5) * Float64(F / sin(B))) - Float64(Float64(1.0 / tan(B)) * x)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -14000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (sqrt(0.5) * (F / sin(B))) - ((1.0 / tan(B)) * x); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -14000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[Sqrt[0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 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{x}{\tan B}\\
\mathbf{if}\;F \leq -14000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\sqrt{0.5} \cdot \frac{F}{\sin B} - \frac{1}{\tan B} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -14000Initial program 49.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites67.4%
Applied rewrites67.4%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -14000 < F < 1.3999999999999999Initial program 99.5%
Taylor expanded in x around 0
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.1
Applied rewrites99.1%
Taylor expanded in F around 0
Applied rewrites97.8%
if 1.3999999999999999 < F Initial program 61.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites84.0%
Applied rewrites84.1%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.46)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 4.1e-226)
(-
(/
1.0
(*
(*
(fma -0.16666666666666666 (/ (* B B) F) (/ 1.0 F))
(sqrt (+ (fma 2.0 x (* F F)) 2.0)))
B))
(* (/ 1.0 (tan B)) x))
(if (<= F 44000.0)
(- (/ 1.0 (* (/ (sqrt (fma 2.0 x (fma F F 2.0))) F) (sin B))) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.46) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 4.1e-226) {
tmp = (1.0 / ((fma(-0.16666666666666666, ((B * B) / F), (1.0 / F)) * sqrt((fma(2.0, x, (F * F)) + 2.0))) * B)) - ((1.0 / tan(B)) * x);
} else if (F <= 44000.0) {
tmp = (1.0 / ((sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.46) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 4.1e-226) tmp = Float64(Float64(1.0 / Float64(Float64(fma(-0.16666666666666666, Float64(Float64(B * B) / F), Float64(1.0 / F)) * sqrt(Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * B)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 44000.0) tmp = Float64(Float64(1.0 / Float64(Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.46], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4.1e-226], N[(N[(1.0 / N[(N[(N[(-0.16666666666666666 * N[(N[(B * B), $MachinePrecision] / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 44000.0], N[(N[(1.0 / N[(N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.46:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 4.1 \cdot 10^{-226}:\\
\;\;\;\;\frac{1}{\left(\mathsf{fma}\left(-0.16666666666666666, \frac{B \cdot B}{F}, \frac{1}{F}\right) \cdot \sqrt{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}\right) \cdot B} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 44000:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.46000000000000002Initial program 50.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites68.3%
Applied rewrites68.3%
Taylor expanded in F around -inf
Applied rewrites98.7%
if -0.46000000000000002 < F < 4.10000000000000037e-226Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6499.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.6
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6499.6
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval99.6
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.8%
if 4.10000000000000037e-226 < F < 44000Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.4%
Applied rewrites99.2%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6499.5
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f6476.9
Applied rewrites76.9%
if 44000 < F Initial program 61.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites84.0%
Applied rewrites84.1%
Taylor expanded in F around inf
Applied rewrites99.8%
Final simplification93.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.46)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 4.1e-226)
(-
(/
1.0
(*
(*
(fma -0.16666666666666666 (/ (* B B) F) (/ 1.0 F))
(sqrt (+ (fma 2.0 x (* F F)) 2.0)))
B))
(* (/ 1.0 (tan B)) x))
(if (<= F 3.9e+51)
(- (/ 1.0 (* (/ (sqrt (fma 2.0 x (fma F F 2.0))) F) (sin B))) (/ x B))
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.46) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 4.1e-226) {
tmp = (1.0 / ((fma(-0.16666666666666666, ((B * B) / F), (1.0 / F)) * sqrt((fma(2.0, x, (F * F)) + 2.0))) * B)) - ((1.0 / tan(B)) * x);
} else if (F <= 3.9e+51) {
tmp = (1.0 / ((sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - (x / B);
} else {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.46) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 4.1e-226) tmp = Float64(Float64(1.0 / Float64(Float64(fma(-0.16666666666666666, Float64(Float64(B * B) / F), Float64(1.0 / F)) * sqrt(Float64(fma(2.0, x, Float64(F * F)) + 2.0))) * B)) - Float64(Float64(1.0 / tan(B)) * x)); elseif (F <= 3.9e+51) tmp = Float64(Float64(1.0 / Float64(Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.46], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4.1e-226], N[(N[(1.0 / N[(N[(N[(-0.16666666666666666 * N[(N[(B * B), $MachinePrecision] / F), $MachinePrecision] + N[(1.0 / F), $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(N[(2.0 * x + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.9e+51], N[(N[(1.0 / N[(N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.46:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 4.1 \cdot 10^{-226}:\\
\;\;\;\;\frac{1}{\left(\mathsf{fma}\left(-0.16666666666666666, \frac{B \cdot B}{F}, \frac{1}{F}\right) \cdot \sqrt{\mathsf{fma}\left(2, x, F \cdot F\right) + 2}\right) \cdot B} - \frac{1}{\tan B} \cdot x\\
\mathbf{elif}\;F \leq 3.9 \cdot 10^{+51}:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - t\_0\\
\end{array}
\end{array}
if F < -0.46000000000000002Initial program 50.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites68.3%
Applied rewrites68.3%
Taylor expanded in F around -inf
Applied rewrites98.7%
if -0.46000000000000002 < F < 4.10000000000000037e-226Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
clear-numN/A
un-div-invN/A
clear-numN/A
lower-/.f64N/A
lower-/.f64N/A
lower-/.f6499.6
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.6
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6499.6
lift-neg.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-eval99.6
Applied rewrites99.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.8%
if 4.10000000000000037e-226 < F < 3.89999999999999984e51Initial program 99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites99.4%
Applied rewrites99.3%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6499.5
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
Taylor expanded in B around 0
lower-/.f6481.5
Applied rewrites81.5%
if 3.89999999999999984e51 < F Initial program 54.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites81.0%
Applied rewrites81.0%
Taylor expanded in F around inf
Applied rewrites99.8%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6483.3
Applied rewrites83.3%
Final simplification90.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma -1.0 (/ -1.0 B) (/ (- x) (tan B)))))
(if (<= x -1.25e-33)
t_0
(if (<= x 0.77)
(- (/ 1.0 (* (/ (sqrt (fma 2.0 x (fma F F 2.0))) F) (sin B))) (/ x B))
t_0))))
double code(double F, double B, double x) {
double t_0 = fma(-1.0, (-1.0 / B), (-x / tan(B)));
double tmp;
if (x <= -1.25e-33) {
tmp = t_0;
} else if (x <= 0.77) {
tmp = (1.0 / ((sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))) tmp = 0.0 if (x <= -1.25e-33) tmp = t_0; elseif (x <= 0.77) tmp = Float64(Float64(1.0 / Float64(Float64(sqrt(fma(2.0, x, fma(F, F, 2.0))) / F) * sin(B))) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e-33], t$95$0, If[LessEqual[x, 0.77], N[(N[(1.0 / N[(N[(N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision] * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{-33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.77:\\
\;\;\;\;\frac{1}{\frac{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}{F} \cdot \sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.25000000000000007e-33 or 0.77000000000000002 < x Initial program 78.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites96.6%
Taylor expanded in F around inf
Applied rewrites92.5%
Taylor expanded in B around 0
lower-/.f6494.8
Applied rewrites94.8%
if -1.25000000000000007e-33 < x < 0.77000000000000002Initial program 73.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites77.9%
Applied rewrites78.0%
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
clear-numN/A
frac-timesN/A
metadata-evalN/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6478.0
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6478.0
Applied rewrites78.0%
Taylor expanded in B around 0
lower-/.f6467.3
Applied rewrites67.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (fma -1.0 (/ -1.0 B) (/ (- x) (tan B)))))
(if (<= x -1.25e-33)
t_0
(if (<= x 0.77)
(- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))
t_0))))
double code(double F, double B, double x) {
double t_0 = fma(-1.0, (-1.0 / B), (-x / tan(B)));
double tmp;
if (x <= -1.25e-33) {
tmp = t_0;
} else if (x <= 0.77) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))) tmp = 0.0 if (x <= -1.25e-33) tmp = t_0; elseif (x <= 0.77) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e-33], t$95$0, If[LessEqual[x, 0.77], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{-33}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 0.77:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.25000000000000007e-33 or 0.77000000000000002 < x Initial program 78.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites96.6%
Taylor expanded in F around inf
Applied rewrites92.5%
Taylor expanded in B around 0
lower-/.f6494.8
Applied rewrites94.8%
if -1.25000000000000007e-33 < x < 0.77000000000000002Initial program 73.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites77.9%
Applied rewrites78.0%
Taylor expanded in B around 0
lower-/.f6467.3
Applied rewrites67.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))))
(if (<= B 0.4)
(/
(fma
(fma
t_0
(* (- F) (fma -0.019444444444444445 (* B B) -0.16666666666666666))
(* (fma 0.022222222222222223 (* B B) 0.3333333333333333) x))
(* B B)
(fma t_0 F (- x)))
B)
(-
(/
1.0
(*
(fma
(fma 0.008333333333333333 (* B B) -0.16666666666666666)
(* B B)
1.0)
B))
(/ x (tan B))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))));
double tmp;
if (B <= 0.4) {
tmp = fma(fma(t_0, (-F * fma(-0.019444444444444445, (B * B), -0.16666666666666666)), (fma(0.022222222222222223, (B * B), 0.3333333333333333) * x)), (B * B), fma(t_0, F, -x)) / B;
} else {
tmp = (1.0 / (fma(fma(0.008333333333333333, (B * B), -0.16666666666666666), (B * B), 1.0) * B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) tmp = 0.0 if (B <= 0.4) tmp = Float64(fma(fma(t_0, Float64(Float64(-F) * fma(-0.019444444444444445, Float64(B * B), -0.16666666666666666)), Float64(fma(0.022222222222222223, Float64(B * B), 0.3333333333333333) * x)), Float64(B * B), fma(t_0, F, Float64(-x))) / B); else tmp = Float64(Float64(1.0 / Float64(fma(fma(0.008333333333333333, Float64(B * B), -0.16666666666666666), Float64(B * B), 1.0) * B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.4], N[(N[(N[(t$95$0 * N[((-F) * N[(-0.019444444444444445 * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(N[(N[(0.008333333333333333 * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.4:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_0, \left(-F\right) \cdot \mathsf{fma}\left(-0.019444444444444445, B \cdot B, -0.16666666666666666\right), \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right) \cdot x\right), B \cdot B, \mathsf{fma}\left(t\_0, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(0.008333333333333333, B \cdot B, -0.16666666666666666\right), B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.40000000000000002Initial program 74.8%
Taylor expanded in B around 0
Applied rewrites58.1%
if 0.40000000000000002 < B Initial program 80.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.9%
Applied rewrites79.9%
Taylor expanded in F around inf
Applied rewrites46.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
unpow2N/A
lower-*.f6449.6
Applied rewrites49.6%
Final simplification56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))))
(if (<= B 0.4)
(/
(fma
(fma
t_0
(* (- F) (fma -0.019444444444444445 (* B B) -0.16666666666666666))
(* (fma 0.022222222222222223 (* B B) 0.3333333333333333) x))
(* B B)
(fma t_0 F (- x)))
B)
(- (/ 1.0 (* (fma -0.16666666666666666 (* B B) 1.0) B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))));
double tmp;
if (B <= 0.4) {
tmp = fma(fma(t_0, (-F * fma(-0.019444444444444445, (B * B), -0.16666666666666666)), (fma(0.022222222222222223, (B * B), 0.3333333333333333) * x)), (B * B), fma(t_0, F, -x)) / B;
} else {
tmp = (1.0 / (fma(-0.16666666666666666, (B * B), 1.0) * B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) tmp = 0.0 if (B <= 0.4) tmp = Float64(fma(fma(t_0, Float64(Float64(-F) * fma(-0.019444444444444445, Float64(B * B), -0.16666666666666666)), Float64(fma(0.022222222222222223, Float64(B * B), 0.3333333333333333) * x)), Float64(B * B), fma(t_0, F, Float64(-x))) / B); else tmp = Float64(Float64(1.0 / Float64(fma(-0.16666666666666666, Float64(B * B), 1.0) * B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.4], N[(N[(N[(t$95$0 * N[((-F) * N[(-0.019444444444444445 * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.4:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_0, \left(-F\right) \cdot \mathsf{fma}\left(-0.019444444444444445, B \cdot B, -0.16666666666666666\right), \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right) \cdot x\right), B \cdot B, \mathsf{fma}\left(t\_0, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, 1\right) \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.40000000000000002Initial program 74.8%
Taylor expanded in B around 0
Applied rewrites58.1%
if 0.40000000000000002 < B Initial program 80.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.9%
Applied rewrites79.9%
Taylor expanded in F around inf
Applied rewrites46.6%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f6449.4
Applied rewrites49.4%
Final simplification56.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))))
(if (<= B 0.4)
(/
(fma
(fma
t_0
(* (- F) (fma -0.019444444444444445 (* B B) -0.16666666666666666))
(* (fma 0.022222222222222223 (* B B) 0.3333333333333333) x))
(* B B)
(fma t_0 F (- x)))
B)
(fma -1.0 (/ -1.0 B) (/ (- x) (tan B))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))));
double tmp;
if (B <= 0.4) {
tmp = fma(fma(t_0, (-F * fma(-0.019444444444444445, (B * B), -0.16666666666666666)), (fma(0.022222222222222223, (B * B), 0.3333333333333333) * x)), (B * B), fma(t_0, F, -x)) / B;
} else {
tmp = fma(-1.0, (-1.0 / B), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))) tmp = 0.0 if (B <= 0.4) tmp = Float64(fma(fma(t_0, Float64(Float64(-F) * fma(-0.019444444444444445, Float64(B * B), -0.16666666666666666)), Float64(fma(0.022222222222222223, Float64(B * B), 0.3333333333333333) * x)), Float64(B * B), fma(t_0, F, Float64(-x))) / B); else tmp = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.4], N[(N[(N[(t$95$0 * N[((-F) * N[(-0.019444444444444445 * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + N[(N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}\\
\mathbf{if}\;B \leq 0.4:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_0, \left(-F\right) \cdot \mathsf{fma}\left(-0.019444444444444445, B \cdot B, -0.16666666666666666\right), \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right) \cdot x\right), B \cdot B, \mathsf{fma}\left(t\_0, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if B < 0.40000000000000002Initial program 74.8%
Taylor expanded in B around 0
Applied rewrites58.1%
if 0.40000000000000002 < B Initial program 80.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.9%
Taylor expanded in F around inf
Applied rewrites46.6%
Taylor expanded in B around 0
lower-/.f6444.7
Applied rewrites44.7%
Final simplification55.3%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e+148)
(/ 1.0 (/ B (- -1.0 x)))
(if (<= F 520.0)
(/
(fma
(fma
(* 0.16666666666666666 F)
(sqrt (/ 1.0 (+ (fma x 2.0 (* F F)) 2.0)))
(* 0.3333333333333333 x))
(* B B)
(fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)))
B)
(- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e+148) {
tmp = 1.0 / (B / (-1.0 - x));
} else if (F <= 520.0) {
tmp = fma(fma((0.16666666666666666 * F), sqrt((1.0 / (fma(x, 2.0, (F * F)) + 2.0))), (0.3333333333333333 * x)), (B * B), fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x)) / B;
} else {
tmp = (1.0 / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.2e+148) tmp = Float64(1.0 / Float64(B / Float64(-1.0 - x))); elseif (F <= 520.0) tmp = Float64(fma(fma(Float64(0.16666666666666666 * F), sqrt(Float64(1.0 / Float64(fma(x, 2.0, Float64(F * F)) + 2.0))), Float64(0.3333333333333333 * x)), Float64(B * B), fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x))) / B); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.2e+148], N[(1.0 / N[(B / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 520.0], N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{+148}:\\
\;\;\;\;\frac{1}{\frac{B}{-1 - x}}\\
\mathbf{elif}\;F \leq 520:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, F \cdot F\right) + 2}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -5.2e148Initial program 21.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.f6429.3
Applied rewrites29.3%
Taylor expanded in F around -inf
Applied rewrites53.0%
Applied rewrites53.0%
if -5.2e148 < F < 520Initial program 98.2%
Taylor expanded in B around 0
Applied rewrites53.0%
Taylor expanded in B around 0
Applied rewrites53.3%
if 520 < F Initial program 61.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites84.0%
Applied rewrites84.1%
Taylor expanded in F around inf
Applied rewrites99.8%
Taylor expanded in B around 0
lower-/.f6474.8
Applied rewrites74.8%
(FPCore (F B x)
:precision binary64
(if (<= B 0.4)
(-
(/
(*
(fma (* (* B B) F) 0.16666666666666666 F)
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))))
B)
(/
(fma
(fma (* -0.022222222222222223 x) (* B B) (* -0.3333333333333333 x))
(* B B)
x)
B))
(fma -1.0 (/ -1.0 B) (/ (- x) (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.4) {
tmp = ((fma(((B * B) * F), 0.16666666666666666, F) * sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))))) / B) - (fma(fma((-0.022222222222222223 * x), (B * B), (-0.3333333333333333 * x)), (B * B), x) / B);
} else {
tmp = fma(-1.0, (-1.0 / B), (-x / tan(B)));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.4) tmp = Float64(Float64(Float64(fma(Float64(Float64(B * B) * F), 0.16666666666666666, F) * sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0))))) / B) - Float64(fma(fma(Float64(-0.022222222222222223 * x), Float64(B * B), Float64(-0.3333333333333333 * x)), Float64(B * B), x) / B)); else tmp = fma(-1.0, Float64(-1.0 / B), Float64(Float64(-x) / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.4], N[(N[(N[(N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.16666666666666666 + F), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - N[(N[(N[(N[(-0.022222222222222223 * x), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(-0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(-1.0 / B), $MachinePrecision] + N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.4:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{\mathsf{fma}\left(\mathsf{fma}\left(-0.022222222222222223 \cdot x, B \cdot B, -0.3333333333333333 \cdot x\right), B \cdot B, x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{-1}{B}, \frac{-x}{\tan B}\right)\\
\end{array}
\end{array}
if B < 0.40000000000000002Initial program 74.8%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites65.2%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites58.0%
if 0.40000000000000002 < B Initial program 80.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
frac-2negN/A
div-invN/A
lower-fma.f64N/A
Applied rewrites79.9%
Taylor expanded in F around inf
Applied rewrites46.6%
Taylor expanded in B around 0
lower-/.f6444.7
Applied rewrites44.7%
Final simplification55.2%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e+148)
(/ 1.0 (/ B (- -1.0 x)))
(if (<= F 1.3e+128)
(/
(fma
(fma
(* 0.16666666666666666 F)
(sqrt (/ 1.0 (+ (fma x 2.0 (* F F)) 2.0)))
(* 0.3333333333333333 x))
(* B B)
(fma (sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))) F (- x)))
B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e+148) {
tmp = 1.0 / (B / (-1.0 - x));
} else if (F <= 1.3e+128) {
tmp = fma(fma((0.16666666666666666 * F), sqrt((1.0 / (fma(x, 2.0, (F * F)) + 2.0))), (0.3333333333333333 * x)), (B * B), fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, -x)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5.2e+148) tmp = Float64(1.0 / Float64(B / Float64(-1.0 - x))); elseif (F <= 1.3e+128) tmp = Float64(fma(fma(Float64(0.16666666666666666 * F), sqrt(Float64(1.0 / Float64(fma(x, 2.0, Float64(F * F)) + 2.0))), Float64(0.3333333333333333 * x)), Float64(B * B), fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), F, Float64(-x))) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5.2e+148], N[(1.0 / N[(B / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.3e+128], N[(N[(N[(N[(0.16666666666666666 * F), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{+148}:\\
\;\;\;\;\frac{1}{\frac{B}{-1 - x}}\\
\mathbf{elif}\;F \leq 1.3 \cdot 10^{+128}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666 \cdot F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, F \cdot F\right) + 2}}, 0.3333333333333333 \cdot x\right), B \cdot B, \mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.2e148Initial program 21.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.f6429.3
Applied rewrites29.3%
Taylor expanded in F around -inf
Applied rewrites53.0%
Applied rewrites53.0%
if -5.2e148 < F < 1.3e128Initial program 96.8%
Taylor expanded in B around 0
Applied rewrites51.1%
Taylor expanded in B around 0
Applied rewrites51.5%
if 1.3e128 < F Initial program 41.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.f6444.6
Applied rewrites44.6%
Taylor expanded in F around inf
Applied rewrites60.9%
(FPCore (F B x)
:precision binary64
(if (<= F -4.7e+67)
(/ (- -1.0 x) B)
(if (<= F 1.25e+128)
(/
(fma
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0))))
(fma (* (* B B) F) 0.16666666666666666 F)
(fma 0.3333333333333333 (* (* B B) x) (- x)))
B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.7e+67) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.25e+128) {
tmp = fma(sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(((B * B) * F), 0.16666666666666666, F), fma(0.3333333333333333, ((B * B) * x), -x)) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -4.7e+67) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.25e+128) tmp = Float64(fma(sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0)))), fma(Float64(Float64(B * B) * F), 0.16666666666666666, F), fma(0.3333333333333333, Float64(Float64(B * B) * x), Float64(-x))) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -4.7e+67], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.25e+128], N[(N[(N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.16666666666666666 + F), $MachinePrecision] + N[(0.3333333333333333 * N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.7 \cdot 10^{+67}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{+128}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right), \mathsf{fma}\left(0.3333333333333333, \left(B \cdot B\right) \cdot x, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.70000000000000017e67Initial program 40.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.f6434.5
Applied rewrites34.5%
Taylor expanded in F around -inf
Applied rewrites51.7%
if -4.70000000000000017e67 < F < 1.25e128Initial program 97.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites51.6%
if 1.25e128 < F Initial program 41.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.f6444.6
Applied rewrites44.6%
Taylor expanded in F around inf
Applied rewrites60.9%
Final simplification53.0%
(FPCore (F B x)
:precision binary64
(if (<= F -13500.0)
(/ (fma (/ 0.5 F) (/ (fma 2.0 x 2.0) F) (- -1.0 x)) B)
(if (<= F 1.02e+89)
(-
(/
(*
(fma (* (* B B) F) 0.16666666666666666 F)
(sqrt (/ 1.0 (fma F F (fma 2.0 x 2.0)))))
B)
(/ x B))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -13500.0) {
tmp = fma((0.5 / F), (fma(2.0, x, 2.0) / F), (-1.0 - x)) / B;
} else if (F <= 1.02e+89) {
tmp = ((fma(((B * B) * F), 0.16666666666666666, F) * sqrt((1.0 / fma(F, F, fma(2.0, x, 2.0))))) / B) - (x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -13500.0) tmp = Float64(fma(Float64(0.5 / F), Float64(fma(2.0, x, 2.0) / F), Float64(-1.0 - x)) / B); elseif (F <= 1.02e+89) tmp = Float64(Float64(Float64(fma(Float64(Float64(B * B) * F), 0.16666666666666666, F) * sqrt(Float64(1.0 / fma(F, F, fma(2.0, x, 2.0))))) / B) - Float64(x / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -13500.0], N[(N[(N[(0.5 / F), $MachinePrecision] * N[(N[(2.0 * x + 2.0), $MachinePrecision] / F), $MachinePrecision] + N[(-1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.02e+89], N[(N[(N[(N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.16666666666666666 + F), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -13500:\\
\;\;\;\;\frac{\mathsf{fma}\left(\frac{0.5}{F}, \frac{\mathsf{fma}\left(2, x, 2\right)}{F}, -1 - x\right)}{B}\\
\mathbf{elif}\;F \leq 1.02 \cdot 10^{+89}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.16666666666666666, F\right) \cdot \sqrt{\frac{1}{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}}}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -13500Initial program 50.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6440.5
Applied rewrites40.5%
Taylor expanded in F around -inf
Applied rewrites54.8%
if -13500 < F < 1.0199999999999999e89Initial program 99.5%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites62.8%
Taylor expanded in B around 0
lower-/.f6449.7
Applied rewrites49.7%
if 1.0199999999999999e89 < F Initial program 44.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.f6446.0
Applied rewrites46.0%
Taylor expanded in F around inf
Applied rewrites59.7%
Final simplification52.9%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+160)
(/ 1.0 (/ B (- -1.0 x)))
(if (<= F 100000000.0)
(/ (- (/ 1.0 (/ (sqrt (fma x 2.0 (fma F F 2.0))) F)) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+160) {
tmp = 1.0 / (B / (-1.0 - x));
} else if (F <= 100000000.0) {
tmp = ((1.0 / (sqrt(fma(x, 2.0, fma(F, F, 2.0))) / F)) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+160) tmp = Float64(1.0 / Float64(B / Float64(-1.0 - x))); elseif (F <= 100000000.0) tmp = Float64(Float64(Float64(1.0 / Float64(sqrt(fma(x, 2.0, fma(F, F, 2.0))) / F)) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+160], N[(1.0 / N[(B / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(N[(1.0 / N[(N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+160}:\\
\;\;\;\;\frac{1}{\frac{B}{-1 - x}}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\frac{\frac{1}{\frac{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}{F}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.0000000000000002e160Initial program 17.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.9
Applied rewrites25.9%
Taylor expanded in F around -inf
Applied rewrites53.1%
Applied rewrites53.2%
if -5.0000000000000002e160 < F < 1e8Initial program 96.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.f6452.9
Applied rewrites52.9%
Applied rewrites53.0%
Applied rewrites53.0%
if 1e8 < F Initial program 61.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.f6442.4
Applied rewrites42.4%
Taylor expanded in F around inf
Applied rewrites51.9%
(FPCore (F B x)
:precision binary64
(if (<= F -5e+160)
(/ 1.0 (/ B (- -1.0 x)))
(if (<= F 100000000.0)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+160) {
tmp = 1.0 / (B / (-1.0 - x));
} else if (F <= 100000000.0) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -5e+160) tmp = Float64(1.0 / Float64(B / Float64(-1.0 - x))); elseif (F <= 100000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -5e+160], N[(1.0 / N[(B / N[(-1.0 - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5 \cdot 10^{+160}:\\
\;\;\;\;\frac{1}{\frac{B}{-1 - x}}\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.0000000000000002e160Initial program 17.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.9
Applied rewrites25.9%
Taylor expanded in F around -inf
Applied rewrites53.1%
Applied rewrites53.2%
if -5.0000000000000002e160 < F < 1e8Initial program 96.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.f6452.9
Applied rewrites52.9%
Applied rewrites53.0%
Taylor expanded in x around 0
Applied rewrites53.0%
if 1e8 < F Initial program 61.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.f6442.4
Applied rewrites42.4%
Taylor expanded in F around inf
Applied rewrites51.9%
(FPCore (F B x) :precision binary64 (if (<= F -1.2e-52) (/ (- -1.0 x) B) (if (<= F 3.1e-82) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.1e-82) {
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.2d-52)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.1d-82) 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.2e-52) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.1e-82) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.2e-52: tmp = (-1.0 - x) / B elif F <= 3.1e-82: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.2e-52) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.1e-82) 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.2e-52) tmp = (-1.0 - x) / B; elseif (F <= 3.1e-82) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.2e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.1e-82], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-82}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.2000000000000001e-52Initial program 57.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.f6444.1
Applied rewrites44.1%
Taylor expanded in F around -inf
Applied rewrites52.5%
if -1.2000000000000001e-52 < F < 3.1e-82Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.1
Applied rewrites51.1%
Taylor expanded in F around 0
Applied rewrites39.1%
if 3.1e-82 < F Initial program 70.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.f6443.3
Applied rewrites43.3%
Taylor expanded in F around inf
Applied rewrites45.7%
(FPCore (F B x) :precision binary64 (let* ((t_0 (/ (- x) B))) (if (<= x -1.24e-154) t_0 (if (<= x 2.7e-187) (/ -1.0 B) t_0))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (x <= -1.24e-154) {
tmp = t_0;
} else if (x <= 2.7e-187) {
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.24d-154)) then
tmp = t_0
else if (x <= 2.7d-187) 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.24e-154) {
tmp = t_0;
} else if (x <= 2.7e-187) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if x <= -1.24e-154: tmp = t_0 elif x <= 2.7e-187: 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.24e-154) tmp = t_0; elseif (x <= 2.7e-187) 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.24e-154) tmp = t_0; elseif (x <= 2.7e-187) 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.24e-154], t$95$0, If[LessEqual[x, 2.7e-187], N[(-1.0 / B), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;x \leq -1.24 \cdot 10^{-154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-187}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.24e-154 or 2.7000000000000001e-187 < x Initial program 78.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.f6448.7
Applied rewrites48.7%
Taylor expanded in F around 0
Applied rewrites39.1%
if -1.24e-154 < x < 2.7000000000000001e-187Initial program 67.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.f6438.5
Applied rewrites38.5%
Taylor expanded in F around -inf
Applied rewrites22.3%
Taylor expanded in x around 0
Applied rewrites22.3%
(FPCore (F B x) :precision binary64 (if (<= F -1.2e-52) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e-52) {
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.2d-52)) 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.2e-52) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.2e-52: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.2e-52) 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.2e-52) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.2e-52], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{-52}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -1.2000000000000001e-52Initial program 57.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.f6444.1
Applied rewrites44.1%
Taylor expanded in F around -inf
Applied rewrites52.5%
if -1.2000000000000001e-52 < F Initial program 85.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.f6447.4
Applied rewrites47.4%
Taylor expanded in F around 0
Applied rewrites33.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 75.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.f6446.3
Applied rewrites46.3%
Taylor expanded in F around -inf
Applied rewrites32.5%
Taylor expanded in x around 0
Applied rewrites11.7%
herbie shell --seed 2024250
(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))))))