
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.1e+60)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 40000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (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 <= -2.1e+60) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 40000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / 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 <= -2.1e+60) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 40000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / 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, -2.1e+60], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 40000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.1 \cdot 10^{+60}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.1000000000000001e60Initial program 61.5%
Simplified75.1%
Taylor expanded in F around -inf 99.8%
if -2.1000000000000001e60 < F < 4e7Initial program 98.8%
Simplified99.6%
if 4e7 < F Initial program 61.6%
Simplified79.7%
Taylor expanded in F around inf 99.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.7e+59)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 120000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.7e+59) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2.7d+59)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 120000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2.7e+59) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.7e+59: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 120000000.0: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.7e+59) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 120000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.7e+59) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 120000000.0) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.7e+59], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.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], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.7 \cdot 10^{+59}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.7000000000000001e59Initial program 60.6%
Simplified75.5%
Taylor expanded in F around -inf 99.8%
if -2.7000000000000001e59 < F < 1.2e8Initial program 99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
if 1.2e8 < F Initial program 61.6%
Simplified79.7%
Taylor expanded in F around inf 99.9%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 6.2e-18)
(- (* F (/ (sqrt 0.5) (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.45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 6.2e-18) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 6.2d-18) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 6.2e-18) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.45: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 6.2e-18: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 6.2e-18) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.45) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 6.2e-18) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.2e-18], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-18}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 67.1%
Simplified79.5%
Taylor expanded in F around -inf 99.7%
if -1.44999999999999996 < F < 6.20000000000000014e-18Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.0%
*-commutative99.0%
Simplified99.0%
Taylor expanded in x around 0 99.0%
if 6.20000000000000014e-18 < F Initial program 65.3%
Simplified81.6%
Taylor expanded in F around inf 97.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.1e-7)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2.1e-101)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (sin B))) (/ x B))
(if (<= F 53.0)
(+
(* x (/ -1.0 (tan B)))
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F B)))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.1e-7) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2.1e-101) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - (x / B);
} else if (F <= 53.0) {
tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.1d-7)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2.1d-101)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / sin(b))) - (x / b)
else if (f <= 53.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.1e-7) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2.1e-101) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / Math.sin(B))) - (x / B);
} else if (F <= 53.0) {
tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.1e-7: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2.1e-101: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / math.sin(B))) - (x / B) elif F <= 53.0: tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.1e-7) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2.1e-101) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / sin(B))) - Float64(x / B)); elseif (F <= 53.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.1e-7) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2.1e-101) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - (x / B); elseif (F <= 53.0) tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.1e-7], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2.1e-101], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 53.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2.1 \cdot 10^{-101}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 53:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.1000000000000001e-7Initial program 68.0%
Simplified80.1%
Taylor expanded in F around -inf 98.6%
if -1.1000000000000001e-7 < F < -2.10000000000000016e-101Initial program 99.2%
Simplified99.4%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 86.4%
if -2.10000000000000016e-101 < F < 53Initial program 99.5%
Taylor expanded in B around 0 82.9%
if 53 < F Initial program 63.3%
Simplified80.5%
Taylor expanded in F around inf 98.6%
Final simplification92.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (t_1 (/ x (tan B))))
(if (<= F -1.05e-7)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -6.8e-102)
(- (* F (/ t_0 (sin B))) (/ x B))
(if (<= F 7e-22) (- (* (/ F B) t_0) t_1) (- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / tan(B);
double tmp;
if (F <= -1.05e-7) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -6.8e-102) {
tmp = (F * (t_0 / sin(B))) - (x / B);
} else if (F <= 7e-22) {
tmp = ((F / B) * t_0) - t_1;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
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) :: t_1
real(8) :: tmp
t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = x / tan(b)
if (f <= (-1.05d-7)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-6.8d-102)) then
tmp = (f * (t_0 / sin(b))) - (x / b)
else if (f <= 7d-22) then
tmp = ((f / b) * t_0) - t_1
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -1.05e-7) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -6.8e-102) {
tmp = (F * (t_0 / Math.sin(B))) - (x / B);
} else if (F <= 7e-22) {
tmp = ((F / B) * t_0) - t_1;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = x / math.tan(B) tmp = 0 if F <= -1.05e-7: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -6.8e-102: tmp = (F * (t_0 / math.sin(B))) - (x / B) elif F <= 7e-22: tmp = ((F / B) * t_0) - t_1 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.05e-7) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -6.8e-102) tmp = Float64(Float64(F * Float64(t_0 / sin(B))) - Float64(x / B)); elseif (F <= 7e-22) tmp = Float64(Float64(Float64(F / B) * t_0) - t_1); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = x / tan(B); tmp = 0.0; if (F <= -1.05e-7) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -6.8e-102) tmp = (F * (t_0 / sin(B))) - (x / B); elseif (F <= 7e-22) tmp = ((F / B) * t_0) - t_1; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.05e-7], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -6.8e-102], N[(N[(F * N[(t$95$0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-22], N[(N[(N[(F / B), $MachinePrecision] * t$95$0), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.05 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -6.8 \cdot 10^{-102}:\\
\;\;\;\;F \cdot \frac{t\_0}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-22}:\\
\;\;\;\;\frac{F}{B} \cdot t\_0 - t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -1.05e-7Initial program 68.0%
Simplified80.1%
Taylor expanded in F around -inf 98.6%
if -1.05e-7 < F < -6.80000000000000026e-102Initial program 99.2%
Simplified99.4%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 86.4%
if -6.80000000000000026e-102 < F < 7.00000000000000011e-22Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 83.2%
if 7.00000000000000011e-22 < F Initial program 65.7%
Simplified81.8%
Taylor expanded in F around inf 96.4%
Final simplification91.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.1e-7)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.56e-114)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 5.4e-102)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 6e-18)
(* F (/ (sqrt 0.5) (sin B)))
(- (/ 1.0 (sin B)) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.1e-7) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.56e-114) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 5.4e-102) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 6e-18) {
tmp = F * (sqrt(0.5) / sin(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.1d-7)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.56d-114)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 5.4d-102) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 6d-18) then
tmp = f * (sqrt(0.5d0) / sin(b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.1e-7) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.56e-114) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 5.4e-102) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 6e-18) {
tmp = F * (Math.sqrt(0.5) / Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.1e-7: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.56e-114: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 5.4e-102: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 6e-18: tmp = F * (math.sqrt(0.5) / math.sin(B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.1e-7) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.56e-114) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 5.4e-102) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 6e-18) tmp = Float64(F * Float64(sqrt(0.5) / sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.1e-7) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.56e-114) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 5.4e-102) tmp = (x * cos(B)) / -sin(B); elseif (F <= 6e-18) tmp = F * (sqrt(0.5) / sin(B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.1e-7], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.56e-114], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e-102], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 6e-18], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.56 \cdot 10^{-114}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-102}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 6 \cdot 10^{-18}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.1000000000000001e-7Initial program 68.0%
Simplified80.1%
Taylor expanded in F around -inf 98.6%
if -1.1000000000000001e-7 < F < -1.5599999999999999e-114Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 59.5%
if -1.5599999999999999e-114 < F < 5.4e-102Initial program 99.6%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 75.1%
associate-*r/75.1%
mul-1-neg75.1%
Simplified75.1%
if 5.4e-102 < F < 5.99999999999999966e-18Initial program 99.1%
Simplified99.1%
Taylor expanded in F around 0 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 80.1%
associate-/l*80.1%
Simplified80.1%
if 5.99999999999999966e-18 < F Initial program 65.3%
Simplified81.6%
Taylor expanded in F around inf 97.6%
Final simplification87.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.1e-7)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -4.6e-118)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 3.5e-102)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 4.8e-19)
(* F (/ (sqrt 0.5) (sin B)))
(- (* F (/ 1.0 (* F B))) t_0)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.1e-7) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -4.6e-118) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 3.5e-102) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 4.8e-19) {
tmp = F * (sqrt(0.5) / sin(B));
} else {
tmp = (F * (1.0 / (F * B))) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.1d-7)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-4.6d-118)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 3.5d-102) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 4.8d-19) then
tmp = f * (sqrt(0.5d0) / sin(b))
else
tmp = (f * (1.0d0 / (f * b))) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.1e-7) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -4.6e-118) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 3.5e-102) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 4.8e-19) {
tmp = F * (Math.sqrt(0.5) / Math.sin(B));
} else {
tmp = (F * (1.0 / (F * B))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.1e-7: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -4.6e-118: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 3.5e-102: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 4.8e-19: tmp = F * (math.sqrt(0.5) / math.sin(B)) else: tmp = (F * (1.0 / (F * B))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.1e-7) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -4.6e-118) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 3.5e-102) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 4.8e-19) tmp = Float64(F * Float64(sqrt(0.5) / sin(B))); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.1e-7) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -4.6e-118) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 3.5e-102) tmp = (x * cos(B)) / -sin(B); elseif (F <= 4.8e-19) tmp = F * (sqrt(0.5) / sin(B)); else tmp = (F * (1.0 / (F * B))) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.1e-7], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -4.6e-118], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e-102], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 4.8e-19], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -4.6 \cdot 10^{-118}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{-102}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{-19}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - t\_0\\
\end{array}
\end{array}
if F < -1.1000000000000001e-7Initial program 68.0%
Simplified80.1%
Taylor expanded in F around -inf 98.6%
if -1.1000000000000001e-7 < F < -4.60000000000000042e-118Initial program 99.2%
Simplified99.5%
Taylor expanded in F around 0 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 59.5%
if -4.60000000000000042e-118 < F < 3.49999999999999986e-102Initial program 99.6%
Simplified99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
metadata-eval99.6%
metadata-eval99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
metadata-eval99.6%
+-commutative99.6%
fma-define99.6%
fma-define99.6%
metadata-eval99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
fma-undefine99.6%
*-commutative99.6%
fma-undefine99.6%
unpow299.6%
+-commutative99.6%
fma-define99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
Taylor expanded in F around 0 75.1%
associate-*r/75.1%
mul-1-neg75.1%
Simplified75.1%
if 3.49999999999999986e-102 < F < 4.80000000000000046e-19Initial program 99.1%
Simplified99.1%
Taylor expanded in F around 0 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in x around 0 80.1%
associate-/l*80.1%
Simplified80.1%
if 4.80000000000000046e-19 < F Initial program 65.3%
Simplified81.6%
Taylor expanded in F around inf 97.4%
Taylor expanded in B around 0 77.8%
Final simplification81.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.1e-7)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.25e-98)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (sin B))) (/ x B))
(if (<= F 7e-22)
(- (* F (/ (sqrt 0.5) 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.1e-7) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.25e-98) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - (x / B);
} else if (F <= 7e-22) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.1d-7)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.25d-98)) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / sin(b))) - (x / b)
else if (f <= 7d-22) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.1e-7) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.25e-98) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / Math.sin(B))) - (x / B);
} else if (F <= 7e-22) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.1e-7: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.25e-98: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / math.sin(B))) - (x / B) elif F <= 7e-22: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.1e-7) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.25e-98) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / sin(B))) - Float64(x / B)); elseif (F <= 7e-22) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.1e-7) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.25e-98) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - (x / B); elseif (F <= 7e-22) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.1e-7], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.25e-98], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-22], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / 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.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.25 \cdot 10^{-98}:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-22}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.1000000000000001e-7Initial program 68.0%
Simplified80.1%
Taylor expanded in F around -inf 98.6%
if -1.1000000000000001e-7 < F < -1.25000000000000005e-98Initial program 99.2%
Simplified99.4%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 86.4%
if -1.25000000000000005e-98 < F < 7.00000000000000011e-22Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 83.1%
Taylor expanded in x around 0 83.1%
if 7.00000000000000011e-22 < F Initial program 65.7%
Simplified81.8%
Taylor expanded in F around inf 96.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.0195)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7e-22)
(- (* F (/ (sqrt 0.5) 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 <= -0.0195) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7e-22) {
tmp = (F * (sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.0195d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7d-22) then
tmp = (f * (sqrt(0.5d0) / b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.0195) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7e-22) {
tmp = (F * (Math.sqrt(0.5) / B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.0195: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7e-22: tmp = (F * (math.sqrt(0.5) / B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0195) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7e-22) tmp = Float64(Float64(F * Float64(sqrt(0.5) / B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.0195) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7e-22) tmp = (F * (sqrt(0.5) / B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0195], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7e-22], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / 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 -0.0195:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-22}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.0195Initial program 67.6%
Simplified79.8%
Taylor expanded in F around -inf 98.6%
if -0.0195 < F < 7.00000000000000011e-22Initial program 99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 79.0%
Taylor expanded in x around 0 79.0%
if 7.00000000000000011e-22 < F Initial program 65.7%
Simplified81.8%
Taylor expanded in F around inf 96.4%
(FPCore (F B x) :precision binary64 (if (<= B 0.0155) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B) (* (/ (cos B) (sin B)) (- x))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0155) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (cos(B) / sin(B)) * -x;
}
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 (b <= 0.0155d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (cos(b) / sin(b)) * -x
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 0.0155) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (Math.cos(B) / Math.sin(B)) * -x;
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 0.0155: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (math.cos(B) / math.sin(B)) * -x return tmp
function code(F, B, x) tmp = 0.0 if (B <= 0.0155) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); else tmp = Float64(Float64(cos(B) / sin(B)) * Float64(-x)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 0.0155) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (cos(B) / sin(B)) * -x; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 0.0155], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0155:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{\cos B}{\sin B} \cdot \left(-x\right)\\
\end{array}
\end{array}
if B < 0.0155Initial program 78.0%
Simplified89.1%
Taylor expanded in B around 0 58.4%
unpow258.4%
Applied egg-rr58.4%
if 0.0155 < B Initial program 87.6%
Simplified87.8%
fma-define87.8%
fma-undefine87.8%
*-commutative87.8%
+-commutative87.8%
add-sqr-sqrt87.7%
metadata-eval87.7%
metadata-eval87.7%
unpow-prod-down87.7%
+-commutative87.7%
fma-define87.7%
fma-define87.7%
metadata-eval87.7%
metadata-eval87.7%
+-commutative87.7%
fma-define87.7%
fma-define87.7%
metadata-eval87.7%
Applied egg-rr87.7%
pow-sqr87.7%
metadata-eval87.7%
unpow-187.7%
fma-undefine87.7%
*-commutative87.7%
fma-undefine87.7%
unpow287.7%
+-commutative87.7%
fma-define87.7%
+-commutative87.7%
unpow287.7%
fma-undefine87.7%
Simplified87.7%
Taylor expanded in F around 0 51.4%
mul-1-neg51.4%
associate-/l*51.4%
Simplified51.4%
Final simplification56.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= x -8.8e-46)
t_0
(if (<= x -2.7e-102)
(/ 1.0 B)
(if (<= x -7e-297)
(/ (* F (sqrt 0.5)) B)
(if (<= x 1.95e-70) (/ -1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (x <= -8.8e-46) {
tmp = t_0;
} else if (x <= -2.7e-102) {
tmp = 1.0 / B;
} else if (x <= -7e-297) {
tmp = (F * sqrt(0.5)) / B;
} else if (x <= 1.95e-70) {
tmp = -1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (x <= (-8.8d-46)) then
tmp = t_0
else if (x <= (-2.7d-102)) then
tmp = 1.0d0 / b
else if (x <= (-7d-297)) then
tmp = (f * sqrt(0.5d0)) / b
else if (x <= 1.95d-70) then
tmp = (-1.0d0) / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (x <= -8.8e-46) {
tmp = t_0;
} else if (x <= -2.7e-102) {
tmp = 1.0 / B;
} else if (x <= -7e-297) {
tmp = (F * Math.sqrt(0.5)) / B;
} else if (x <= 1.95e-70) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if x <= -8.8e-46: tmp = t_0 elif x <= -2.7e-102: tmp = 1.0 / B elif x <= -7e-297: tmp = (F * math.sqrt(0.5)) / B elif x <= 1.95e-70: tmp = -1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (x <= -8.8e-46) tmp = t_0; elseif (x <= -2.7e-102) tmp = Float64(1.0 / B); elseif (x <= -7e-297) tmp = Float64(Float64(F * sqrt(0.5)) / B); elseif (x <= 1.95e-70) tmp = Float64(-1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (x <= -8.8e-46) tmp = t_0; elseif (x <= -2.7e-102) tmp = 1.0 / B; elseif (x <= -7e-297) tmp = (F * sqrt(0.5)) / B; elseif (x <= 1.95e-70) tmp = -1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.8e-46], t$95$0, If[LessEqual[x, -2.7e-102], N[(1.0 / B), $MachinePrecision], If[LessEqual[x, -7e-297], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[x, 1.95e-70], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{-46}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-102}:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-297}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B}\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-70}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -8.8000000000000004e-46 or 1.9500000000000001e-70 < x Initial program 85.5%
Simplified98.3%
Taylor expanded in F around -inf 88.7%
Taylor expanded in B around 0 88.9%
if -8.8000000000000004e-46 < x < -2.7e-102Initial program 62.1%
Simplified73.3%
Taylor expanded in F around inf 56.2%
Taylor expanded in B around 0 46.8%
Taylor expanded in x around 0 46.8%
if -2.7e-102 < x < -6.9999999999999998e-297Initial program 88.4%
Simplified88.4%
Taylor expanded in F around 0 72.1%
*-commutative72.1%
Simplified72.1%
Taylor expanded in B around 0 38.9%
Taylor expanded in x around 0 30.7%
if -6.9999999999999998e-297 < x < 1.9500000000000001e-70Initial program 65.4%
Simplified69.5%
Taylor expanded in F around -inf 39.4%
clear-num39.4%
inv-pow39.4%
Applied egg-rr39.4%
unpow-139.4%
Simplified39.4%
Taylor expanded in x around 0 39.4%
(FPCore (F B x)
:precision binary64
(if (<= F -5.2e+81)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F -1.1e-7)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1.72e-90)
(/ (- (* F (sqrt 0.5)) x) B)
(- (* F (/ 1.0 (* F B))) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e+81) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= -1.1e-7) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1.72e-90) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else {
tmp = (F * (1.0 / (F * B))) - (x / tan(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 <= (-5.2d+81)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= (-1.1d-7)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1.72d-90) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else
tmp = (f * (1.0d0 / (f * b))) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e+81) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= -1.1e-7) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1.72e-90) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else {
tmp = (F * (1.0 / (F * B))) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.2e+81: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= -1.1e-7: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1.72e-90: tmp = ((F * math.sqrt(0.5)) - x) / B else: tmp = (F * (1.0 / (F * B))) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.2e+81) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= -1.1e-7) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1.72e-90) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.2e+81) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= -1.1e-7) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1.72e-90) tmp = ((F * sqrt(0.5)) - x) / B; else tmp = (F * (1.0 / (F * B))) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.2e+81], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.1e-7], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.72e-90], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{+81}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq -1.1 \cdot 10^{-7}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.72 \cdot 10^{-90}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -5.19999999999999984e81Initial program 57.2%
Simplified72.4%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 80.8%
div-inv80.9%
Applied egg-rr80.9%
if -5.19999999999999984e81 < F < -1.1000000000000001e-7Initial program 95.3%
Simplified99.4%
Taylor expanded in F around -inf 95.6%
Taylor expanded in B around 0 77.5%
if -1.1000000000000001e-7 < F < 1.72e-90Initial program 99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in B around 0 53.7%
Taylor expanded in x around 0 53.7%
if 1.72e-90 < F Initial program 68.9%
Simplified83.5%
Taylor expanded in F around inf 89.9%
Taylor expanded in B around 0 72.2%
Final simplification67.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1e+220)
(/ (- -1.0 x) B)
(if (<= F -6e-35)
(/ -1.0 (sin B))
(if (<= F 7e-144)
(/ x (- B))
(if (<= F 9.2e-24) (* F (/ (sqrt 0.5) B)) (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1e+220) {
tmp = (-1.0 - x) / B;
} else if (F <= -6e-35) {
tmp = -1.0 / sin(B);
} else if (F <= 7e-144) {
tmp = x / -B;
} else if (F <= 9.2e-24) {
tmp = F * (sqrt(0.5) / 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 <= (-1d+220)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-6d-35)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 7d-144) then
tmp = x / -b
else if (f <= 9.2d-24) then
tmp = f * (sqrt(0.5d0) / 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 <= -1e+220) {
tmp = (-1.0 - x) / B;
} else if (F <= -6e-35) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 7e-144) {
tmp = x / -B;
} else if (F <= 9.2e-24) {
tmp = F * (Math.sqrt(0.5) / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1e+220: tmp = (-1.0 - x) / B elif F <= -6e-35: tmp = -1.0 / math.sin(B) elif F <= 7e-144: tmp = x / -B elif F <= 9.2e-24: tmp = F * (math.sqrt(0.5) / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1e+220) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -6e-35) tmp = Float64(-1.0 / sin(B)); elseif (F <= 7e-144) tmp = Float64(x / Float64(-B)); elseif (F <= 9.2e-24) tmp = Float64(F * Float64(sqrt(0.5) / 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 <= -1e+220) tmp = (-1.0 - x) / B; elseif (F <= -6e-35) tmp = -1.0 / sin(B); elseif (F <= 7e-144) tmp = x / -B; elseif (F <= 9.2e-24) tmp = F * (sqrt(0.5) / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1e+220], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -6e-35], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-144], N[(x / (-B)), $MachinePrecision], If[LessEqual[F, 9.2e-24], N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1 \cdot 10^{+220}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -6 \cdot 10^{-35}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-144}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{elif}\;F \leq 9.2 \cdot 10^{-24}:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1e220Initial program 32.0%
Simplified64.4%
Taylor expanded in F around -inf 99.9%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in B around 0 69.7%
associate-*r/69.7%
distribute-lft-in69.7%
metadata-eval69.7%
neg-mul-169.7%
unsub-neg69.7%
Simplified69.7%
if -1e220 < F < -5.99999999999999978e-35Initial program 82.8%
Simplified87.2%
Taylor expanded in F around -inf 86.8%
clear-num86.8%
inv-pow86.8%
Applied egg-rr86.8%
unpow-186.8%
Simplified86.8%
Taylor expanded in x around 0 49.2%
if -5.99999999999999978e-35 < F < 6.9999999999999997e-144Initial program 99.5%
Simplified99.7%
Taylor expanded in F around inf 25.2%
Taylor expanded in B around 0 27.4%
Taylor expanded in x around inf 39.8%
neg-mul-139.8%
distribute-neg-frac39.8%
Simplified39.8%
if 6.9999999999999997e-144 < F < 9.2000000000000004e-24Initial program 99.3%
Simplified99.4%
Taylor expanded in F around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in B around 0 43.9%
Taylor expanded in x around 0 33.9%
associate-/l*33.9%
Simplified33.9%
if 9.2000000000000004e-24 < F Initial program 65.7%
Simplified81.8%
Taylor expanded in F around inf 96.2%
Taylor expanded in B around 0 51.6%
Final simplification47.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (/ -1.0 B) (/ x (tan B)))))
(if (<= x -3.8e-9)
t_0
(if (<= x -5.3e-297)
(/ (- (* F (sqrt 0.5)) x) B)
(if (<= x 2.7e-72) (/ -1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / tan(B));
double tmp;
if (x <= -3.8e-9) {
tmp = t_0;
} else if (x <= -5.3e-297) {
tmp = ((F * sqrt(0.5)) - x) / B;
} else if (x <= 2.7e-72) {
tmp = -1.0 / sin(B);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = ((-1.0d0) / b) - (x / tan(b))
if (x <= (-3.8d-9)) then
tmp = t_0
else if (x <= (-5.3d-297)) then
tmp = ((f * sqrt(0.5d0)) - x) / b
else if (x <= 2.7d-72) then
tmp = (-1.0d0) / sin(b)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (-1.0 / B) - (x / Math.tan(B));
double tmp;
if (x <= -3.8e-9) {
tmp = t_0;
} else if (x <= -5.3e-297) {
tmp = ((F * Math.sqrt(0.5)) - x) / B;
} else if (x <= 2.7e-72) {
tmp = -1.0 / Math.sin(B);
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = (-1.0 / B) - (x / math.tan(B)) tmp = 0 if x <= -3.8e-9: tmp = t_0 elif x <= -5.3e-297: tmp = ((F * math.sqrt(0.5)) - x) / B elif x <= 2.7e-72: tmp = -1.0 / math.sin(B) else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(Float64(-1.0 / B) - Float64(x / tan(B))) tmp = 0.0 if (x <= -3.8e-9) tmp = t_0; elseif (x <= -5.3e-297) tmp = Float64(Float64(Float64(F * sqrt(0.5)) - x) / B); elseif (x <= 2.7e-72) tmp = Float64(-1.0 / sin(B)); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = (-1.0 / B) - (x / tan(B)); tmp = 0.0; if (x <= -3.8e-9) tmp = t_0; elseif (x <= -5.3e-297) tmp = ((F * sqrt(0.5)) - x) / B; elseif (x <= 2.7e-72) tmp = -1.0 / sin(B); else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e-9], t$95$0, If[LessEqual[x, -5.3e-297], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[x, 2.7e-72], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{-9}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5.3 \cdot 10^{-297}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5} - x}{B}\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-72}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -3.80000000000000011e-9 or 2.7e-72 < x Initial program 85.1%
Simplified99.0%
Taylor expanded in F around -inf 93.2%
Taylor expanded in B around 0 93.9%
if -3.80000000000000011e-9 < x < -5.30000000000000019e-297Initial program 82.9%
Simplified85.4%
Taylor expanded in F around 0 61.0%
*-commutative61.0%
Simplified61.0%
Taylor expanded in B around 0 35.4%
Taylor expanded in x around 0 35.4%
if -5.30000000000000019e-297 < x < 2.7e-72Initial program 65.4%
Simplified69.5%
Taylor expanded in F around -inf 39.4%
clear-num39.4%
inv-pow39.4%
Applied egg-rr39.4%
unpow-139.4%
Simplified39.4%
Taylor expanded in x around 0 39.4%
(FPCore (F B x) :precision binary64 (if (<= B 0.0155) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (+ (* F F) (* x 2.0)))))) x) B) (- (* F (/ 1.0 (* F B))) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= 0.0155) {
tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * B))) - (x / tan(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 (b <= 0.0155d0) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + ((f * f) + (x * 2.0d0)))))) - x) / b
else
tmp = (f * (1.0d0 / (f * b))) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 0.0155) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B;
} else {
tmp = (F * (1.0 / (F * B))) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 0.0155: tmp = ((F * math.sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B else: tmp = (F * (1.0 / (F * B))) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 0.0155) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(Float64(F * F) + Float64(x * 2.0)))))) - x) / B); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * B))) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 0.0155) tmp = ((F * sqrt((1.0 / (2.0 + ((F * F) + (x * 2.0)))))) - x) / B; else tmp = (F * (1.0 / (F * B))) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 0.0155], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(N[(F * F), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(F * N[(1.0 / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 0.0155:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + \left(F \cdot F + x \cdot 2\right)}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 0.0155Initial program 78.0%
Simplified89.1%
Taylor expanded in B around 0 58.4%
unpow258.4%
Applied egg-rr58.4%
if 0.0155 < B Initial program 87.6%
Simplified87.8%
Taylor expanded in F around inf 58.1%
Taylor expanded in B around 0 47.9%
Final simplification55.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.1e+220)
(/ (- -1.0 x) B)
(if (<= F -3.3e-36)
(/ -1.0 (sin B))
(if (<= F 5e-81) (/ x (- B)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e+220) {
tmp = (-1.0 - x) / B;
} else if (F <= -3.3e-36) {
tmp = -1.0 / sin(B);
} else if (F <= 5e-81) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.1d+220)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-3.3d-36)) then
tmp = (-1.0d0) / sin(b)
else if (f <= 5d-81) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e+220) {
tmp = (-1.0 - x) / B;
} else if (F <= -3.3e-36) {
tmp = -1.0 / Math.sin(B);
} else if (F <= 5e-81) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.1e+220: tmp = (-1.0 - x) / B elif F <= -3.3e-36: tmp = -1.0 / math.sin(B) elif F <= 5e-81: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.1e+220) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -3.3e-36) tmp = Float64(-1.0 / sin(B)); elseif (F <= 5e-81) tmp = Float64(x / Float64(-B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.1e+220) tmp = (-1.0 - x) / B; elseif (F <= -3.3e-36) tmp = -1.0 / sin(B); elseif (F <= 5e-81) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.1e+220], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -3.3e-36], N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5e-81], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.1 \cdot 10^{+220}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -3.3 \cdot 10^{-36}:\\
\;\;\;\;\frac{-1}{\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-81}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.09999999999999995e220Initial program 32.0%
Simplified64.4%
Taylor expanded in F around -inf 99.9%
clear-num99.8%
inv-pow99.8%
Applied egg-rr99.8%
unpow-199.8%
Simplified99.8%
div-inv99.8%
Applied egg-rr99.8%
Taylor expanded in B around 0 69.7%
associate-*r/69.7%
distribute-lft-in69.7%
metadata-eval69.7%
neg-mul-169.7%
unsub-neg69.7%
Simplified69.7%
if -1.09999999999999995e220 < F < -3.29999999999999991e-36Initial program 82.8%
Simplified87.2%
Taylor expanded in F around -inf 86.8%
clear-num86.8%
inv-pow86.8%
Applied egg-rr86.8%
unpow-186.8%
Simplified86.8%
Taylor expanded in x around 0 49.2%
if -3.29999999999999991e-36 < F < 4.99999999999999981e-81Initial program 99.5%
Simplified99.7%
Taylor expanded in F around inf 26.4%
Taylor expanded in B around 0 23.9%
Taylor expanded in x around inf 35.1%
neg-mul-135.1%
distribute-neg-frac35.1%
Simplified35.1%
if 4.99999999999999981e-81 < F Initial program 68.9%
Simplified83.5%
Taylor expanded in F around inf 89.9%
Taylor expanded in B around 0 47.1%
Final simplification45.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (- B))))
(if (<= x -1.75e-34)
t_0
(if (<= x -5e-204) (/ 1.0 B) (if (<= x 1.1e-54) (/ -1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (x <= -1.75e-34) {
tmp = t_0;
} else if (x <= -5e-204) {
tmp = 1.0 / B;
} else if (x <= 1.1e-54) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / -b
if (x <= (-1.75d-34)) then
tmp = t_0
else if (x <= (-5d-204)) then
tmp = 1.0d0 / b
else if (x <= 1.1d-54) then
tmp = (-1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (x <= -1.75e-34) {
tmp = t_0;
} else if (x <= -5e-204) {
tmp = 1.0 / B;
} else if (x <= 1.1e-54) {
tmp = -1.0 / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / -B tmp = 0 if x <= -1.75e-34: tmp = t_0 elif x <= -5e-204: tmp = 1.0 / B elif x <= 1.1e-54: tmp = -1.0 / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(x / Float64(-B)) tmp = 0.0 if (x <= -1.75e-34) tmp = t_0; elseif (x <= -5e-204) tmp = Float64(1.0 / B); elseif (x <= 1.1e-54) tmp = Float64(-1.0 / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / -B; tmp = 0.0; if (x <= -1.75e-34) tmp = t_0; elseif (x <= -5e-204) tmp = 1.0 / B; elseif (x <= 1.1e-54) tmp = -1.0 / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / (-B)), $MachinePrecision]}, If[LessEqual[x, -1.75e-34], t$95$0, If[LessEqual[x, -5e-204], N[(1.0 / B), $MachinePrecision], If[LessEqual[x, 1.1e-54], N[(-1.0 / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-B}\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{-34}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-204}:\\
\;\;\;\;\frac{1}{B}\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -1.75e-34 or 1.1e-54 < x Initial program 85.4%
Simplified99.0%
Taylor expanded in F around inf 79.9%
Taylor expanded in B around 0 45.0%
Taylor expanded in x around inf 49.0%
neg-mul-149.0%
distribute-neg-frac49.0%
Simplified49.0%
if -1.75e-34 < x < -5.0000000000000002e-204Initial program 79.7%
Simplified83.9%
Taylor expanded in F around inf 32.8%
Taylor expanded in B around 0 27.5%
Taylor expanded in x around 0 27.5%
if -5.0000000000000002e-204 < x < 1.1e-54Initial program 73.5%
Simplified75.9%
Taylor expanded in F around -inf 33.9%
Taylor expanded in B around 0 24.2%
Taylor expanded in x around 0 19.6%
Final simplification35.5%
(FPCore (F B x) :precision binary64 (if (<= F -3e-39) (/ (- -1.0 x) B) (if (<= F 2.15e-86) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3e-39) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.15e-86) {
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 <= (-3d-39)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.15d-86) 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 <= -3e-39) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.15e-86) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3e-39: tmp = (-1.0 - x) / B elif F <= 2.15e-86: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3e-39) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.15e-86) tmp = Float64(x / Float64(-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 <= -3e-39) tmp = (-1.0 - x) / B; elseif (F <= 2.15e-86) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3e-39], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.15e-86], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{-39}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.15 \cdot 10^{-86}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.00000000000000028e-39Initial program 71.0%
Simplified81.9%
Taylor expanded in F around -inf 89.8%
clear-num89.8%
inv-pow89.8%
Applied egg-rr89.8%
unpow-189.8%
Simplified89.8%
div-inv89.8%
Applied egg-rr89.8%
Taylor expanded in B around 0 42.3%
associate-*r/42.3%
distribute-lft-in42.3%
metadata-eval42.3%
neg-mul-142.3%
unsub-neg42.3%
Simplified42.3%
if -3.00000000000000028e-39 < F < 2.15000000000000007e-86Initial program 99.5%
Simplified99.7%
Taylor expanded in F around inf 26.4%
Taylor expanded in B around 0 23.9%
Taylor expanded in x around inf 35.1%
neg-mul-135.1%
distribute-neg-frac35.1%
Simplified35.1%
if 2.15000000000000007e-86 < F Initial program 68.9%
Simplified83.5%
Taylor expanded in F around inf 89.9%
Taylor expanded in B around 0 47.1%
Final simplification41.3%
(FPCore (F B x) :precision binary64 (if (<= F -7.4e-40) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.4e-40) {
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 <= (-7.4d-40)) 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 <= -7.4e-40) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.4e-40: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.4e-40) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.4e-40) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.4e-40], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.4 \cdot 10^{-40}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -7.39999999999999997e-40Initial program 71.0%
Simplified81.9%
Taylor expanded in F around -inf 89.8%
clear-num89.8%
inv-pow89.8%
Applied egg-rr89.8%
unpow-189.8%
Simplified89.8%
div-inv89.8%
Applied egg-rr89.8%
Taylor expanded in B around 0 42.3%
associate-*r/42.3%
distribute-lft-in42.3%
metadata-eval42.3%
neg-mul-142.3%
unsub-neg42.3%
Simplified42.3%
if -7.39999999999999997e-40 < F Initial program 84.9%
Simplified92.0%
Taylor expanded in F around inf 56.7%
Taylor expanded in B around 0 35.0%
Taylor expanded in x around inf 30.5%
neg-mul-130.5%
distribute-neg-frac30.5%
Simplified30.5%
Final simplification34.3%
(FPCore (F B x) :precision binary64 (if (<= F 7.1e-143) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 7.1e-143) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / 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 <= 7.1d-143) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 7.1e-143) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 7.1e-143: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 7.1e-143) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 7.1e-143) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 7.1e-143], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 7.1 \cdot 10^{-143}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 7.10000000000000033e-143Initial program 84.5%
Simplified90.3%
Taylor expanded in F around -inf 67.4%
Taylor expanded in B around 0 59.2%
Taylor expanded in x around 0 14.4%
if 7.10000000000000033e-143 < F Initial program 74.1%
Simplified86.2%
Taylor expanded in F around inf 80.1%
Taylor expanded in B around 0 40.8%
Taylor expanded in x around 0 21.0%
(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 80.5%
Simplified88.7%
Taylor expanded in F around -inf 59.2%
Taylor expanded in B around 0 54.3%
Taylor expanded in x around 0 9.9%
herbie shell --seed 2024130
(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))))))