
(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 22 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
(if (<= F -1.6e+129)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 150000000.0)
(- (/ (* (sqrt (pow (fma F F 2.0) -1.0)) F) (sin B)) (/ x (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.6e+129) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 150000000.0) {
tmp = ((sqrt(pow(fma(F, F, 2.0), -1.0)) * F) / sin(B)) - (x / tan(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.6e+129) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 150000000.0) tmp = Float64(Float64(Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * F) / sin(B)) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.6e+129], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 150000000.0], N[(N[(N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.6 \cdot 10^{+129}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 150000000:\\
\;\;\;\;\frac{\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot F}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.6000000000000001e129Initial program 32.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -1.6000000000000001e129 < F < 1.5e8Initial 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.7%
Applied rewrites99.7%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
if 1.5e8 < F Initial program 63.2%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Applied rewrites99.9%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B))))
(t_1 (- (/ (/ F B) (sqrt (fma 2.0 x (fma F F 2.0)))) (/ x (tan B))))
(t_2 (/ F (sin B)))
(t_3 (+ t_0 (* t_2 (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (/ -1.0 2.0))))))
(if (<= t_3 -2e+16)
t_1
(if (<= t_3 400.0)
(* (sqrt (pow (fma F F 2.0) -1.0)) t_2)
(if (<= t_3 2.5e+228)
t_1
(if (<= t_3 INFINITY)
(+ t_0 (pow B -1.0))
(/
(-
(fma
-0.16666666666666666
(* B B)
(fma (* (* B B) 0.3333333333333333) x -1.0))
x)
B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double t_1 = ((F / B) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - (x / tan(B));
double t_2 = F / sin(B);
double t_3 = t_0 + (t_2 * pow((((F * F) + 2.0) + (2.0 * x)), (-1.0 / 2.0)));
double tmp;
if (t_3 <= -2e+16) {
tmp = t_1;
} else if (t_3 <= 400.0) {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * t_2;
} else if (t_3 <= 2.5e+228) {
tmp = t_1;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_0 + pow(B, -1.0);
} else {
tmp = (fma(-0.16666666666666666, (B * B), fma(((B * B) * 0.3333333333333333), x, -1.0)) - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) t_1 = Float64(Float64(Float64(F / B) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - Float64(x / tan(B))) t_2 = Float64(F / sin(B)) t_3 = Float64(t_0 + Float64(t_2 * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-1.0 / 2.0)))) tmp = 0.0 if (t_3 <= -2e+16) tmp = t_1; elseif (t_3 <= 400.0) tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * t_2); elseif (t_3 <= 2.5e+228) tmp = t_1; elseif (t_3 <= Inf) tmp = Float64(t_0 + (B ^ -1.0)); else tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), fma(Float64(Float64(B * B) * 0.3333333333333333), x, -1.0)) - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(F / B), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 + N[(t$95$2 * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+16], t$95$1, If[LessEqual[t$95$3, 400.0], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 2.5e+228], t$95$1, If[LessEqual[t$95$3, Infinity], N[(t$95$0 + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * x + -1.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
t_1 := \frac{\frac{F}{B}}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
t_2 := \frac{F}{\sin B}\\
t_3 := t\_0 + t\_2 \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(\frac{-1}{2}\right)}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 400:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot t\_2\\
\mathbf{elif}\;t\_3 \leq 2.5 \cdot 10^{+228}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_0 + {B}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, \mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.3333333333333333, x, -1\right)\right) - 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)))))) < -2e16 or 400 < (+.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)))))) < 2.5e228Initial program 96.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6496.7
Applied rewrites96.7%
lift-+.f64N/A
+-commutativeN/A
lift-neg.f64N/A
lift-*.f64N/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
unsub-negN/A
lower--.f6496.8
Applied rewrites96.8%
if -2e16 < (+.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)))))) < 400Initial program 78.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.f6455.1
Applied rewrites55.1%
if 2.5e228 < (+.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 85.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.f6485.2
Applied rewrites85.2%
Taylor expanded in F around inf
Applied rewrites94.5%
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%
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 rewrites64.7%
Applied rewrites64.7%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites64.7%
Taylor expanded in F around -inf
Applied rewrites90.1%
Final simplification80.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0))))
(if (<= B 0.08)
(/
(fma
(fma
t_0
(fma (* (* B B) F) 0.019444444444444445 (* 0.16666666666666666 F))
(* x (fma 0.022222222222222223 (* B B) 0.3333333333333333)))
(* B B)
(fma t_0 F (- x)))
B)
(+ (* x (/ -1.0 (tan B))) (pow B -1.0)))))
double code(double F, double B, double x) {
double t_0 = sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0));
double tmp;
if (B <= 0.08) {
tmp = fma(fma(t_0, fma(((B * B) * F), 0.019444444444444445, (0.16666666666666666 * F)), (x * fma(0.022222222222222223, (B * B), 0.3333333333333333))), (B * B), fma(t_0, F, -x)) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + pow(B, -1.0);
}
return tmp;
}
function code(F, B, x) t_0 = sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) tmp = 0.0 if (B <= 0.08) tmp = Float64(fma(fma(t_0, fma(Float64(Float64(B * B) * F), 0.019444444444444445, Float64(0.16666666666666666 * F)), Float64(x * fma(0.022222222222222223, Float64(B * B), 0.3333333333333333))), Float64(B * B), fma(t_0, F, Float64(-x))) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (B ^ -1.0)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.08], N[(N[(N[(t$95$0 * N[(N[(N[(B * B), $MachinePrecision] * F), $MachinePrecision] * 0.019444444444444445 + N[(0.16666666666666666 * F), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.022222222222222223 * N[(B * B), $MachinePrecision] + 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(t$95$0 * F + (-x)), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}\\
\mathbf{if}\;B \leq 0.08:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(t\_0, \mathsf{fma}\left(\left(B \cdot B\right) \cdot F, 0.019444444444444445, 0.16666666666666666 \cdot F\right), x \cdot \mathsf{fma}\left(0.022222222222222223, B \cdot B, 0.3333333333333333\right)\right), B \cdot B, \mathsf{fma}\left(t\_0, F, -x\right)\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {B}^{-1}\\
\end{array}
\end{array}
if B < 0.0800000000000000017Initial program 73.7%
Taylor expanded in B around 0
Applied rewrites59.8%
if 0.0800000000000000017 < B Initial program 90.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6457.7
Applied rewrites57.7%
Taylor expanded in F around inf
Applied rewrites52.0%
Final simplification57.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B)))
(t_1
(-
(* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (/ F B))
(/ x (tan B)))))
(if (<= F -2.5e+146)
(+ (* x (/ -1.0 (tan B))) (/ (fma -0.16666666666666666 (* B B) -1.0) B))
(if (<= F -5.5e+28)
t_1
(if (<= F -1.05e-199)
t_0
(if (<= F 2.2e-62)
t_1
(if (<= F 10200.0) t_0 (/ (- 1.0 (* (cos B) x)) (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
double t_1 = (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * (F / B)) - (x / tan(B));
double tmp;
if (F <= -2.5e+146) {
tmp = (x * (-1.0 / tan(B))) + (fma(-0.16666666666666666, (B * B), -1.0) / B);
} else if (F <= -5.5e+28) {
tmp = t_1;
} else if (F <= -1.05e-199) {
tmp = t_0;
} else if (F <= 2.2e-62) {
tmp = t_1;
} else if (F <= 10200.0) {
tmp = t_0;
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)) t_1 = Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * Float64(F / B)) - Float64(x / tan(B))) tmp = 0.0 if (F <= -2.5e+146) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(fma(-0.16666666666666666, Float64(B * B), -1.0) / B)); elseif (F <= -5.5e+28) tmp = t_1; elseif (F <= -1.05e-199) tmp = t_0; elseif (F <= 2.2e-62) tmp = t_1; elseif (F <= 10200.0) tmp = t_0; else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.5e+146], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + -1.0), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.5e+28], t$95$1, If[LessEqual[F, -1.05e-199], t$95$0, If[LessEqual[F, 2.2e-62], t$95$1, If[LessEqual[F, 10200.0], t$95$0, N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
t_1 := \sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \frac{F}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.5 \cdot 10^{+146}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, -1\right)}{B}\\
\mathbf{elif}\;F \leq -5.5 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq -1.05 \cdot 10^{-199}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;F \leq 10200:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.4999999999999999e146Initial program 19.1%
Taylor expanded in B around 0
+-commutativeN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
*-commutativeN/A
lower-/.f64N/A
Applied rewrites34.5%
Taylor expanded in F around -inf
Applied rewrites70.0%
if -2.4999999999999999e146 < F < -5.5000000000000003e28 or -1.05000000000000001e-199 < F < 2.20000000000000017e-62Initial program 98.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.6%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6487.4
Applied rewrites87.4%
if -5.5000000000000003e28 < F < -1.05000000000000001e-199 or 2.20000000000000017e-62 < F < 10200Initial program 99.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 rewrites99.6%
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6488.9
Applied rewrites88.9%
if 10200 < F Initial program 65.0%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.5
Applied rewrites99.5%
Applied rewrites99.6%
Final simplification89.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -1.6e+22)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1.05e-199)
t_0
(if (<= F 2.2e-62)
(- (* (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) (/ F B)) t_1)
(if (<= F 10200.0) t_0 (/ (- 1.0 (* (cos B) x)) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -1.6e+22) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1.05e-199) {
tmp = t_0;
} else if (F <= 2.2e-62) {
tmp = (sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)) * (F / B)) - t_1;
} else if (F <= 10200.0) {
tmp = t_0;
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.6e+22) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1.05e-199) tmp = t_0; elseif (F <= 2.2e-62) tmp = Float64(Float64(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)) * Float64(F / B)) - t_1); elseif (F <= 10200.0) tmp = t_0; else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = 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]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.6e+22], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.05e-199], t$95$0, If[LessEqual[F, 2.2e-62], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 10200.0], t$95$0, N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -1.05 \cdot 10^{-199}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{-62}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}} \cdot \frac{F}{B} - t\_1\\
\mathbf{elif}\;F \leq 10200:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.6e22Initial program 55.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 rewrites73.4%
Applied rewrites73.4%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -1.6e22 < F < -1.05000000000000001e-199 or 2.20000000000000017e-62 < F < 10200Initial program 99.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 rewrites99.6%
Applied rewrites99.6%
Taylor expanded in B around 0
lower-/.f6488.9
Applied rewrites88.9%
if -1.05000000000000001e-199 < F < 2.20000000000000017e-62Initial program 99.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 rewrites99.6%
Applied rewrites99.7%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
unpow2N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6489.7
Applied rewrites89.7%
if 10200 < F Initial program 65.0%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.5
Applied rewrites99.5%
Applied rewrites99.6%
Final simplification95.0%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+128)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 102000000.0)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) (/ x (tan B)))
(/ (- 1.0 (* (cos B) x)) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+128) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 102000000.0) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - (x / tan(B));
} else {
tmp = (1.0 - (cos(B) * x)) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+128) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 102000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - Float64(x / tan(B))); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+128], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 102000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 102000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -2.0000000000000002e128Initial program 32.4%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
if -2.0000000000000002e128 < F < 1.02e8Initial 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.7%
Applied rewrites99.7%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6499.6
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6499.6
Applied rewrites99.6%
if 1.02e8 < F Initial program 63.2%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Applied rewrites99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 18000.0)
(- (/ (* (sqrt 0.5) F) (sin B)) t_0)
(/ (- 1.0 (* (cos B) x)) (sin B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 18000.0) {
tmp = ((sqrt(0.5) * F) / sin(B)) - t_0;
} else {
tmp = (1.0 - (cos(B) * x)) / sin(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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 18000.0d0) then
tmp = ((sqrt(0.5d0) * f) / sin(b)) - t_0
else
tmp = (1.0d0 - (cos(b) * x)) / sin(b)
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 <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 18000.0) {
tmp = ((Math.sqrt(0.5) * F) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 - (Math.cos(B) * x)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 18000.0: tmp = ((math.sqrt(0.5) * F) / math.sin(B)) - t_0 else: tmp = (1.0 - (math.cos(B) * x)) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 18000.0) tmp = Float64(Float64(Float64(sqrt(0.5) * F) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 - Float64(cos(B) * x)) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 18000.0) tmp = ((sqrt(0.5) * F) / sin(B)) - t_0; else tmp = (1.0 - (cos(B) * x)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 18000.0], N[(N[(N[(N[Sqrt[0.5], $MachinePrecision] * F), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 - N[(N[Cos[B], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 18000:\\
\;\;\;\;\frac{\sqrt{0.5} \cdot F}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \cos B \cdot x}{\sin B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 56.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 rewrites74.2%
Applied rewrites74.2%
Taylor expanded in F around -inf
Applied rewrites99.8%
if -1.3999999999999999 < F < 18000Initial 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.6%
Applied rewrites99.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f6499.7
Applied rewrites99.7%
Taylor expanded in F around 0
Applied rewrites98.4%
if 18000 < F Initial program 64.1%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.5
Applied rewrites99.5%
Applied rewrites99.6%
(FPCore (F B x) :precision binary64 (if (or (<= x -4.3e-36) (not (<= x 5.2e-21))) (+ (* x (/ -1.0 (tan B))) (pow B -1.0)) (* (sqrt (pow (fma F F 2.0) -1.0)) (/ F (sin B)))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -4.3e-36) || !(x <= 5.2e-21)) {
tmp = (x * (-1.0 / tan(B))) + pow(B, -1.0);
} else {
tmp = sqrt(pow(fma(F, F, 2.0), -1.0)) * (F / sin(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -4.3e-36) || !(x <= 5.2e-21)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (B ^ -1.0)); else tmp = Float64(sqrt((fma(F, F, 2.0) ^ -1.0)) * Float64(F / sin(B))); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -4.3e-36], N[Not[LessEqual[x, 5.2e-21]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision], N[(N[Sqrt[N[Power[N[(F * F + 2.0), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.3 \cdot 10^{-36} \lor \neg \left(x \leq 5.2 \cdot 10^{-21}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {B}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-1}} \cdot \frac{F}{\sin B}\\
\end{array}
\end{array}
if x < -4.3000000000000002e-36 or 5.20000000000000035e-21 < x Initial program 81.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.f6480.2
Applied rewrites80.2%
Taylor expanded in F around inf
Applied rewrites93.2%
if -4.3000000000000002e-36 < x < 5.20000000000000035e-21Initial program 75.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.f6458.7
Applied rewrites58.7%
Final simplification74.7%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.3e-6) (not (<= x 1.45e-18))) (+ (* x (/ -1.0 (tan B))) (pow B -1.0)) (- (/ (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.3e-6) || !(x <= 1.45e-18)) {
tmp = (x * (-1.0 / tan(B))) + pow(B, -1.0);
} else {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - (x / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if ((x <= -1.3e-6) || !(x <= 1.45e-18)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (B ^ -1.0)); else tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) / sin(B)) - Float64(x / B)); end return tmp end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.3e-6], N[Not[LessEqual[x, 1.45e-18]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.3 \cdot 10^{-6} \lor \neg \left(x \leq 1.45 \cdot 10^{-18}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {B}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if x < -1.30000000000000005e-6 or 1.45e-18 < x Initial program 80.8%
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.8
Applied rewrites80.8%
Taylor expanded in F around inf
Applied rewrites97.8%
if -1.30000000000000005e-6 < x < 1.45e-18Initial program 76.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 rewrites80.2%
Applied rewrites80.3%
Taylor expanded in B around 0
lower-/.f6473.7
Applied rewrites73.7%
Final simplification84.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+144)
(/
(-
(fma
-0.16666666666666666
(* B B)
(fma (* (* B B) 0.3333333333333333) x -1.0))
x)
B)
(if (<= F 5e+19)
(/ (fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (- x)) B)
(if (<= F 2.1e+98)
(- (pow (sin B) -1.0) (* (* -0.3333333333333333 x) B))
(-
(pow
(*
(fma
(fma
(fma -0.0001984126984126984 (* B B) 0.008333333333333333)
(* B B)
-0.16666666666666666)
(* B B)
1.0)
B)
-1.0)
(/ (fma (* x -0.3333333333333333) (* B B) x) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+144) {
tmp = (fma(-0.16666666666666666, (B * B), fma(((B * B) * 0.3333333333333333), x, -1.0)) - x) / B;
} else if (F <= 5e+19) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, -x) / B;
} else if (F <= 2.1e+98) {
tmp = pow(sin(B), -1.0) - ((-0.3333333333333333 * x) * B);
} else {
tmp = pow((fma(fma(fma(-0.0001984126984126984, (B * B), 0.008333333333333333), (B * B), -0.16666666666666666), (B * B), 1.0) * B), -1.0) - (fma((x * -0.3333333333333333), (B * B), x) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+144) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), fma(Float64(Float64(B * B) * 0.3333333333333333), x, -1.0)) - x) / B); elseif (F <= 5e+19) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(-x)) / B); elseif (F <= 2.1e+98) tmp = Float64((sin(B) ^ -1.0) - Float64(Float64(-0.3333333333333333 * x) * B)); else tmp = Float64((Float64(fma(fma(fma(-0.0001984126984126984, Float64(B * B), 0.008333333333333333), Float64(B * B), -0.16666666666666666), Float64(B * B), 1.0) * B) ^ -1.0) - Float64(fma(Float64(x * -0.3333333333333333), Float64(B * B), x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+144], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * x + -1.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5e+19], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.1e+98], N[(N[Power[N[Sin[B], $MachinePrecision], -1.0], $MachinePrecision] - N[(N[(-0.3333333333333333 * x), $MachinePrecision] * B), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(N[(N[(-0.0001984126984126984 * N[(B * B), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] - N[(N[(N[(x * -0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, \mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.3333333333333333, x, -1\right)\right) - x}{B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{+19}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{+98}:\\
\;\;\;\;{\sin B}^{-1} - \left(-0.3333333333333333 \cdot x\right) \cdot B\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, B \cdot B, 0.008333333333333333\right), B \cdot B, -0.16666666666666666\right), B \cdot B, 1\right) \cdot B\right)}^{-1} - \frac{\mathsf{fma}\left(x \cdot -0.3333333333333333, B \cdot B, x\right)}{B}\\
\end{array}
\end{array}
if F < -1.95000000000000009e144Initial program 23.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 rewrites53.1%
Applied rewrites53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.2%
Taylor expanded in F around -inf
Applied rewrites60.9%
if -1.95000000000000009e144 < F < 5e19Initial program 98.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.f6451.0
Applied rewrites51.0%
if 5e19 < F < 2.10000000000000004e98Initial program 85.7%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites64.3%
Taylor expanded in B around inf
Applied rewrites79.3%
if 2.10000000000000004e98 < F Initial program 52.4%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites50.9%
Taylor expanded in B around 0
Applied rewrites50.7%
Final simplification54.5%
(FPCore (F B x)
:precision binary64
(if (<= B 0.0285)
(/
(fma
(* (* B B) x)
0.3333333333333333
(-
(/
(fma (* B B) (* 0.16666666666666666 F) F)
(sqrt (fma 2.0 x (fma F F 2.0))))
x))
B)
(+ (* x (/ -1.0 (tan B))) (pow B -1.0))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0285) {
tmp = fma(((B * B) * x), 0.3333333333333333, ((fma((B * B), (0.16666666666666666 * F), F) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x)) / B;
} else {
tmp = (x * (-1.0 / tan(B))) + pow(B, -1.0);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (B <= 0.0285) tmp = Float64(fma(Float64(Float64(B * B) * x), 0.3333333333333333, Float64(Float64(fma(Float64(B * B), Float64(0.16666666666666666 * F), F) / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x)) / B); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + (B ^ -1.0)); end return tmp end
code[F_, B_, x_] := If[LessEqual[B, 0.0285], N[(N[(N[(N[(B * B), $MachinePrecision] * x), $MachinePrecision] * 0.3333333333333333 + N[(N[(N[(N[(B * B), $MachinePrecision] * N[(0.16666666666666666 * F), $MachinePrecision] + F), $MachinePrecision] / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Power[B, -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0285:\\
\;\;\;\;\frac{\mathsf{fma}\left(\left(B \cdot B\right) \cdot x, 0.3333333333333333, \frac{\mathsf{fma}\left(B \cdot B, 0.16666666666666666 \cdot F, F\right)}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {B}^{-1}\\
\end{array}
\end{array}
if B < 0.028500000000000001Initial program 73.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 rewrites86.9%
Applied rewrites87.0%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites59.8%
Applied rewrites59.8%
if 0.028500000000000001 < B Initial program 90.7%
Taylor expanded in B around 0
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6457.7
Applied rewrites57.7%
Taylor expanded in F around inf
Applied rewrites52.0%
Final simplification57.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+144)
(/
(-
(fma
-0.16666666666666666
(* B B)
(fma (* (* B B) 0.3333333333333333) x -1.0))
x)
B)
(if (<= F 5.5e+25)
(/ (fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (- x)) B)
(-
(pow
(*
(fma
(fma
(fma -0.0001984126984126984 (* B B) 0.008333333333333333)
(* B B)
-0.16666666666666666)
(* B B)
1.0)
B)
-1.0)
(/ (fma (* x -0.3333333333333333) (* B B) x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+144) {
tmp = (fma(-0.16666666666666666, (B * B), fma(((B * B) * 0.3333333333333333), x, -1.0)) - x) / B;
} else if (F <= 5.5e+25) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, -x) / B;
} else {
tmp = pow((fma(fma(fma(-0.0001984126984126984, (B * B), 0.008333333333333333), (B * B), -0.16666666666666666), (B * B), 1.0) * B), -1.0) - (fma((x * -0.3333333333333333), (B * B), x) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+144) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), fma(Float64(Float64(B * B) * 0.3333333333333333), x, -1.0)) - x) / B); elseif (F <= 5.5e+25) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64((Float64(fma(fma(fma(-0.0001984126984126984, Float64(B * B), 0.008333333333333333), Float64(B * B), -0.16666666666666666), Float64(B * B), 1.0) * B) ^ -1.0) - Float64(fma(Float64(x * -0.3333333333333333), Float64(B * B), x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+144], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * x + -1.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.5e+25], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[Power[N[(N[(N[(N[(-0.0001984126984126984 * N[(B * B), $MachinePrecision] + 0.008333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] * B), $MachinePrecision], -1.0], $MachinePrecision] - N[(N[(N[(x * -0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, \mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.3333333333333333, x, -1\right)\right) - x}{B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{+25}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.0001984126984126984, B \cdot B, 0.008333333333333333\right), B \cdot B, -0.16666666666666666\right), B \cdot B, 1\right) \cdot B\right)}^{-1} - \frac{\mathsf{fma}\left(x \cdot -0.3333333333333333, B \cdot B, x\right)}{B}\\
\end{array}
\end{array}
if F < -1.95000000000000009e144Initial program 23.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 rewrites53.1%
Applied rewrites53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.2%
Taylor expanded in F around -inf
Applied rewrites60.9%
if -1.95000000000000009e144 < F < 5.50000000000000018e25Initial program 98.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.f6451.0
Applied rewrites51.0%
if 5.50000000000000018e25 < F Initial program 60.6%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites54.7%
Taylor expanded in B around 0
Applied rewrites50.8%
Final simplification52.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+144)
(/
(-
(fma
-0.16666666666666666
(* B B)
(fma (* (* B B) 0.3333333333333333) x -1.0))
x)
B)
(if (<= F 4.8e+37)
(/ (fma (sqrt (pow (fma F F (fma 2.0 x 2.0)) -1.0)) F (- x)) B)
(/
(fma
(+
0.16666666666666666
(fma
(-
(fma
0.05555555555555555
x
(fma 0.008333333333333333 x 0.019444444444444445))
(* 0.041666666666666664 x))
(* B B)
(* 0.3333333333333333 x)))
(* B B)
(- 1.0 x))
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+144) {
tmp = (fma(-0.16666666666666666, (B * B), fma(((B * B) * 0.3333333333333333), x, -1.0)) - x) / B;
} else if (F <= 4.8e+37) {
tmp = fma(sqrt(pow(fma(F, F, fma(2.0, x, 2.0)), -1.0)), F, -x) / B;
} else {
tmp = fma((0.16666666666666666 + fma((fma(0.05555555555555555, x, fma(0.008333333333333333, x, 0.019444444444444445)) - (0.041666666666666664 * x)), (B * B), (0.3333333333333333 * x))), (B * B), (1.0 - x)) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+144) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), fma(Float64(Float64(B * B) * 0.3333333333333333), x, -1.0)) - x) / B); elseif (F <= 4.8e+37) tmp = Float64(fma(sqrt((fma(F, F, fma(2.0, x, 2.0)) ^ -1.0)), F, Float64(-x)) / B); else tmp = Float64(fma(Float64(0.16666666666666666 + fma(Float64(fma(0.05555555555555555, x, fma(0.008333333333333333, x, 0.019444444444444445)) - Float64(0.041666666666666664 * x)), Float64(B * B), Float64(0.3333333333333333 * x))), Float64(B * B), Float64(1.0 - x)) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+144], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * x + -1.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.8e+37], N[(N[(N[Sqrt[N[Power[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision], -1.0], $MachinePrecision]], $MachinePrecision] * F + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(0.16666666666666666 + N[(N[(N[(0.05555555555555555 * x + N[(0.008333333333333333 * x + 0.019444444444444445), $MachinePrecision]), $MachinePrecision] - N[(0.041666666666666664 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(1.0 - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, \mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.3333333333333333, x, -1\right)\right) - x}{B}\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{+37}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\sqrt{{\left(\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)\right)}^{-1}}, F, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.16666666666666666 + \mathsf{fma}\left(\mathsf{fma}\left(0.05555555555555555, x, \mathsf{fma}\left(0.008333333333333333, x, 0.019444444444444445\right)\right) - 0.041666666666666664 \cdot x, B \cdot B, 0.3333333333333333 \cdot x\right), B \cdot B, 1 - x\right)}{B}\\
\end{array}
\end{array}
if F < -1.95000000000000009e144Initial program 23.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 rewrites53.1%
Applied rewrites53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.2%
Taylor expanded in F around -inf
Applied rewrites60.9%
if -1.95000000000000009e144 < F < 4.8e37Initial program 98.2%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.7
Applied rewrites51.7%
if 4.8e37 < F Initial program 59.6%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites52.0%
Taylor expanded in B around 0
Applied rewrites49.0%
Final simplification52.2%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+144)
(/
(-
(fma
-0.16666666666666666
(* B B)
(fma (* (* B B) 0.3333333333333333) x -1.0))
x)
B)
(if (<= F 2.1e+73)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(-
(/
(fma (fma 0.019444444444444445 (* B B) 0.16666666666666666) (* B B) 1.0)
B)
(/ (fma (* x -0.3333333333333333) (* B B) x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+144) {
tmp = (fma(-0.16666666666666666, (B * B), fma(((B * B) * 0.3333333333333333), x, -1.0)) - x) / B;
} else if (F <= 2.1e+73) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (fma(fma(0.019444444444444445, (B * B), 0.16666666666666666), (B * B), 1.0) / B) - (fma((x * -0.3333333333333333), (B * B), x) / B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+144) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), fma(Float64(Float64(B * B) * 0.3333333333333333), x, -1.0)) - x) / B); elseif (F <= 2.1e+73) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(fma(fma(0.019444444444444445, Float64(B * B), 0.16666666666666666), Float64(B * B), 1.0) / B) - Float64(fma(Float64(x * -0.3333333333333333), Float64(B * B), x) / B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+144], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * x + -1.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.1e+73], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.019444444444444445 * N[(B * B), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] / B), $MachinePrecision] - N[(N[(N[(x * -0.3333333333333333), $MachinePrecision] * N[(B * B), $MachinePrecision] + x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, \mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.3333333333333333, x, -1\right)\right) - x}{B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{+73}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(0.019444444444444445, B \cdot B, 0.16666666666666666\right), B \cdot B, 1\right)}{B} - \frac{\mathsf{fma}\left(x \cdot -0.3333333333333333, B \cdot B, x\right)}{B}\\
\end{array}
\end{array}
if F < -1.95000000000000009e144Initial program 23.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 rewrites53.1%
Applied rewrites53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.2%
Taylor expanded in F around -inf
Applied rewrites60.9%
if -1.95000000000000009e144 < F < 2.1000000000000001e73Initial program 97.7%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.9
Applied rewrites51.9%
Applied rewrites51.9%
if 2.1000000000000001e73 < F Initial program 59.2%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites51.2%
Taylor expanded in B around 0
Applied rewrites47.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+144)
(/
(-
(fma
-0.16666666666666666
(* B B)
(fma (* (* B B) 0.3333333333333333) x -1.0))
x)
B)
(if (<= F 1.42e+192)
(/ (- (/ F (sqrt (fma x 2.0 (fma F F 2.0)))) x) B)
(/
(- (fma (+ 0.16666666666666666 (* 0.3333333333333333 x)) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+144) {
tmp = (fma(-0.16666666666666666, (B * B), fma(((B * B) * 0.3333333333333333), x, -1.0)) - x) / B;
} else if (F <= 1.42e+192) {
tmp = ((F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (fma((0.16666666666666666 + (0.3333333333333333 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+144) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), fma(Float64(Float64(B * B) * 0.3333333333333333), x, -1.0)) - x) / B); elseif (F <= 1.42e+192) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(fma(Float64(0.16666666666666666 + Float64(0.3333333333333333 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+144], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * x + -1.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42e+192], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.16666666666666666 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, \mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.3333333333333333, x, -1\right)\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{+192}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.95000000000000009e144Initial program 23.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 rewrites53.1%
Applied rewrites53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.2%
Taylor expanded in F around -inf
Applied rewrites60.9%
if -1.95000000000000009e144 < F < 1.42000000000000006e192Initial program 92.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.f6450.9
Applied rewrites50.9%
Applied rewrites50.9%
if 1.42000000000000006e192 < F Initial program 36.0%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites50.7%
Taylor expanded in B around 0
Applied rewrites48.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.95e+144)
(/
(-
(fma
-0.16666666666666666
(* B B)
(fma (* (* B B) 0.3333333333333333) x -1.0))
x)
B)
(if (<= F 1.42e+192)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/
(- (fma (+ 0.16666666666666666 (* 0.3333333333333333 x)) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.95e+144) {
tmp = (fma(-0.16666666666666666, (B * B), fma(((B * B) * 0.3333333333333333), x, -1.0)) - x) / B;
} else if (F <= 1.42e+192) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = (fma((0.16666666666666666 + (0.3333333333333333 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.95e+144) tmp = Float64(Float64(fma(-0.16666666666666666, Float64(B * B), fma(Float64(Float64(B * B) * 0.3333333333333333), x, -1.0)) - x) / B); elseif (F <= 1.42e+192) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(Float64(fma(Float64(0.16666666666666666 + Float64(0.3333333333333333 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.95e+144], N[(N[(N[(-0.16666666666666666 * N[(B * B), $MachinePrecision] + N[(N[(N[(B * B), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * x + -1.0), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42e+192], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.16666666666666666 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.95 \cdot 10^{+144}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-0.16666666666666666, B \cdot B, \mathsf{fma}\left(\left(B \cdot B\right) \cdot 0.3333333333333333, x, -1\right)\right) - x}{B}\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{+192}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.95000000000000009e144Initial program 23.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 rewrites53.1%
Applied rewrites53.1%
Taylor expanded in B around 0
lower-/.f64N/A
Applied rewrites33.2%
Taylor expanded in F around -inf
Applied rewrites60.9%
if -1.95000000000000009e144 < F < 1.42000000000000006e192Initial program 92.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.f6450.9
Applied rewrites50.9%
Applied rewrites50.9%
Taylor expanded in x around 0
Applied rewrites50.9%
if 1.42000000000000006e192 < F Initial program 36.0%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites50.7%
Taylor expanded in B around 0
Applied rewrites48.8%
(FPCore (F B x)
:precision binary64
(if (<= F -2e+155)
(/ (- -1.0 x) B)
(if (<= F 1.42e+192)
(/ (- (/ F (sqrt (fma F F 2.0))) x) B)
(/
(- (fma (+ 0.16666666666666666 (* 0.3333333333333333 x)) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e+155) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.42e+192) {
tmp = ((F / sqrt(fma(F, F, 2.0))) - x) / B;
} else {
tmp = (fma((0.16666666666666666 + (0.3333333333333333 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2e+155) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.42e+192) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) - x) / B); else tmp = Float64(Float64(fma(Float64(0.16666666666666666 + Float64(0.3333333333333333 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2e+155], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.42e+192], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.16666666666666666 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{+155}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.42 \cdot 10^{+192}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.00000000000000001e155Initial program 17.1%
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.f6431.7
Applied rewrites31.7%
Taylor expanded in F around -inf
Applied rewrites62.5%
if -2.00000000000000001e155 < F < 1.42000000000000006e192Initial program 92.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.8%
Taylor expanded in x around 0
Applied rewrites50.7%
if 1.42000000000000006e192 < F Initial program 36.0%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.7
Applied rewrites99.7%
Taylor expanded in B around 0
Applied rewrites50.7%
Taylor expanded in B around 0
Applied rewrites48.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.4)
(/ (- -1.0 x) B)
(if (<= F 880000000000.0)
(/ (- (/ F (sqrt (fma 2.0 x 2.0))) x) B)
(/
(- (fma (+ 0.16666666666666666 (* 0.3333333333333333 x)) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.4) {
tmp = (-1.0 - x) / B;
} else if (F <= 880000000000.0) {
tmp = ((F / sqrt(fma(2.0, x, 2.0))) - x) / B;
} else {
tmp = (fma((0.16666666666666666 + (0.3333333333333333 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 880000000000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, 2.0))) - x) / B); else tmp = Float64(Float64(fma(Float64(0.16666666666666666 + Float64(0.3333333333333333 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.4], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 880000000000.0], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(0.16666666666666666 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 880000000000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 56.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.4
Applied rewrites36.4%
Taylor expanded in F around -inf
Applied rewrites51.4%
if -1.3999999999999999 < F < 8.8e11Initial program 99.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.f6453.1
Applied rewrites53.1%
Applied rewrites53.1%
Taylor expanded in F around 0
Applied rewrites52.0%
if 8.8e11 < F Initial program 62.2%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6499.8
Applied rewrites99.8%
Taylor expanded in B around 0
Applied rewrites55.2%
Taylor expanded in B around 0
Applied rewrites50.6%
(FPCore (F B x)
:precision binary64
(if (<= F -7e-72)
(/ (- -1.0 x) B)
(if (<= F 1e-44)
(/ (- x) B)
(/
(- (fma (+ 0.16666666666666666 (* 0.3333333333333333 x)) (* B B) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-72) {
tmp = (-1.0 - x) / B;
} else if (F <= 1e-44) {
tmp = -x / B;
} else {
tmp = (fma((0.16666666666666666 + (0.3333333333333333 * x)), (B * B), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7e-72) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1e-44) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(fma(Float64(0.16666666666666666 + Float64(0.3333333333333333 * x)), Float64(B * B), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7e-72], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1e-44], N[((-x) / B), $MachinePrecision], N[(N[(N[(N[(0.16666666666666666 + N[(0.3333333333333333 * x), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-72}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 10^{-44}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(0.16666666666666666 + 0.3333333333333333 \cdot x, B \cdot B, 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -7.00000000000000001e-72Initial program 64.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.3
Applied rewrites42.3%
Taylor expanded in F around -inf
Applied rewrites46.5%
if -7.00000000000000001e-72 < F < 9.99999999999999953e-45Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6452.0
Applied rewrites52.0%
Taylor expanded in F around 0
Applied rewrites39.7%
if 9.99999999999999953e-45 < F Initial program 68.9%
Taylor expanded in F around inf
lower--.f64N/A
lower-/.f64N/A
lower-sin.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-/.f64N/A
lower-sin.f6492.5
Applied rewrites92.5%
Taylor expanded in B around 0
Applied rewrites51.4%
Taylor expanded in B around 0
Applied rewrites46.6%
(FPCore (F B x) :precision binary64 (if (<= F -7e-72) (/ (- -1.0 x) B) (if (<= F 5e-174) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-72) {
tmp = (-1.0 - x) / B;
} else if (F <= 5e-174) {
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 <= (-7d-72)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 5d-174) 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 <= -7e-72) {
tmp = (-1.0 - x) / B;
} else if (F <= 5e-174) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7e-72: tmp = (-1.0 - x) / B elif F <= 5e-174: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7e-72) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 5e-174) 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 <= -7e-72) tmp = (-1.0 - x) / B; elseif (F <= 5e-174) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7e-72], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5e-174], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-72}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-174}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -7.00000000000000001e-72Initial program 64.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.3
Applied rewrites42.3%
Taylor expanded in F around -inf
Applied rewrites46.5%
if -7.00000000000000001e-72 < F < 5.0000000000000002e-174Initial 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.f6457.7
Applied rewrites57.7%
Taylor expanded in F around 0
Applied rewrites45.7%
if 5.0000000000000002e-174 < F Initial program 74.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.f6440.4
Applied rewrites40.4%
Taylor expanded in F around inf
Applied rewrites41.6%
(FPCore (F B x) :precision binary64 (if (<= F -7e-72) (/ (- -1.0 x) B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -7e-72) {
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 <= (-7d-72)) 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 <= -7e-72) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7e-72: tmp = (-1.0 - x) / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7e-72) 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 <= -7e-72) tmp = (-1.0 - x) / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7e-72], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7 \cdot 10^{-72}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -7.00000000000000001e-72Initial program 64.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.3
Applied rewrites42.3%
Taylor expanded in F around -inf
Applied rewrites46.5%
if -7.00000000000000001e-72 < F Initial program 84.1%
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.8
Applied rewrites46.8%
Taylor expanded in F around 0
Applied rewrites30.7%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 78.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
associate-+r+N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-neg.f6445.5
Applied rewrites45.5%
Taylor expanded in F around 0
Applied rewrites29.0%
herbie shell --seed 2024321
(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))))))