
(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 23 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 -500000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 650000.0)
(- (/ (* F (pow (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 <= -500000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 650000.0) {
tmp = ((F * pow(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 <= -500000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 650000.0) tmp = Float64(Float64(Float64(F * (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, -500000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 650000.0], N[(N[(N[(F * N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $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 -500000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 650000:\\
\;\;\;\;\frac{F \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5e11Initial program 68.2%
Simplified77.3%
Taylor expanded in x around 0 77.3%
associate-*l/77.2%
*-lft-identity77.2%
+-commutative77.2%
unpow277.2%
fma-undefine77.2%
Simplified77.2%
Taylor expanded in F around -inf 99.8%
if -5e11 < F < 6.5e5Initial program 99.3%
Simplified99.5%
Taylor expanded in x around 0 99.6%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
associate-*r/99.6%
inv-pow99.6%
sqrt-pow199.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 6.5e5 < F Initial program 48.3%
Simplified69.5%
Taylor expanded in x around 0 69.5%
associate-*l/69.5%
*-lft-identity69.5%
+-commutative69.5%
unpow269.5%
fma-undefine69.5%
Simplified69.5%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -320000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 650000.0)
(+
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(* x (/ -1.0 (tan 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 <= -320000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 650000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / tan(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 <= (-320000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 650000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) + (x * ((-1.0d0) / tan(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 <= -320000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 650000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / Math.tan(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 <= -320000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 650000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) + (x * (-1.0 / math.tan(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 <= -320000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 650000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) + Float64(x * Float64(-1.0 / tan(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 <= -320000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 650000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) + (x * (-1.0 / tan(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, -320000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 650000.0], N[(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] + N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $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 -320000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 650000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} + x \cdot \frac{-1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -3.2e5Initial program 69.1%
Simplified77.9%
Taylor expanded in x around 0 77.9%
associate-*l/77.9%
*-lft-identity77.9%
+-commutative77.9%
unpow277.9%
fma-undefine77.9%
Simplified77.9%
Taylor expanded in F around -inf 99.8%
if -3.2e5 < F < 6.5e5Initial program 99.3%
if 6.5e5 < F Initial program 48.3%
Simplified69.5%
Taylor expanded in x around 0 69.5%
associate-*l/69.5%
*-lft-identity69.5%
+-commutative69.5%
unpow269.5%
fma-undefine69.5%
Simplified69.5%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -45000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 650000.0)
(+
(/ -1.0 (/ (tan B) x))
(* (/ 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 <= -45000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 650000.0) {
tmp = (-1.0 / (tan(B) / x)) + ((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 <= (-45000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 650000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((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 <= -45000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 650000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + ((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 <= -45000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 650000.0: tmp = (-1.0 / (math.tan(B) / x)) + ((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 <= -45000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 650000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + 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 <= -45000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 650000.0) tmp = (-1.0 / (tan(B) / x)) + ((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, -45000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 650000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $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 -45000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 650000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \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 < -4.5e10Initial program 68.2%
Simplified77.3%
Taylor expanded in x around 0 77.3%
associate-*l/77.2%
*-lft-identity77.2%
+-commutative77.2%
unpow277.2%
fma-undefine77.2%
Simplified77.2%
Taylor expanded in F around -inf 99.8%
if -4.5e10 < F < 6.5e5Initial program 99.3%
div-inv99.6%
clear-num99.4%
Applied egg-rr99.4%
if 6.5e5 < F Initial program 48.3%
Simplified69.5%
Taylor expanded in x around 0 69.5%
associate-*l/69.5%
*-lft-identity69.5%
+-commutative69.5%
unpow269.5%
fma-undefine69.5%
Simplified69.5%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -1.5)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 1.4)
(- (* F (* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_1)
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -1.5) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 1.4) {
tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - 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 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-1.5d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 1.4d0) then
tmp = (f * (t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_1
else
tmp = t_0 - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -1.5) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 1.4) {
tmp = (F * (t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1;
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -1.5: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 1.4: tmp = (F * (t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1 else: tmp = t_0 - t_1 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_1); else tmp = Float64(t_0 - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -1.5) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 1.4) tmp = (F * (t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_1; else tmp = t_0 - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \left(t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -1.5Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -1.5 < F < 1.3999999999999999Initial program 99.3%
Simplified99.5%
Taylor expanded in F around 0 98.5%
if 1.3999999999999999 < F Initial program 49.1%
Simplified69.9%
Taylor expanded in x around 0 69.9%
associate-*l/69.9%
*-lft-identity69.9%
+-commutative69.9%
unpow269.9%
fma-undefine69.9%
Simplified69.9%
Taylor expanded in F around inf 99.0%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* 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.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
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.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) 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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
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.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: 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.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) 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.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) 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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], 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.4:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;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.3999999999999999Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -1.3999999999999999 < F < 1.3999999999999999Initial program 99.3%
Simplified99.5%
Taylor expanded in x around 0 99.6%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 98.4%
if 1.3999999999999999 < F Initial program 49.1%
Simplified69.9%
Taylor expanded in x around 0 69.9%
associate-*l/69.9%
*-lft-identity69.9%
+-commutative69.9%
unpow269.9%
fma-undefine69.9%
Simplified69.9%
Taylor expanded in F around inf 99.0%
Final simplification98.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -58000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -2.7e-117)
t_0
(if (<= F 5.6e-108)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 B))) t_1)
(if (<= F 112000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -58000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -2.7e-117) {
tmp = t_0;
} else if (F <= 5.6e-108) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_1;
} else if (F <= 112000.0) {
tmp = t_0;
} 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 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-58000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-2.7d-117)) then
tmp = t_0
else if (f <= 5.6d-108) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / b))) - t_1
else if (f <= 112000.0d0) then
tmp = t_0
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 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -58000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -2.7e-117) {
tmp = t_0;
} else if (F <= 5.6e-108) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_1;
} else if (F <= 112000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -58000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -2.7e-117: tmp = t_0 elif F <= 5.6e-108: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_1 elif F <= 112000.0: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -58000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -2.7e-117) tmp = t_0; elseif (F <= 5.6e-108) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / B))) - t_1); elseif (F <= 112000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -58000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -2.7e-117) tmp = t_0; elseif (F <= 5.6e-108) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / B))) - t_1; elseif (F <= 112000.0) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(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] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -58000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2.7e-117], t$95$0, If[LessEqual[F, 5.6e-108], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 112000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -58000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -2.7 \cdot 10^{-117}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.6 \cdot 10^{-108}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - t\_1\\
\mathbf{elif}\;F \leq 112000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -58000Initial program 69.5%
Simplified78.3%
Taylor expanded in x around 0 78.2%
associate-*l/78.2%
*-lft-identity78.2%
+-commutative78.2%
unpow278.2%
fma-undefine78.2%
Simplified78.2%
Taylor expanded in F around -inf 99.8%
if -58000 < F < -2.70000000000000003e-117 or 5.6e-108 < F < 112000Initial program 99.3%
Taylor expanded in B around 0 95.2%
if -2.70000000000000003e-117 < F < 5.6e-108Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 84.1%
if 112000 < F Initial program 48.3%
Simplified69.5%
Taylor expanded in x around 0 69.5%
associate-*l/69.5%
*-lft-identity69.5%
+-commutative69.5%
unpow269.5%
fma-undefine69.5%
Simplified69.5%
Taylor expanded in F around inf 99.8%
Final simplification94.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -5.2e-6)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -2e-109)
(* (/ F (sin B)) (sqrt 0.5))
(if (<= F 2e-121)
(/ (* x (- (cos B))) (sin B))
(if (<= F 2.8e-8)
(* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (* F t_0))
(- t_0 t_1)))))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -5.2e-6) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -2e-109) {
tmp = (F / sin(B)) * sqrt(0.5);
} else if (F <= 2e-121) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 2.8e-8) {
tmp = sqrt((1.0 / (2.0 + (x * 2.0)))) * (F * t_0);
} else {
tmp = t_0 - 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 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-5.2d-6)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-2d-109)) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else if (f <= 2d-121) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 2.8d-8) then
tmp = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f * t_0)
else
tmp = t_0 - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -5.2e-6) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -2e-109) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else if (F <= 2e-121) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 2.8e-8) {
tmp = Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F * t_0);
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -5.2e-6: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -2e-109: tmp = (F / math.sin(B)) * math.sqrt(0.5) elif F <= 2e-121: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 2.8e-8: tmp = math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F * t_0) else: tmp = t_0 - t_1 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.2e-6) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -2e-109) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); elseif (F <= 2e-121) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 2.8e-8) tmp = Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F * t_0)); else tmp = Float64(t_0 - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -5.2e-6) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -2e-109) tmp = (F / sin(B)) * sqrt(0.5); elseif (F <= 2e-121) tmp = (x * -cos(B)) / sin(B); elseif (F <= 2.8e-8) tmp = sqrt((1.0 / (2.0 + (x * 2.0)))) * (F * t_0); else tmp = t_0 - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.2e-6], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2e-109], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2e-121], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.8e-8], N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F * t$95$0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{-6}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -2 \cdot 10^{-109}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{elif}\;F \leq 2 \cdot 10^{-121}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-8}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \left(F \cdot t\_0\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0 - t\_1\\
\end{array}
\end{array}
if F < -5.20000000000000019e-6Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -5.20000000000000019e-6 < F < -2e-109Initial program 99.5%
Simplified99.3%
Taylor expanded in F around 0 98.4%
Taylor expanded in F around inf 73.1%
Taylor expanded in x around 0 73.3%
if -2e-109 < F < 2e-121Initial program 99.4%
Taylor expanded in F around -inf 35.6%
Taylor expanded in x around inf 77.8%
mul-1-neg77.8%
associate-*r/77.5%
distribute-rgt-neg-in77.5%
distribute-neg-frac277.5%
Simplified77.5%
*-commutative77.5%
distribute-frac-neg277.5%
distribute-frac-neg77.5%
associate-*l/77.8%
Applied egg-rr77.8%
if 2e-121 < F < 2.7999999999999999e-8Initial program 99.1%
Simplified99.0%
Taylor expanded in F around 0 99.1%
Taylor expanded in F around inf 73.5%
div-inv73.8%
Applied egg-rr73.8%
if 2.7999999999999999e-8 < F Initial program 51.2%
Simplified71.2%
Taylor expanded in x around 0 71.2%
associate-*l/71.2%
*-lft-identity71.2%
+-commutative71.2%
unpow271.2%
fma-undefine71.2%
Simplified71.2%
Taylor expanded in F around inf 96.6%
Final simplification88.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.0004)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2e-110)
(* (/ F (sin B)) (sqrt 0.5))
(if (<= F 0.058)
(- (* F (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ 1.0 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.0004) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2e-110) {
tmp = (F / sin(B)) * sqrt(0.5);
} else if (F <= 0.058) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.0004d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2d-110)) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else if (f <= 0.058d0) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (1.0d0 / 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.0004) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2e-110) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else if (F <= 0.058) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.0004: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2e-110: tmp = (F / math.sin(B)) * math.sqrt(0.5) elif F <= 0.058: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.0004) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2e-110) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); elseif (F <= 0.058) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(1.0 / 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.0004) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2e-110) tmp = (F / sin(B)) * sqrt(0.5); elseif (F <= 0.058) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) * (1.0 / 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.0004], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2e-110], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.058], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / 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 -0.0004:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2 \cdot 10^{-110}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{elif}\;F \leq 0.058:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{1}{B}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.00000000000000019e-4Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -4.00000000000000019e-4 < F < -2.0000000000000001e-110Initial program 99.5%
Simplified99.3%
Taylor expanded in F around 0 98.4%
Taylor expanded in F around inf 73.1%
Taylor expanded in x around 0 73.3%
if -2.0000000000000001e-110 < F < 0.0580000000000000029Initial program 99.3%
Simplified99.6%
Taylor expanded in F around 0 98.5%
Taylor expanded in B around 0 77.7%
if 0.0580000000000000029 < F Initial program 49.1%
Simplified69.9%
Taylor expanded in x around 0 69.9%
associate-*l/69.9%
*-lft-identity69.9%
+-commutative69.9%
unpow269.9%
fma-undefine69.9%
Simplified69.9%
Taylor expanded in F around inf 99.0%
Final simplification89.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ F (sin B))) (t_1 (/ x (tan B))))
(if (<= F -3.6e-5)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1.8e-110)
(* t_0 (sqrt 0.5))
(if (<= F 3.1e-120)
(/ (* x (- (cos B))) (sin B))
(if (<= F 2.1e-13)
(* t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = F / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -3.6e-5) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1.8e-110) {
tmp = t_0 * sqrt(0.5);
} else if (F <= 3.1e-120) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 2.1e-13) {
tmp = t_0 * sqrt((1.0 / (2.0 + (x * 2.0))));
} 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 = f / sin(b)
t_1 = x / tan(b)
if (f <= (-3.6d-5)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1.8d-110)) then
tmp = t_0 * sqrt(0.5d0)
else if (f <= 3.1d-120) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 2.1d-13) then
tmp = t_0 * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
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 = F / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -3.6e-5) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1.8e-110) {
tmp = t_0 * Math.sqrt(0.5);
} else if (F <= 3.1e-120) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 2.1e-13) {
tmp = t_0 * Math.sqrt((1.0 / (2.0 + (x * 2.0))));
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = F / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -3.6e-5: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1.8e-110: tmp = t_0 * math.sqrt(0.5) elif F <= 3.1e-120: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 2.1e-13: tmp = t_0 * math.sqrt((1.0 / (2.0 + (x * 2.0)))) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(F / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.6e-5) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1.8e-110) tmp = Float64(t_0 * sqrt(0.5)); elseif (F <= 3.1e-120) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 2.1e-13) tmp = Float64(t_0 * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -3.6e-5) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1.8e-110) tmp = t_0 * sqrt(0.5); elseif (F <= 3.1e-120) tmp = (x * -cos(B)) / sin(B); elseif (F <= 2.1e-13) tmp = t_0 * sqrt((1.0 / (2.0 + (x * 2.0)))); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3.6e-5], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.8e-110], N[(t$95$0 * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-120], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.1e-13], N[(t$95$0 * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -1.8 \cdot 10^{-110}:\\
\;\;\;\;t\_0 \cdot \sqrt{0.5}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-120}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-13}:\\
\;\;\;\;t\_0 \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -3.60000000000000009e-5Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -3.60000000000000009e-5 < F < -1.79999999999999997e-110Initial program 99.5%
Simplified99.3%
Taylor expanded in F around 0 98.4%
Taylor expanded in F around inf 73.1%
Taylor expanded in x around 0 73.3%
if -1.79999999999999997e-110 < F < 3.10000000000000019e-120Initial program 99.4%
Taylor expanded in F around -inf 35.6%
Taylor expanded in x around inf 77.8%
mul-1-neg77.8%
associate-*r/77.5%
distribute-rgt-neg-in77.5%
distribute-neg-frac277.5%
Simplified77.5%
*-commutative77.5%
distribute-frac-neg277.5%
distribute-frac-neg77.5%
associate-*l/77.8%
Applied egg-rr77.8%
if 3.10000000000000019e-120 < F < 2.09999999999999989e-13Initial program 99.1%
Simplified99.0%
Taylor expanded in F around 0 99.1%
Taylor expanded in F around inf 73.5%
if 2.09999999999999989e-13 < F Initial program 51.2%
Simplified71.2%
Taylor expanded in x around 0 71.2%
associate-*l/71.2%
*-lft-identity71.2%
+-commutative71.2%
unpow271.2%
fma-undefine71.2%
Simplified71.2%
Taylor expanded in F around inf 96.6%
Final simplification88.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.015)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -2e-110)
(* (/ F (sin B)) (sqrt 0.5))
(if (<= F 0.065)
(- (* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F 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.015) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -2e-110) {
tmp = (F / sin(B)) * sqrt(0.5);
} else if (F <= 0.065) {
tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.015d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-2d-110)) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else if (f <= 0.065d0) then
tmp = (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / 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.015) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -2e-110) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else if (F <= 0.065) {
tmp = (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.015: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -2e-110: tmp = (F / math.sin(B)) * math.sqrt(0.5) elif F <= 0.065: tmp = (math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.015) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -2e-110) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); elseif (F <= 0.065) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / 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.015) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -2e-110) tmp = (F / sin(B)) * sqrt(0.5); elseif (F <= 0.065) tmp = (sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / 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.015], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -2e-110], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.065], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / 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.015:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -2 \cdot 10^{-110}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{elif}\;F \leq 0.065:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.014999999999999999Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -0.014999999999999999 < F < -2.0000000000000001e-110Initial program 99.5%
Simplified99.3%
Taylor expanded in F around 0 98.4%
Taylor expanded in F around inf 73.1%
Taylor expanded in x around 0 73.3%
if -2.0000000000000001e-110 < F < 0.065000000000000002Initial program 99.3%
Simplified99.6%
Taylor expanded in F around 0 98.5%
Taylor expanded in B around 0 77.7%
if 0.065000000000000002 < F Initial program 49.1%
Simplified69.9%
Taylor expanded in x around 0 69.9%
associate-*l/69.9%
*-lft-identity69.9%
+-commutative69.9%
unpow269.9%
fma-undefine69.9%
Simplified69.9%
Taylor expanded in F around inf 99.0%
Final simplification88.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F (sin B)) (sqrt 0.5))) (t_1 (/ -1.0 (sin B))))
(if (<= F -0.0006)
(- t_1 (/ x (tan B)))
(if (<= F -7.5e-111)
t_0
(if (<= F 2.1e-123)
(/ (* x (- (cos B))) (sin B))
(if (<= F 2.5e-7) t_0 (* x (* t_1 (cos B)))))))))
double code(double F, double B, double x) {
double t_0 = (F / sin(B)) * sqrt(0.5);
double t_1 = -1.0 / sin(B);
double tmp;
if (F <= -0.0006) {
tmp = t_1 - (x / tan(B));
} else if (F <= -7.5e-111) {
tmp = t_0;
} else if (F <= 2.1e-123) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 2.5e-7) {
tmp = t_0;
} else {
tmp = x * (t_1 * cos(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (f / sin(b)) * sqrt(0.5d0)
t_1 = (-1.0d0) / sin(b)
if (f <= (-0.0006d0)) then
tmp = t_1 - (x / tan(b))
else if (f <= (-7.5d-111)) then
tmp = t_0
else if (f <= 2.1d-123) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 2.5d-7) then
tmp = t_0
else
tmp = x * (t_1 * cos(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (F / Math.sin(B)) * Math.sqrt(0.5);
double t_1 = -1.0 / Math.sin(B);
double tmp;
if (F <= -0.0006) {
tmp = t_1 - (x / Math.tan(B));
} else if (F <= -7.5e-111) {
tmp = t_0;
} else if (F <= 2.1e-123) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 2.5e-7) {
tmp = t_0;
} else {
tmp = x * (t_1 * Math.cos(B));
}
return tmp;
}
def code(F, B, x): t_0 = (F / math.sin(B)) * math.sqrt(0.5) t_1 = -1.0 / math.sin(B) tmp = 0 if F <= -0.0006: tmp = t_1 - (x / math.tan(B)) elif F <= -7.5e-111: tmp = t_0 elif F <= 2.1e-123: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 2.5e-7: tmp = t_0 else: tmp = x * (t_1 * math.cos(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(F / sin(B)) * sqrt(0.5)) t_1 = Float64(-1.0 / sin(B)) tmp = 0.0 if (F <= -0.0006) tmp = Float64(t_1 - Float64(x / tan(B))); elseif (F <= -7.5e-111) tmp = t_0; elseif (F <= 2.1e-123) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 2.5e-7) tmp = t_0; else tmp = Float64(x * Float64(t_1 * cos(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F / sin(B)) * sqrt(0.5); t_1 = -1.0 / sin(B); tmp = 0.0; if (F <= -0.0006) tmp = t_1 - (x / tan(B)); elseif (F <= -7.5e-111) tmp = t_0; elseif (F <= 2.1e-123) tmp = (x * -cos(B)) / sin(B); elseif (F <= 2.5e-7) tmp = t_0; else tmp = x * (t_1 * cos(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0006], N[(t$95$1 - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -7.5e-111], t$95$0, If[LessEqual[F, 2.1e-123], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-7], t$95$0, N[(x * N[(t$95$1 * N[Cos[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{0.5}\\
t_1 := \frac{-1}{\sin B}\\
\mathbf{if}\;F \leq -0.0006:\\
\;\;\;\;t\_1 - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -7.5 \cdot 10^{-111}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2.1 \cdot 10^{-123}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t\_1 \cdot \cos B\right)\\
\end{array}
\end{array}
if F < -5.99999999999999947e-4Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -5.99999999999999947e-4 < F < -7.49999999999999965e-111 or 2.0999999999999999e-123 < F < 2.49999999999999989e-7Initial program 99.3%
Simplified99.1%
Taylor expanded in F around 0 98.8%
Taylor expanded in F around inf 73.3%
Taylor expanded in x around 0 73.4%
if -7.49999999999999965e-111 < F < 2.0999999999999999e-123Initial program 99.4%
Taylor expanded in F around -inf 35.6%
Taylor expanded in x around inf 77.8%
mul-1-neg77.8%
associate-*r/77.5%
distribute-rgt-neg-in77.5%
distribute-neg-frac277.5%
Simplified77.5%
*-commutative77.5%
distribute-frac-neg277.5%
distribute-frac-neg77.5%
associate-*l/77.8%
Applied egg-rr77.8%
if 2.49999999999999989e-7 < F Initial program 51.2%
Taylor expanded in F around -inf 42.8%
Taylor expanded in x around inf 44.4%
mul-1-neg44.4%
associate-*r/44.4%
distribute-rgt-neg-in44.4%
distribute-neg-frac244.4%
Simplified44.4%
div-inv44.4%
*-commutative44.4%
neg-mul-144.4%
associate-/r*44.4%
metadata-eval44.4%
Applied egg-rr44.4%
Final simplification73.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F (sin B)) (sqrt 0.5))) (t_1 (/ x (tan B))))
(if (<= F -0.027)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -9.2e-110)
t_0
(if (<= F 5.8e-123)
(/ (* x (- (cos B))) (sin B))
(if (<= F 2.5e-7) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = (F / sin(B)) * sqrt(0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -0.027) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -9.2e-110) {
tmp = t_0;
} else if (F <= 5.8e-123) {
tmp = (x * -cos(B)) / sin(B);
} else if (F <= 2.5e-7) {
tmp = t_0;
} 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 = (f / sin(b)) * sqrt(0.5d0)
t_1 = x / tan(b)
if (f <= (-0.027d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-9.2d-110)) then
tmp = t_0
else if (f <= 5.8d-123) then
tmp = (x * -cos(b)) / sin(b)
else if (f <= 2.5d-7) then
tmp = t_0
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 = (F / Math.sin(B)) * Math.sqrt(0.5);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.027) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -9.2e-110) {
tmp = t_0;
} else if (F <= 5.8e-123) {
tmp = (x * -Math.cos(B)) / Math.sin(B);
} else if (F <= 2.5e-7) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = (F / math.sin(B)) * math.sqrt(0.5) t_1 = x / math.tan(B) tmp = 0 if F <= -0.027: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -9.2e-110: tmp = t_0 elif F <= 5.8e-123: tmp = (x * -math.cos(B)) / math.sin(B) elif F <= 2.5e-7: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(F / sin(B)) * sqrt(0.5)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.027) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -9.2e-110) tmp = t_0; elseif (F <= 5.8e-123) tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); elseif (F <= 2.5e-7) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F / sin(B)) * sqrt(0.5); t_1 = x / tan(B); tmp = 0.0; if (F <= -0.027) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -9.2e-110) tmp = t_0; elseif (F <= 5.8e-123) tmp = (x * -cos(B)) / sin(B); elseif (F <= 2.5e-7) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.027], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -9.2e-110], t$95$0, If[LessEqual[F, 5.8e-123], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-7], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.027:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -9.2 \cdot 10^{-110}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 5.8 \cdot 10^{-123}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-7}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -0.0269999999999999997Initial program 70.0%
Simplified78.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.5%
*-lft-identity78.5%
+-commutative78.5%
unpow278.5%
fma-undefine78.5%
Simplified78.5%
Taylor expanded in F around -inf 99.1%
if -0.0269999999999999997 < F < -9.2000000000000006e-110 or 5.80000000000000007e-123 < F < 2.49999999999999989e-7Initial program 99.3%
Simplified99.1%
Taylor expanded in F around 0 98.8%
Taylor expanded in F around inf 73.3%
Taylor expanded in x around 0 73.4%
if -9.2000000000000006e-110 < F < 5.80000000000000007e-123Initial program 99.4%
Taylor expanded in F around -inf 35.6%
Taylor expanded in x around inf 77.8%
mul-1-neg77.8%
associate-*r/77.5%
distribute-rgt-neg-in77.5%
distribute-neg-frac277.5%
Simplified77.5%
*-commutative77.5%
distribute-frac-neg277.5%
distribute-frac-neg77.5%
associate-*l/77.8%
Applied egg-rr77.8%
if 2.49999999999999989e-7 < F Initial program 51.2%
Simplified71.2%
Taylor expanded in x around 0 71.2%
associate-*l/71.2%
*-lft-identity71.2%
+-commutative71.2%
unpow271.2%
fma-undefine71.2%
Simplified71.2%
Taylor expanded in F around inf 96.6%
Final simplification88.2%
(FPCore (F B x)
:precision binary64
(if (<= x -4.7e-61)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (or (<= x -1.35e-178) (and (not (<= x -2.4e-196)) (<= x 4.8e-194)))
(* (/ F (sin B)) (sqrt 0.5))
(* x (/ (cos B) (- (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (x <= -4.7e-61) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if ((x <= -1.35e-178) || (!(x <= -2.4e-196) && (x <= 4.8e-194))) {
tmp = (F / sin(B)) * sqrt(0.5);
} else {
tmp = x * (cos(B) / -sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (x <= (-4.7d-61)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if ((x <= (-1.35d-178)) .or. (.not. (x <= (-2.4d-196))) .and. (x <= 4.8d-194)) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else
tmp = x * (cos(b) / -sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (x <= -4.7e-61) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if ((x <= -1.35e-178) || (!(x <= -2.4e-196) && (x <= 4.8e-194))) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else {
tmp = x * (Math.cos(B) / -Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if x <= -4.7e-61: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif (x <= -1.35e-178) or (not (x <= -2.4e-196) and (x <= 4.8e-194)): tmp = (F / math.sin(B)) * math.sqrt(0.5) else: tmp = x * (math.cos(B) / -math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (x <= -4.7e-61) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif ((x <= -1.35e-178) || (!(x <= -2.4e-196) && (x <= 4.8e-194))) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); else tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (x <= -4.7e-61) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif ((x <= -1.35e-178) || (~((x <= -2.4e-196)) && (x <= 4.8e-194))) tmp = (F / sin(B)) * sqrt(0.5); else tmp = x * (cos(B) / -sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[x, -4.7e-61], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.35e-178], And[N[Not[LessEqual[x, -2.4e-196]], $MachinePrecision], LessEqual[x, 4.8e-194]]], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.7 \cdot 10^{-61}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;x \leq -1.35 \cdot 10^{-178} \lor \neg \left(x \leq -2.4 \cdot 10^{-196}\right) \land x \leq 4.8 \cdot 10^{-194}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\end{array}
\end{array}
if x < -4.6999999999999997e-61Initial program 70.7%
Taylor expanded in F around -inf 80.5%
Taylor expanded in B around 0 82.8%
if -4.6999999999999997e-61 < x < -1.35000000000000004e-178 or -2.40000000000000021e-196 < x < 4.8e-194Initial program 74.9%
Simplified76.1%
Taylor expanded in F around 0 55.1%
Taylor expanded in F around inf 45.0%
Taylor expanded in x around 0 45.0%
if -1.35000000000000004e-178 < x < -2.40000000000000021e-196 or 4.8e-194 < x Initial program 82.6%
Taylor expanded in F around -inf 66.2%
Taylor expanded in x around inf 76.2%
mul-1-neg76.2%
associate-*r/76.1%
distribute-rgt-neg-in76.1%
distribute-neg-frac276.1%
Simplified76.1%
Final simplification65.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* (/ F (sin B)) (sqrt 0.5))))
(if (<= x -4.7e-61)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= x -1.08e-178)
t_0
(if (<= x -2.2e-196)
(* x (/ (cos B) (- (sin B))))
(if (<= x 4.4e-192) t_0 (/ (* x (- (cos B))) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = (F / sin(B)) * sqrt(0.5);
double tmp;
if (x <= -4.7e-61) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (x <= -1.08e-178) {
tmp = t_0;
} else if (x <= -2.2e-196) {
tmp = x * (cos(B) / -sin(B));
} else if (x <= 4.4e-192) {
tmp = t_0;
} else {
tmp = (x * -cos(B)) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = (f / sin(b)) * sqrt(0.5d0)
if (x <= (-4.7d-61)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (x <= (-1.08d-178)) then
tmp = t_0
else if (x <= (-2.2d-196)) then
tmp = x * (cos(b) / -sin(b))
else if (x <= 4.4d-192) then
tmp = t_0
else
tmp = (x * -cos(b)) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = (F / Math.sin(B)) * Math.sqrt(0.5);
double tmp;
if (x <= -4.7e-61) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (x <= -1.08e-178) {
tmp = t_0;
} else if (x <= -2.2e-196) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (x <= 4.4e-192) {
tmp = t_0;
} else {
tmp = (x * -Math.cos(B)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): t_0 = (F / math.sin(B)) * math.sqrt(0.5) tmp = 0 if x <= -4.7e-61: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif x <= -1.08e-178: tmp = t_0 elif x <= -2.2e-196: tmp = x * (math.cos(B) / -math.sin(B)) elif x <= 4.4e-192: tmp = t_0 else: tmp = (x * -math.cos(B)) / math.sin(B) return tmp
function code(F, B, x) t_0 = Float64(Float64(F / sin(B)) * sqrt(0.5)) tmp = 0.0 if (x <= -4.7e-61) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (x <= -1.08e-178) tmp = t_0; elseif (x <= -2.2e-196) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (x <= 4.4e-192) tmp = t_0; else tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (F / sin(B)) * sqrt(0.5); tmp = 0.0; if (x <= -4.7e-61) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (x <= -1.08e-178) tmp = t_0; elseif (x <= -2.2e-196) tmp = x * (cos(B) / -sin(B)); elseif (x <= 4.4e-192) tmp = t_0; else tmp = (x * -cos(B)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.7e-61], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.08e-178], t$95$0, If[LessEqual[x, -2.2e-196], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.4e-192], t$95$0, N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{if}\;x \leq -4.7 \cdot 10^{-61}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;x \leq -1.08 \cdot 10^{-178}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -2.2 \cdot 10^{-196}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{-192}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\end{array}
\end{array}
if x < -4.6999999999999997e-61Initial program 70.7%
Taylor expanded in F around -inf 80.5%
Taylor expanded in B around 0 82.8%
if -4.6999999999999997e-61 < x < -1.07999999999999995e-178 or -2.20000000000000015e-196 < x < 4.40000000000000011e-192Initial program 74.9%
Simplified76.1%
Taylor expanded in F around 0 55.1%
Taylor expanded in F around inf 45.0%
Taylor expanded in x around 0 45.0%
if -1.07999999999999995e-178 < x < -2.20000000000000015e-196Initial program 87.4%
Taylor expanded in F around -inf 38.7%
Taylor expanded in x around inf 62.9%
mul-1-neg62.9%
associate-*r/63.1%
distribute-rgt-neg-in63.1%
distribute-neg-frac263.1%
Simplified63.1%
if 4.40000000000000011e-192 < x Initial program 82.3%
Taylor expanded in F around -inf 68.2%
Taylor expanded in x around inf 77.2%
mul-1-neg77.2%
associate-*r/77.0%
distribute-rgt-neg-in77.0%
distribute-neg-frac277.0%
Simplified77.0%
*-commutative77.0%
distribute-frac-neg277.0%
distribute-frac-neg77.0%
associate-*l/77.2%
Applied egg-rr77.2%
Final simplification65.7%
(FPCore (F B x) :precision binary64 (if (or (<= x -6e-61) (not (<= x 1.45e-155))) (+ (* x (/ -1.0 (tan B))) (/ -1.0 B)) (* (/ F (sin B)) (sqrt 0.5))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -6e-61) || !(x <= 1.45e-155)) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else {
tmp = (F / sin(B)) * sqrt(0.5);
}
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 ((x <= (-6d-61)) .or. (.not. (x <= 1.45d-155))) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else
tmp = (f / sin(b)) * sqrt(0.5d0)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -6e-61) || !(x <= 1.45e-155)) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -6e-61) or not (x <= 1.45e-155): tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) else: tmp = (F / math.sin(B)) * math.sqrt(0.5) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -6e-61) || !(x <= 1.45e-155)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); else tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -6e-61) || ~((x <= 1.45e-155))) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); else tmp = (F / sin(B)) * sqrt(0.5); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -6e-61], N[Not[LessEqual[x, 1.45e-155]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-61} \lor \neg \left(x \leq 1.45 \cdot 10^{-155}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\end{array}
\end{array}
if x < -6.00000000000000024e-61 or 1.45000000000000005e-155 < x Initial program 79.0%
Taylor expanded in F around -inf 73.6%
Taylor expanded in B around 0 74.8%
if -6.00000000000000024e-61 < x < 1.45000000000000005e-155Initial program 76.2%
Simplified77.4%
Taylor expanded in F around 0 55.7%
Taylor expanded in F around inf 40.4%
Taylor expanded in x around 0 40.4%
Final simplification60.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B))
(t_1 (+ (* x (/ -1.0 (tan B))) (/ -1.0 B))))
(if (<= x -2.05e-35)
t_1
(if (<= x -7e-108)
t_0
(if (<= x 3.9e-122)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= x 8e-15) t_0 t_1))))))
double code(double F, double B, double x) {
double t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double t_1 = (x * (-1.0 / tan(B))) + (-1.0 / B);
double tmp;
if (x <= -2.05e-35) {
tmp = t_1;
} else if (x <= -7e-108) {
tmp = t_0;
} else if (x <= 3.9e-122) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (x <= 8e-15) {
tmp = t_0;
} else {
tmp = 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 = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
t_1 = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
if (x <= (-2.05d-35)) then
tmp = t_1
else if (x <= (-7d-108)) then
tmp = t_0
else if (x <= 3.9d-122) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (x <= 8d-15) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
double t_1 = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
double tmp;
if (x <= -2.05e-35) {
tmp = t_1;
} else if (x <= -7e-108) {
tmp = t_0;
} else if (x <= 3.9e-122) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (x <= 8e-15) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B t_1 = (x * (-1.0 / math.tan(B))) + (-1.0 / B) tmp = 0 if x <= -2.05e-35: tmp = t_1 elif x <= -7e-108: tmp = t_0 elif x <= 3.9e-122: tmp = (-1.0 / math.sin(B)) - (x / B) elif x <= 8e-15: tmp = t_0 else: tmp = t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B) t_1 = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)) tmp = 0.0 if (x <= -2.05e-35) tmp = t_1; elseif (x <= -7e-108) tmp = t_0; elseif (x <= 3.9e-122) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (x <= 8e-15) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; t_1 = (x * (-1.0 / tan(B))) + (-1.0 / B); tmp = 0.0; if (x <= -2.05e-35) tmp = t_1; elseif (x <= -7e-108) tmp = t_0; elseif (x <= 3.9e-122) tmp = (-1.0 / sin(B)) - (x / B); elseif (x <= 8e-15) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]}, Block[{t$95$1 = N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e-35], t$95$1, If[LessEqual[x, -7e-108], t$95$0, If[LessEqual[x, 3.9e-122], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e-15], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
t_1 := x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{-35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-108}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-122}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{-15}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.05000000000000013e-35 or 8.0000000000000006e-15 < x Initial program 79.0%
Taylor expanded in F around -inf 94.4%
Taylor expanded in B around 0 93.3%
if -2.05000000000000013e-35 < x < -6.9999999999999997e-108 or 3.8999999999999999e-122 < x < 8.0000000000000006e-15Initial program 82.6%
Simplified84.8%
Taylor expanded in F around 0 66.4%
Taylor expanded in B around 0 42.3%
if -6.9999999999999997e-108 < x < 3.8999999999999999e-122Initial program 74.4%
Taylor expanded in F around -inf 29.0%
Taylor expanded in B around 0 29.0%
Final simplification58.8%
(FPCore (F B x) :precision binary64 (if (or (<= x -1.08e-106) (not (<= x 4.9e-175))) (+ (* x (/ -1.0 (tan B))) (/ -1.0 B)) (- (/ -1.0 (sin B)) (/ x B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -1.08e-106) || !(x <= 4.9e-175)) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else {
tmp = (-1.0 / sin(B)) - (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 ((x <= (-1.08d-106)) .or. (.not. (x <= 4.9d-175))) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else
tmp = ((-1.0d0) / sin(b)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -1.08e-106) || !(x <= 4.9e-175)) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else {
tmp = (-1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -1.08e-106) or not (x <= 4.9e-175): tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) else: tmp = (-1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -1.08e-106) || !(x <= 4.9e-175)) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); else tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -1.08e-106) || ~((x <= 4.9e-175))) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); else tmp = (-1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -1.08e-106], N[Not[LessEqual[x, 4.9e-175]], $MachinePrecision]], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.08 \cdot 10^{-106} \lor \neg \left(x \leq 4.9 \cdot 10^{-175}\right):\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if x < -1.08e-106 or 4.89999999999999998e-175 < x Initial program 80.2%
Taylor expanded in F around -inf 66.2%
Taylor expanded in B around 0 68.0%
if -1.08e-106 < x < 4.89999999999999998e-175Initial program 73.5%
Taylor expanded in F around -inf 28.9%
Taylor expanded in B around 0 28.9%
Final simplification54.3%
(FPCore (F B x) :precision binary64 (if (<= F -8e-54) (/ (- -1.0 x) B) (if (<= F 17000000000000.0) (/ x (- B)) (fabs (/ (+ -1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e-54) {
tmp = (-1.0 - x) / B;
} else if (F <= 17000000000000.0) {
tmp = x / -B;
} else {
tmp = fabs(((-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 <= (-8d-54)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 17000000000000.0d0) then
tmp = x / -b
else
tmp = abs((((-1.0d0) + x) / b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8e-54) {
tmp = (-1.0 - x) / B;
} else if (F <= 17000000000000.0) {
tmp = x / -B;
} else {
tmp = Math.abs(((-1.0 + x) / B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8e-54: tmp = (-1.0 - x) / B elif F <= 17000000000000.0: tmp = x / -B else: tmp = math.fabs(((-1.0 + x) / B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8e-54) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 17000000000000.0) tmp = Float64(x / Float64(-B)); else tmp = abs(Float64(Float64(-1.0 + x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8e-54) tmp = (-1.0 - x) / B; elseif (F <= 17000000000000.0) tmp = x / -B; else tmp = abs(((-1.0 + x) / B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8e-54], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 17000000000000.0], N[(x / (-B)), $MachinePrecision], N[Abs[N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 17000000000000:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1 + x}{B}\right|\\
\end{array}
\end{array}
if F < -8.0000000000000002e-54Initial program 73.9%
Taylor expanded in F around -inf 89.2%
Taylor expanded in B around 0 41.0%
associate-*r/41.0%
neg-mul-141.0%
distribute-neg-in41.0%
metadata-eval41.0%
Simplified41.0%
if -8.0000000000000002e-54 < F < 1.7e13Initial program 99.3%
Taylor expanded in F around -inf 31.6%
Taylor expanded in B around 0 18.5%
associate-*r/18.5%
neg-mul-118.5%
distribute-neg-in18.5%
metadata-eval18.5%
Simplified18.5%
Taylor expanded in x around inf 35.7%
associate-*r/35.7%
mul-1-neg35.7%
Simplified35.7%
if 1.7e13 < F Initial program 46.7%
Taylor expanded in F around -inf 43.6%
Taylor expanded in B around 0 27.1%
associate-*r/27.1%
neg-mul-127.1%
distribute-neg-in27.1%
metadata-eval27.1%
Simplified27.1%
add-sqr-sqrt7.6%
sqrt-unprod8.7%
pow28.7%
*-un-lft-identity8.7%
*-un-lft-identity8.7%
add-sqr-sqrt5.8%
sqrt-unprod9.5%
sqr-neg9.5%
sqrt-unprod3.7%
add-sqr-sqrt9.6%
Applied egg-rr9.6%
unpow29.6%
rem-sqrt-square23.9%
Simplified23.9%
Final simplification34.4%
(FPCore (F B x) :precision binary64 (if (<= F -9.5e-71) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 16000000000000.0) (/ x (- B)) (fabs (/ (+ -1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.5e-71) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 16000000000000.0) {
tmp = x / -B;
} else {
tmp = fabs(((-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 <= (-9.5d-71)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 16000000000000.0d0) then
tmp = x / -b
else
tmp = abs((((-1.0d0) + x) / b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -9.5e-71) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 16000000000000.0) {
tmp = x / -B;
} else {
tmp = Math.abs(((-1.0 + x) / B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.5e-71: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 16000000000000.0: tmp = x / -B else: tmp = math.fabs(((-1.0 + x) / B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.5e-71) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 16000000000000.0) tmp = Float64(x / Float64(-B)); else tmp = abs(Float64(Float64(-1.0 + x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9.5e-71) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 16000000000000.0) tmp = x / -B; else tmp = abs(((-1.0 + x) / B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.5e-71], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 16000000000000.0], N[(x / (-B)), $MachinePrecision], N[Abs[N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5 \cdot 10^{-71}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 16000000000000:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\left|\frac{-1 + x}{B}\right|\\
\end{array}
\end{array}
if F < -9.4999999999999994e-71Initial program 74.8%
Taylor expanded in F around -inf 87.3%
Taylor expanded in B around 0 61.0%
if -9.4999999999999994e-71 < F < 1.6e13Initial program 99.3%
Taylor expanded in F around -inf 31.5%
Taylor expanded in B around 0 19.0%
associate-*r/19.0%
neg-mul-119.0%
distribute-neg-in19.0%
metadata-eval19.0%
Simplified19.0%
Taylor expanded in x around inf 36.6%
associate-*r/36.6%
mul-1-neg36.6%
Simplified36.6%
if 1.6e13 < F Initial program 46.7%
Taylor expanded in F around -inf 43.6%
Taylor expanded in B around 0 27.1%
associate-*r/27.1%
neg-mul-127.1%
distribute-neg-in27.1%
metadata-eval27.1%
Simplified27.1%
add-sqr-sqrt7.6%
sqrt-unprod8.7%
pow28.7%
*-un-lft-identity8.7%
*-un-lft-identity8.7%
add-sqr-sqrt5.8%
sqrt-unprod9.5%
sqr-neg9.5%
sqrt-unprod3.7%
add-sqr-sqrt9.6%
Applied egg-rr9.6%
unpow29.6%
rem-sqrt-square23.9%
Simplified23.9%
Final simplification41.5%
(FPCore (F B x) :precision binary64 (if (or (<= F -3.2e+127) (not (<= F -120000000.0))) (/ x (- B)) (/ (+ -1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if ((F <= -3.2e+127) || !(F <= -120000000.0)) {
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 <= (-3.2d+127)) .or. (.not. (f <= (-120000000.0d0)))) 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 <= -3.2e+127) || !(F <= -120000000.0)) {
tmp = x / -B;
} else {
tmp = (-1.0 + x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (F <= -3.2e+127) or not (F <= -120000000.0): tmp = x / -B else: tmp = (-1.0 + x) / B return tmp
function code(F, B, x) tmp = 0.0 if ((F <= -3.2e+127) || !(F <= -120000000.0)) 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 <= -3.2e+127) || ~((F <= -120000000.0))) tmp = x / -B; else tmp = (-1.0 + x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[F, -3.2e+127], N[Not[LessEqual[F, -120000000.0]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(N[(-1.0 + x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{+127} \lor \neg \left(F \leq -120000000\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + x}{B}\\
\end{array}
\end{array}
if F < -3.19999999999999976e127 or -1.2e8 < F Initial program 75.8%
Taylor expanded in F around -inf 47.8%
Taylor expanded in B around 0 25.4%
associate-*r/25.4%
neg-mul-125.4%
distribute-neg-in25.4%
metadata-eval25.4%
Simplified25.4%
Taylor expanded in x around inf 30.8%
associate-*r/30.8%
mul-1-neg30.8%
Simplified30.8%
if -3.19999999999999976e127 < F < -1.2e8Initial program 95.7%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 49.6%
associate-*r/49.6%
neg-mul-149.6%
distribute-neg-in49.6%
metadata-eval49.6%
Simplified49.6%
div-inv49.6%
*-un-lft-identity49.6%
*-un-lft-identity49.6%
add-sqr-sqrt36.9%
sqrt-unprod46.4%
sqr-neg46.4%
sqrt-unprod9.3%
add-sqr-sqrt42.4%
Applied egg-rr42.4%
associate-*r/42.4%
*-rgt-identity42.4%
Simplified42.4%
Final simplification32.0%
(FPCore (F B x) :precision binary64 (if (or (<= F -3.5e+128) (not (<= F -1420000.0))) (/ x (- B)) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((F <= -3.5e+128) || !(F <= -1420000.0)) {
tmp = x / -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 <= (-3.5d+128)) .or. (.not. (f <= (-1420000.0d0)))) then
tmp = x / -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 <= -3.5e+128) || !(F <= -1420000.0)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (F <= -3.5e+128) or not (F <= -1420000.0): tmp = x / -B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((F <= -3.5e+128) || !(F <= -1420000.0)) tmp = Float64(x / Float64(-B)); else tmp = Float64(-1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((F <= -3.5e+128) || ~((F <= -1420000.0))) tmp = x / -B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[F, -3.5e+128], N[Not[LessEqual[F, -1420000.0]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.5 \cdot 10^{+128} \lor \neg \left(F \leq -1420000\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if F < -3.49999999999999969e128 or -1.42e6 < F Initial program 75.8%
Taylor expanded in F around -inf 47.8%
Taylor expanded in B around 0 25.4%
associate-*r/25.4%
neg-mul-125.4%
distribute-neg-in25.4%
metadata-eval25.4%
Simplified25.4%
Taylor expanded in x around inf 30.8%
associate-*r/30.8%
mul-1-neg30.8%
Simplified30.8%
if -3.49999999999999969e128 < F < -1.42e6Initial program 95.7%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 49.6%
associate-*r/49.6%
neg-mul-149.6%
distribute-neg-in49.6%
metadata-eval49.6%
Simplified49.6%
Taylor expanded in x around 0 42.0%
Final simplification32.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.06e-54) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e-54) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.06d-54)) then
tmp = ((-1.0d0) - x) / b
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.06e-54) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.06e-54: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.06e-54) 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 <= -1.06e-54) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.06e-54], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.06 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -1.0600000000000001e-54Initial program 73.9%
Taylor expanded in F around -inf 89.2%
Taylor expanded in B around 0 41.0%
associate-*r/41.0%
neg-mul-141.0%
distribute-neg-in41.0%
metadata-eval41.0%
Simplified41.0%
if -1.0600000000000001e-54 < F Initial program 79.7%
Taylor expanded in F around -inf 36.1%
Taylor expanded in B around 0 21.7%
associate-*r/21.7%
neg-mul-121.7%
distribute-neg-in21.7%
metadata-eval21.7%
Simplified21.7%
Taylor expanded in x around inf 32.6%
associate-*r/32.6%
mul-1-neg32.6%
Simplified32.6%
Final simplification35.3%
(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 77.8%
Taylor expanded in F around -inf 53.1%
Taylor expanded in B around 0 27.9%
associate-*r/27.9%
neg-mul-127.9%
distribute-neg-in27.9%
metadata-eval27.9%
Simplified27.9%
Taylor expanded in x around 0 9.9%
Final simplification9.9%
herbie shell --seed 2024056
(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))))))