
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.6e+54)
(fma (/ (- x) (sin B)) (cos B) (/ -1.0 (sin B)))
(if (<= F 6e-11)
(fma (pow (fma 2.0 x (fma F F 2.0)) -0.5) (/ F (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 <= -1.6e+54) {
tmp = fma((-x / sin(B)), cos(B), (-1.0 / sin(B)));
} else if (F <= 6e-11) {
tmp = fma(pow(fma(2.0, x, fma(F, F, 2.0)), -0.5), (F / 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 <= -1.6e+54) tmp = fma(Float64(Float64(-x) / sin(B)), cos(B), Float64(-1.0 / sin(B))); elseif (F <= 6e-11) tmp = fma((fma(2.0, x, fma(F, F, 2.0)) ^ -0.5), Float64(F / sin(B)), Float64(-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, -1.6e+54], N[(N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Cos[B], $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-11], N[(N[Power[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $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 -1.6 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{\sin B}, \cos B, \frac{-1}{\sin B}\right)\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left({\left(\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{F}{\sin B}, -t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.6e54Initial program 54.8%
Taylor expanded in F around -inf
lower-/.f6472.6
Simplified72.6%
lift-tan.f64N/A
clear-numN/A
un-div-invN/A
/-rgt-identityN/A
distribute-frac-negN/A
lift-neg.f64N/A
lift-tan.f64N/A
tan-quotN/A
lift-sin.f64N/A
associate-/r/N/A
lift-sin.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-cos.f6472.7
lift-*.f64N/A
Applied egg-rr99.8%
if -1.6e54 < F < 6e-11Initial program 99.5%
Applied egg-rr99.7%
if 6e-11 < F Initial program 51.7%
Applied egg-rr64.8%
Applied egg-rr64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Simplified99.9%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) (/ -1.0 2.0)))))
(t_1
(-
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B))
(* x (/ 1.0 (tan B))))))
(if (<= t_0 -1000.0)
t_1
(if (<= t_0 4000000.0)
(/ (fma F (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (- x)) (sin B))
(if (<= t_0 5e+300) t_1 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), (-1.0 / 2.0)));
double t_1 = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x * (1.0 / tan(B)));
double tmp;
if (t_0 <= -1000.0) {
tmp = t_1;
} else if (t_0 <= 4000000.0) {
tmp = fma(F, sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))), -x) / sin(B);
} else if (t_0 <= 5e+300) {
tmp = t_1;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ Float64(-1.0 / 2.0)))) t_1 = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B)))) tmp = 0.0 if (t_0 <= -1000.0) tmp = t_1; elseif (t_0 <= 4000000.0) tmp = Float64(fma(F, sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))), Float64(-x)) / sin(B)); elseif (t_0 <= 5e+300) tmp = t_1; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(-1.0 / 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, -1000.0], t$95$1, If[LessEqual[t$95$0, 4000000.0], N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$0, 5e+300], t$95$1, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{\left(\frac{-1}{2}\right)}\\
t_1 := \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;t\_0 \leq -1000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_0 \leq 4000000:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}}, -x\right)}{\sin B}\\
\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if (+.f64 (neg.f64 (*.f64 x (/.f64 #s(literal 1 binary64) (tan.f64 B)))) (*.f64 (/.f64 F (sin.f64 B)) (pow.f64 (+.f64 (+.f64 (*.f64 F F) #s(literal 2 binary64)) (*.f64 #s(literal 2 binary64) x)) (neg.f64 (/.f64 #s(literal 1 binary64) #s(literal 2 binary64)))))) < -1e3 or 4e6 < (+.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)))))) < 5.00000000000000026e300Initial program 97.5%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6497.5
Simplified97.5%
if -1e3 < (+.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)))))) < 4e6Initial program 74.8%
Applied egg-rr74.7%
Applied egg-rr74.8%
Applied egg-rr74.9%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6455.1
Simplified55.1%
if 5.00000000000000026e300 < (+.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 16.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6463.2
Simplified63.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6488.9
Simplified88.9%
Final simplification81.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.08e+198)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 6e-11)
(- (/ (/ 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 <= -1.08e+198) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 6e-11) {
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 <= -1.08e+198) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 6e-11) tmp = Float64(Float64(Float64(F / 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, -1.08e+198], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-11], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 -1.08 \cdot 10^{+198}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.08e198Initial program 29.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Simplified99.7%
if -1.08e198 < F < 6e-11Initial program 95.6%
Applied egg-rr99.6%
Applied egg-rr99.7%
if 6e-11 < F Initial program 51.7%
Applied egg-rr64.8%
Applied egg-rr64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Simplified99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.08e+198)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 1e+19)
(/ (- (/ F (sqrt (fma F F (fma 2.0 x 2.0)))) (* x (cos B))) (sin B))
(- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.08e+198) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 1e+19) {
tmp = ((F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - (x * cos(B))) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.08e+198) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 1e+19) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, fma(2.0, x, 2.0)))) - Float64(x * cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.08e+198], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e+19], N[(N[(N[(F / N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.08 \cdot 10^{+198}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 10^{+19}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}} - x \cdot \cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.08e198Initial program 29.2%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.7
Simplified99.7%
if -1.08e198 < F < 1e19Initial program 95.8%
Applied egg-rr99.6%
Applied egg-rr99.7%
Applied egg-rr99.7%
if 1e19 < F Initial program 48.0%
Applied egg-rr62.1%
Applied egg-rr62.2%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Simplified99.9%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 6e-11)
(/ (- (/ F (sqrt (fma x 2.0 2.0))) (* x (cos B))) (sin B))
(- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 6e-11) {
tmp = ((F / sqrt(fma(x, 2.0, 2.0))) - (x * cos(B))) / sin(B);
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 6e-11) tmp = Float64(Float64(Float64(F / sqrt(fma(x, 2.0, 2.0))) - Float64(x * cos(B))) / sin(B)); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.45], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-11], N[(N[(N[(F / N[Sqrt[N[(x * 2.0 + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(x, 2, 2\right)}} - x \cdot \cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 61.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Simplified99.8%
if -1.44999999999999996 < F < 6e-11Initial program 99.4%
Applied egg-rr99.6%
Applied egg-rr99.6%
Applied egg-rr99.5%
Taylor expanded in F around 0
lower-sqrt.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6499.3
Simplified99.3%
if 6e-11 < F Initial program 51.7%
Applied egg-rr64.8%
Applied egg-rr64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Simplified99.9%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(if (<= F -8e+151)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F -1.35e-116)
(/ (fma F (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (- x)) (sin B))
(if (<= F 6e-11)
(-
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B))
(* x (/ 1.0 (tan B))))
(- (/ 1.0 (sin B)) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e+151) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -1.35e-116) {
tmp = fma(F, sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))), -x) / sin(B);
} else if (F <= 6e-11) {
tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x * (1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8e+151) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -1.35e-116) tmp = Float64(fma(F, sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))), Float64(-x)) / sin(B)); elseif (F <= 6e-11) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8e+151], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.35e-116], N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-11], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{+151}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -1.35 \cdot 10^{-116}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}}, -x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -8.00000000000000014e151Initial program 37.4%
Taylor expanded in F around -inf
lower-/.f6467.7
Simplified67.7%
Taylor expanded in B around 0
lower-/.f6481.8
Simplified81.8%
if -8.00000000000000014e151 < F < -1.35e-116Initial program 92.3%
Applied egg-rr99.6%
Applied egg-rr99.6%
Applied egg-rr99.6%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6489.7
Simplified89.7%
if -1.35e-116 < F < 6e-11Initial program 99.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6491.1
Simplified91.1%
if 6e-11 < F Initial program 51.7%
Applied egg-rr64.8%
Applied egg-rr64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Simplified99.9%
Final simplification92.7%
(FPCore (F B x)
:precision binary64
(if (<= F -8e+151)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F -1.35e-116)
(/ (fma F (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (- x)) (sin B))
(if (<= F 6e-11)
(-
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B))
(* x (/ 1.0 (tan B))))
(/ (- 1.0 (* x (cos B))) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e+151) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -1.35e-116) {
tmp = fma(F, sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))), -x) / sin(B);
} else if (F <= 6e-11) {
tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x * (1.0 / tan(B)));
} else {
tmp = (1.0 - (x * cos(B))) / sin(B);
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -8e+151) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -1.35e-116) tmp = Float64(fma(F, sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))), Float64(-x)) / sin(B)); elseif (F <= 6e-11) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(Float64(1.0 - Float64(x * cos(B))) / sin(B)); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -8e+151], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.35e-116], N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-11], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{+151}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -1.35 \cdot 10^{-116}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}}, -x\right)}{\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -8.00000000000000014e151Initial program 37.4%
Taylor expanded in F around -inf
lower-/.f6467.7
Simplified67.7%
Taylor expanded in B around 0
lower-/.f6481.8
Simplified81.8%
if -8.00000000000000014e151 < F < -1.35e-116Initial program 92.3%
Applied egg-rr99.6%
Applied egg-rr99.6%
Applied egg-rr99.6%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6489.7
Simplified89.7%
if -1.35e-116 < F < 6e-11Initial program 99.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6491.1
Simplified91.1%
if 6e-11 < F Initial program 51.7%
Applied egg-rr64.8%
Applied egg-rr64.8%
Applied egg-rr64.7%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-cos.f64N/A
lower-sin.f6499.8
Simplified99.8%
Final simplification92.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3700.0)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 (sin B)))
(if (<= F 6e-11)
(-
(* (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (/ F B))
(* x (/ 1.0 (tan B))))
(- (/ 1.0 (sin B)) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3700.0) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / sin(B));
} else if (F <= 6e-11) {
tmp = (sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * (F / B)) - (x * (1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - (x / tan(B));
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -3700.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / sin(B))); elseif (F <= 6e-11) tmp = Float64(Float64(sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))) * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -3700.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6e-11], N[(N[(N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3700:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-11}:\\
\;\;\;\;\sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}} \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -3700Initial program 61.5%
Taylor expanded in F around -inf
lower-/.f64N/A
lower-sin.f6499.8
Simplified99.8%
if -3700 < F < 6e-11Initial program 99.4%
Taylor expanded in B around 0
*-commutativeN/A
lower-*.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-/.f6488.0
Simplified88.0%
if 6e-11 < F Initial program 51.7%
Applied egg-rr64.8%
Applied egg-rr64.8%
Taylor expanded in F around inf
lower-/.f64N/A
lower-sin.f6499.9
Simplified99.9%
Final simplification94.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ x (tan B)))))
(if (<= x -0.118)
t_0
(if (<= x 6e-22)
(/ (fma F (sqrt (/ 1.0 (+ 2.0 (fma x 2.0 (* F F))))) (- x)) (sin B))
t_0))))
double code(double F, double B, double x) {
double t_0 = -(x / tan(B));
double tmp;
if (x <= -0.118) {
tmp = t_0;
} else if (x <= 6e-22) {
tmp = fma(F, sqrt((1.0 / (2.0 + fma(x, 2.0, (F * F))))), -x) / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(-Float64(x / tan(B))) tmp = 0.0 if (x <= -0.118) tmp = t_0; elseif (x <= 6e-22) tmp = Float64(fma(F, sqrt(Float64(1.0 / Float64(2.0 + fma(x, 2.0, Float64(F * F))))), Float64(-x)) / sin(B)); else tmp = t_0; end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -0.118], t$95$0, If[LessEqual[x, 6e-22], N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -\frac{x}{\tan B}\\
\mathbf{if}\;x \leq -0.118:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-22}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{2 + \mathsf{fma}\left(x, 2, F \cdot F\right)}}, -x\right)}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -0.11799999999999999 or 5.9999999999999998e-22 < x Initial program 82.5%
Applied egg-rr98.4%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6498.0
Simplified98.0%
lift-neg.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
clear-numN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
un-div-invN/A
lower-/.f6498.4
Applied egg-rr98.4%
if -0.11799999999999999 < x < 5.9999999999999998e-22Initial program 69.9%
Applied egg-rr73.5%
Applied egg-rr73.6%
Applied egg-rr73.6%
Taylor expanded in B around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-neg.f6463.3
Simplified63.3%
Final simplification79.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (fma F F (fma 2.0 x 2.0)))))
(if (<= B 0.00024)
(/
(fma
(fma F (/ 0.16666666666666666 t_0) (* x 0.3333333333333333))
(* B B)
(- (/ F t_0) x))
B)
(- (/ x (tan B))))))
double code(double F, double B, double x) {
double t_0 = sqrt(fma(F, F, fma(2.0, x, 2.0)));
double tmp;
if (B <= 0.00024) {
tmp = fma(fma(F, (0.16666666666666666 / t_0), (x * 0.3333333333333333)), (B * B), ((F / t_0) - x)) / B;
} else {
tmp = -(x / tan(B));
}
return tmp;
}
function code(F, B, x) t_0 = sqrt(fma(F, F, fma(2.0, x, 2.0))) tmp = 0.0 if (B <= 0.00024) tmp = Float64(fma(fma(F, Float64(0.16666666666666666 / t_0), Float64(x * 0.3333333333333333)), Float64(B * B), Float64(Float64(F / t_0) - x)) / B); else tmp = Float64(-Float64(x / tan(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(F * F + N[(2.0 * x + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[B, 0.00024], N[(N[(N[(F * N[(0.16666666666666666 / t$95$0), $MachinePrecision] + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] * N[(B * B), $MachinePrecision] + N[(N[(F / t$95$0), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], (-N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision])]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\mathsf{fma}\left(F, F, \mathsf{fma}\left(2, x, 2\right)\right)}\\
\mathbf{if}\;B \leq 0.00024:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(F, \frac{0.16666666666666666}{t\_0}, x \cdot 0.3333333333333333\right), B \cdot B, \frac{F}{t\_0} - x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 2.40000000000000006e-4Initial program 74.4%
Applied egg-rr86.8%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Simplified59.2%
Applied egg-rr59.2%
if 2.40000000000000006e-4 < B Initial program 78.8%
Applied egg-rr78.9%
Taylor expanded in F around 0
mul-1-negN/A
associate-/l*N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-cos.f64N/A
lower-sin.f6460.6
Simplified60.6%
lift-neg.f64N/A
lift-cos.f64N/A
lift-sin.f64N/A
clear-numN/A
lift-sin.f64N/A
lift-cos.f64N/A
tan-quotN/A
lift-tan.f64N/A
un-div-invN/A
lower-/.f6460.9
Applied egg-rr60.9%
Final simplification59.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+247)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 5.6e+131)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 (fma F F 2.0)))) (- x)) B)
(/
(- (fma (* B B) (fma x 0.3333333333333333 0.16666666666666666) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+247) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 5.6e+131) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, fma(F, F, 2.0)))), -x) / B;
} else {
tmp = (fma((B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+247) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 5.6e+131) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, fma(F, F, 2.0)))), Float64(-x)) / B); else tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+247], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.6e+131], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+247}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{+131}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, 0.16666666666666666\right), 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.29999999999999995e247Initial program 29.8%
Taylor expanded in F around -inf
lower-/.f6448.8
Simplified48.8%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6460.3
Simplified60.3%
if -1.29999999999999995e247 < F < 5.6000000000000001e131Initial program 94.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6452.8
Simplified52.8%
if 5.6000000000000001e131 < F Initial program 28.4%
Applied egg-rr46.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Simplified21.9%
Taylor expanded in F around inf
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6450.0
Simplified50.0%
(FPCore (F B x)
:precision binary64
(if (<= F -1.3e+247)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 5.6e+131)
(/ (- (/ F (sqrt (fma 2.0 x (fma F F 2.0)))) x) B)
(/
(- (fma (* B B) (fma x 0.3333333333333333 0.16666666666666666) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.3e+247) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 5.6e+131) {
tmp = ((F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B;
} else {
tmp = (fma((B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -1.3e+247) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 5.6e+131) tmp = Float64(Float64(Float64(F / sqrt(fma(2.0, x, fma(F, F, 2.0)))) - x) / B); else tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -1.3e+247], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.6e+131], N[(N[(N[(F / N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.3 \cdot 10^{+247}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{+131}:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, 0.16666666666666666\right), 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -1.29999999999999995e247Initial program 29.8%
Taylor expanded in F around -inf
lower-/.f6448.8
Simplified48.8%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6460.3
Simplified60.3%
if -1.29999999999999995e247 < F < 5.6000000000000001e131Initial program 94.3%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6452.8
Simplified52.8%
lift-fma.f64N/A
lift-fma.f64N/A
lift-/.f64N/A
lift-sqrt.f64N/A
lift-neg.f64N/A
lift-fma.f64N/A
lift-/.f6452.8
Applied egg-rr52.8%
if 5.6000000000000001e131 < F Initial program 28.4%
Applied egg-rr46.6%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Simplified21.9%
Taylor expanded in F around inf
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6450.0
Simplified50.0%
(FPCore (F B x)
:precision binary64
(if (<= F -7.8e+36)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 7e+18)
(/ (fma F (sqrt (/ 1.0 (fma x 2.0 2.0))) (- x)) B)
(/
(- (fma (* B B) (fma x 0.3333333333333333 0.16666666666666666) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.8e+36) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 7e+18) {
tmp = fma(F, sqrt((1.0 / fma(x, 2.0, 2.0))), -x) / B;
} else {
tmp = (fma((B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -7.8e+36) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 7e+18) tmp = Float64(fma(F, sqrt(Float64(1.0 / fma(x, 2.0, 2.0))), Float64(-x)) / B); else tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -7.8e+36], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 7e+18], N[(N[(F * N[Sqrt[N[(1.0 / N[(x * 2.0 + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + (-x)), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.8 \cdot 10^{+36}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+18}:\\
\;\;\;\;\frac{\mathsf{fma}\left(F, \sqrt{\frac{1}{\mathsf{fma}\left(x, 2, 2\right)}}, -x\right)}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, 0.16666666666666666\right), 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -7.80000000000000042e36Initial program 58.5%
Taylor expanded in F around -inf
lower-/.f6474.8
Simplified74.8%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6459.5
Simplified59.5%
if -7.80000000000000042e36 < F < 7e18Initial program 99.5%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.6
Simplified51.6%
Taylor expanded in F around 0
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-neg.f6451.4
Simplified51.4%
if 7e18 < F Initial program 48.0%
Applied egg-rr62.1%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Simplified29.9%
Taylor expanded in F around inf
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6449.9
Simplified49.9%
(FPCore (F B x)
:precision binary64
(if (<= F -2.05e-7)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 5.2e-45)
(- (/ x B))
(/
(- (fma (* B B) (fma x 0.3333333333333333 0.16666666666666666) 1.0) x)
B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.05e-7) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 5.2e-45) {
tmp = -(x / B);
} else {
tmp = (fma((B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.05e-7) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 5.2e-45) tmp = Float64(-Float64(x / B)); else tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, 0.16666666666666666), 1.0) - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.05e-7], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.2e-45], (-N[(x / B), $MachinePrecision]), N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + 0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{-45}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, 0.16666666666666666\right), 1\right) - x}{B}\\
\end{array}
\end{array}
if F < -2.05e-7Initial program 62.9%
Taylor expanded in F around -inf
lower-/.f6475.9
Simplified75.9%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6457.1
Simplified57.1%
if -2.05e-7 < F < 5.19999999999999973e-45Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6452.4
Simplified52.4%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6435.9
Simplified35.9%
if 5.19999999999999973e-45 < F Initial program 54.8%
Applied egg-rr67.0%
Taylor expanded in B around 0
mul-1-negN/A
+-commutativeN/A
sub-negN/A
lower-/.f64N/A
Simplified31.6%
Taylor expanded in F around inf
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6446.0
Simplified46.0%
Final simplification44.1%
(FPCore (F B x)
:precision binary64
(if (<= F -2.05e-7)
(/
(- (fma (* B B) (fma x 0.3333333333333333 -0.16666666666666666) -1.0) x)
B)
(if (<= F 9e-45) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.05e-7) {
tmp = (fma((B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B;
} else if (F <= 9e-45) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
function code(F, B, x) tmp = 0.0 if (F <= -2.05e-7) tmp = Float64(Float64(fma(Float64(B * B), fma(x, 0.3333333333333333, -0.16666666666666666), -1.0) - x) / B); elseif (F <= 9e-45) tmp = Float64(-Float64(x / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
code[F_, B_, x_] := If[LessEqual[F, -2.05e-7], N[(N[(N[(N[(B * B), $MachinePrecision] * N[(x * 0.3333333333333333 + -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9e-45], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{\mathsf{fma}\left(B \cdot B, \mathsf{fma}\left(x, 0.3333333333333333, -0.16666666666666666\right), -1\right) - x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-45}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.05e-7Initial program 62.9%
Taylor expanded in F around -inf
lower-/.f6475.9
Simplified75.9%
Taylor expanded in B around 0
lower-/.f64N/A
associate--r+N/A
lower--.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6457.1
Simplified57.1%
if -2.05e-7 < F < 8.9999999999999997e-45Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6452.4
Simplified52.4%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6435.9
Simplified35.9%
if 8.9999999999999997e-45 < F Initial program 54.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6431.4
Simplified31.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6445.7
Simplified45.7%
Final simplification44.0%
(FPCore (F B x) :precision binary64 (if (<= F -4.6e-10) (/ (- -1.0 x) B) (if (<= F 9e-45) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-10) {
tmp = (-1.0 - x) / B;
} else if (F <= 9e-45) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.6d-10)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9d-45) then
tmp = -(x / b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-10) {
tmp = (-1.0 - x) / B;
} else if (F <= 9e-45) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.6e-10: tmp = (-1.0 - x) / B elif F <= 9e-45: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.6e-10) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9e-45) tmp = Float64(-Float64(x / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.6e-10) tmp = (-1.0 - x) / B; elseif (F <= 9e-45) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.6e-10], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9e-45], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.6 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-45}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.60000000000000014e-10Initial program 62.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.1
Simplified51.1%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6456.3
Simplified56.3%
if -4.60000000000000014e-10 < F < 8.9999999999999997e-45Initial program 99.4%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6452.4
Simplified52.4%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6435.9
Simplified35.9%
if 8.9999999999999997e-45 < F Initial program 54.8%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6431.4
Simplified31.4%
Taylor expanded in F around inf
lower-/.f64N/A
lower--.f6445.7
Simplified45.7%
Final simplification43.9%
(FPCore (F B x) :precision binary64 (if (<= F -4.6e-10) (/ (- -1.0 x) B) (- (/ x B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-10) {
tmp = (-1.0 - x) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.6d-10)) then
tmp = ((-1.0d0) - x) / b
else
tmp = -(x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.6e-10) {
tmp = (-1.0 - x) / B;
} else {
tmp = -(x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.6e-10: tmp = (-1.0 - x) / B else: tmp = -(x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.6e-10) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(-Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.6e-10) tmp = (-1.0 - x) / B; else tmp = -(x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.6e-10], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], (-N[(x / B), $MachinePrecision])]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.6 \cdot 10^{-10}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;-\frac{x}{B}\\
\end{array}
\end{array}
if F < -4.60000000000000014e-10Initial program 62.9%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6451.1
Simplified51.1%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6456.3
Simplified56.3%
if -4.60000000000000014e-10 < F Initial program 79.1%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6442.8
Simplified42.8%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6428.5
Simplified28.5%
Final simplification34.6%
(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 75.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6444.6
Simplified44.6%
Taylor expanded in F around 0
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
lower-neg.f6430.4
Simplified30.4%
Final simplification30.4%
(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.6%
Taylor expanded in B around 0
lower-/.f64N/A
sub-negN/A
lower-fma.f64N/A
lower-sqrt.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-neg.f6444.6
Simplified44.6%
Taylor expanded in F around -inf
associate-*r/N/A
mul-1-negN/A
lower-/.f64N/A
distribute-neg-inN/A
metadata-evalN/A
unsub-negN/A
lower--.f6427.4
Simplified27.4%
Taylor expanded in x around 0
lower-/.f647.7
Simplified7.7%
herbie shell --seed 2024210
(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))))))