
(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 20 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 -1e+32)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2e+136)
(- (/ (* F (pow (fma F F 2.0) -0.5)) (sin B)) t_0)
(- (* F (/ 1.0 (* F (sin B)))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+32) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2e+136) {
tmp = ((F * pow(fma(F, F, 2.0), -0.5)) / sin(B)) - t_0;
} else {
tmp = (F * (1.0 / (F * sin(B)))) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+32) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2e+136) tmp = Float64(Float64(Float64(F * (fma(F, F, 2.0) ^ -0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(F * Float64(1.0 / Float64(F * 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, -1e+32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2e+136], 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[(F * N[(1.0 / N[(F * N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+32}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+136}:\\
\;\;\;\;\frac{F \cdot {\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{1}{F \cdot \sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.00000000000000005e32Initial program 56.7%
Simplified77.1%
Taylor expanded in x around 0 77.0%
associate-*l/77.1%
*-lft-identity77.1%
+-commutative77.1%
unpow277.1%
fma-undefine77.1%
Simplified77.1%
Taylor expanded in F around -inf 99.9%
if -1.00000000000000005e32 < F < 2.00000000000000012e136Initial program 96.0%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
associate-*r/99.7%
inv-pow99.7%
sqrt-pow199.7%
metadata-eval99.7%
Applied egg-rr99.7%
if 2.00000000000000012e136 < F Initial program 33.4%
Simplified60.5%
Taylor expanded in F around inf 99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.2e+26)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.7e+18)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (* F (/ (/ 1.0 F) (sin B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.2e+26) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.7e+18) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (F * ((1.0 / F) / 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.2d+26)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.7d+18) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (f * ((1.0d0 / f) / 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.2e+26) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.7e+18) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (F * ((1.0 / F) / Math.sin(B))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.2e+26: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.7e+18: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (F * ((1.0 / F) / math.sin(B))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.2e+26) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.7e+18) 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(F * Float64(Float64(1.0 / F) / 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.2e+26) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.7e+18) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (F * ((1.0 / F) / 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.2e+26], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.7e+18], 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[(F * N[(N[(1.0 / F), $MachinePrecision] / N[Sin[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.2 \cdot 10^{+26}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{+18}:\\
\;\;\;\;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}:\\
\;\;\;\;F \cdot \frac{\frac{1}{F}}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.20000000000000002e26Initial program 56.7%
Simplified77.1%
Taylor expanded in x around 0 77.0%
associate-*l/77.1%
*-lft-identity77.1%
+-commutative77.1%
unpow277.1%
fma-undefine77.1%
Simplified77.1%
Taylor expanded in F around -inf 99.9%
if -1.20000000000000002e26 < F < 2.7e18Initial program 99.5%
if 2.7e18 < F Initial program 54.2%
Simplified77.7%
Taylor expanded in x around 0 77.7%
associate-*l/77.7%
*-lft-identity77.7%
+-commutative77.7%
unpow277.7%
fma-undefine77.7%
Simplified77.7%
Taylor expanded in F around inf 99.6%
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 165000.0)
(- (/ (* F (sqrt 0.5)) (sin B)) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
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 <= 165000.0) {
tmp = ((F * sqrt(0.5)) / sin(B)) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 165000.0d0) then
tmp = ((f * sqrt(0.5d0)) / sin(b)) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 165000.0) {
tmp = ((F * Math.sqrt(0.5)) / Math.sin(B)) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
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 <= 165000.0: tmp = ((F * math.sqrt(0.5)) / math.sin(B)) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) 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 <= 165000.0) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / sin(B)) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); 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 <= 165000.0) tmp = ((F * sqrt(0.5)) / sin(B)) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 165000.0], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $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 165000:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 61.6%
Simplified79.6%
Taylor expanded in x around 0 79.5%
associate-*l/79.6%
*-lft-identity79.6%
+-commutative79.6%
unpow279.6%
fma-undefine79.6%
Simplified79.6%
Taylor expanded in F around -inf 99.8%
if -1.44999999999999996 < F < 165000Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 98.7%
*-commutative98.7%
Simplified98.7%
if 165000 < F Initial program 56.2%
Taylor expanded in F around inf 99.3%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 165000.0)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
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 <= 165000.0) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 165000.0d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 165000.0) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
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 <= 165000.0: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) 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 <= 165000.0) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); 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 <= 165000.0) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 165000.0], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $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 165000:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 61.6%
Simplified79.6%
Taylor expanded in x around 0 79.5%
associate-*l/79.6%
*-lft-identity79.6%
+-commutative79.6%
unpow279.6%
fma-undefine79.6%
Simplified79.6%
Taylor expanded in F around -inf 99.8%
if -1.44999999999999996 < F < 165000Initial program 99.5%
Simplified99.7%
Taylor expanded in x around 0 99.6%
associate-*l/99.7%
*-lft-identity99.7%
+-commutative99.7%
unpow299.7%
fma-undefine99.7%
Simplified99.7%
Taylor expanded in F around 0 98.7%
if 165000 < F Initial program 56.2%
Taylor expanded in F around inf 99.3%
Final simplification99.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))))
(if (<= F -0.058)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.65e-193)
t_0
(if (<= F 1.6e-105)
(/ (- x) (tan B))
(if (<= F 165000.0)
t_0
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -0.058) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.65e-193) {
tmp = t_0;
} else if (F <= 1.6e-105) {
tmp = -x / tan(B);
} else if (F <= 165000.0) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / 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((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
if (f <= (-0.058d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.65d-193)) then
tmp = t_0
else if (f <= 1.6d-105) then
tmp = -x / tan(b)
else if (f <= 165000.0d0) then
tmp = t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / 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((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double tmp;
if (F <= -0.058) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.65e-193) {
tmp = t_0;
} else if (F <= 1.6e-105) {
tmp = -x / Math.tan(B);
} else if (F <= 165000.0) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) tmp = 0 if F <= -0.058: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.65e-193: tmp = t_0 elif F <= 1.6e-105: tmp = -x / math.tan(B) elif F <= 165000.0: tmp = t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)) tmp = 0.0 if (F <= -0.058) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.65e-193) tmp = t_0; elseif (F <= 1.6e-105) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 165000.0) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); tmp = 0.0; if (F <= -0.058) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.65e-193) tmp = t_0; elseif (F <= 1.6e-105) tmp = -x / tan(B); elseif (F <= 165000.0) tmp = t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.058], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.65e-193], t$95$0, If[LessEqual[F, 1.6e-105], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 165000.0], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{if}\;F \leq -0.058:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.65 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 1.6 \cdot 10^{-105}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 165000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.0580000000000000029Initial program 62.1%
Simplified79.9%
Taylor expanded in x around 0 79.8%
associate-*l/79.8%
*-lft-identity79.8%
+-commutative79.8%
unpow279.8%
fma-undefine79.8%
Simplified79.8%
Taylor expanded in F around -inf 99.8%
if -0.0580000000000000029 < F < -1.6499999999999999e-193 or 1.59999999999999991e-105 < F < 165000Initial program 99.4%
Taylor expanded in B around 0 75.9%
Taylor expanded in F around 0 73.7%
if -1.6499999999999999e-193 < F < 1.59999999999999991e-105Initial program 99.6%
Taylor expanded in F around -inf 45.3%
Taylor expanded in x around inf 88.2%
mul-1-neg88.2%
associate-/l*88.1%
distribute-lft-neg-in88.1%
Simplified88.1%
distribute-lft-neg-out88.1%
clear-num88.1%
tan-quot88.2%
div-inv88.5%
neg-sub088.5%
Applied egg-rr88.5%
neg-sub088.5%
distribute-neg-frac88.5%
Simplified88.5%
if 165000 < F Initial program 56.2%
Taylor expanded in F around inf 99.3%
Final simplification91.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (/ 1.0 (sin B))))
(if (<= F -0.17)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -8e-126)
(- (* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (* F t_1)) (/ x B))
(if (<= F 1.15e-17)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(+ (* x (/ -1.0 (tan B))) t_1))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = 1.0 / sin(B);
double tmp;
if (F <= -0.17) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -8e-126) {
tmp = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B);
} else if (F <= 1.15e-17) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / tan(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 = x / tan(b)
t_1 = 1.0d0 / sin(b)
if (f <= (-0.17d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-8d-126)) then
tmp = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f * t_1)) - (x / b)
else if (f <= 1.15d-17) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double t_1 = 1.0 / Math.sin(B);
double tmp;
if (F <= -0.17) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -8e-126) {
tmp = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B);
} else if (F <= 1.15e-17) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + t_1;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = 1.0 / math.sin(B) tmp = 0 if F <= -0.17: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -8e-126: tmp = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F * t_1)) - (x / B) elif F <= 1.15e-17: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + t_1 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -0.17) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -8e-126) tmp = Float64(Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F * t_1)) - Float64(x / B)); elseif (F <= 1.15e-17) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = 1.0 / sin(B); tmp = 0.0; if (F <= -0.17) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -8e-126) tmp = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F * t_1)) - (x / B); elseif (F <= 1.15e-17) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; else tmp = (x * (-1.0 / tan(B))) + t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.17], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -8e-126], N[(N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.15e-17], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -0.17:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -8 \cdot 10^{-126}:\\
\;\;\;\;{\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \left(F \cdot t\_1\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-17}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_1\\
\end{array}
\end{array}
if F < -0.170000000000000012Initial program 62.1%
Simplified79.9%
Taylor expanded in x around 0 79.8%
associate-*l/79.8%
*-lft-identity79.8%
+-commutative79.8%
unpow279.8%
fma-undefine79.8%
Simplified79.8%
Taylor expanded in F around -inf 99.8%
if -0.170000000000000012 < F < -7.9999999999999996e-126Initial program 99.4%
Taylor expanded in B around 0 83.8%
div-inv83.8%
Applied egg-rr83.8%
if -7.9999999999999996e-126 < F < 1.15000000000000004e-17Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 84.2%
if 1.15000000000000004e-17 < F Initial program 58.0%
Taylor expanded in F around inf 98.0%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.18)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -8.6e-126)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 1.15e-17)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.18) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -8.6e-126) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 1.15e-17) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.18d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-8.6d-126)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 1.15d-17) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.18) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -8.6e-126) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 1.15e-17) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.18: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -8.6e-126: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 1.15e-17: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.18) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -8.6e-126) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 1.15e-17) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.18) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -8.6e-126) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 1.15e-17) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.18], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -8.6e-126], 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], If[LessEqual[F, 1.15e-17], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.18:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -8.6 \cdot 10^{-126}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-17}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.17999999999999999Initial program 62.1%
Simplified79.9%
Taylor expanded in x around 0 79.8%
associate-*l/79.8%
*-lft-identity79.8%
+-commutative79.8%
unpow279.8%
fma-undefine79.8%
Simplified79.8%
Taylor expanded in F around -inf 99.8%
if -0.17999999999999999 < F < -8.60000000000000065e-126Initial program 99.4%
Taylor expanded in B around 0 83.8%
if -8.60000000000000065e-126 < F < 1.15000000000000004e-17Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 84.2%
if 1.15000000000000004e-17 < F Initial program 58.0%
Taylor expanded in F around inf 98.0%
Final simplification92.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* F (- (/ (sqrt 0.5) (sin B)) (/ x (* F B))))))
(if (<= F -0.036)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -5.5e-126)
t_0
(if (<= F 7.6e-103)
(/ (- x) (tan B))
(if (<= F 165000.0)
t_0
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))))
double code(double F, double B, double x) {
double t_0 = F * ((sqrt(0.5) / sin(B)) - (x / (F * B)));
double tmp;
if (F <= -0.036) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -5.5e-126) {
tmp = t_0;
} else if (F <= 7.6e-103) {
tmp = -x / tan(B);
} else if (F <= 165000.0) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / 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 * ((sqrt(0.5d0) / sin(b)) - (x / (f * b)))
if (f <= (-0.036d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-5.5d-126)) then
tmp = t_0
else if (f <= 7.6d-103) then
tmp = -x / tan(b)
else if (f <= 165000.0d0) then
tmp = t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = F * ((Math.sqrt(0.5) / Math.sin(B)) - (x / (F * B)));
double tmp;
if (F <= -0.036) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -5.5e-126) {
tmp = t_0;
} else if (F <= 7.6e-103) {
tmp = -x / Math.tan(B);
} else if (F <= 165000.0) {
tmp = t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = F * ((math.sqrt(0.5) / math.sin(B)) - (x / (F * B))) tmp = 0 if F <= -0.036: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -5.5e-126: tmp = t_0 elif F <= 7.6e-103: tmp = -x / math.tan(B) elif F <= 165000.0: tmp = t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(F * Float64(Float64(sqrt(0.5) / sin(B)) - Float64(x / Float64(F * B)))) tmp = 0.0 if (F <= -0.036) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -5.5e-126) tmp = t_0; elseif (F <= 7.6e-103) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 165000.0) tmp = t_0; else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = F * ((sqrt(0.5) / sin(B)) - (x / (F * B))); tmp = 0.0; if (F <= -0.036) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -5.5e-126) tmp = t_0; elseif (F <= 7.6e-103) tmp = -x / tan(B); elseif (F <= 165000.0) tmp = t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(F * N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.036], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -5.5e-126], t$95$0, If[LessEqual[F, 7.6e-103], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 165000.0], t$95$0, N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := F \cdot \left(\frac{\sqrt{0.5}}{\sin B} - \frac{x}{F \cdot B}\right)\\
\mathbf{if}\;F \leq -0.036:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -5.5 \cdot 10^{-126}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 7.6 \cdot 10^{-103}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 165000:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.0359999999999999973Initial program 62.1%
Simplified79.9%
Taylor expanded in x around 0 79.8%
associate-*l/79.8%
*-lft-identity79.8%
+-commutative79.8%
unpow279.8%
fma-undefine79.8%
Simplified79.8%
Taylor expanded in F around -inf 99.8%
if -0.0359999999999999973 < F < -5.49999999999999987e-126 or 7.6000000000000001e-103 < F < 165000Initial program 99.4%
Taylor expanded in B around 0 79.7%
Taylor expanded in F around 0 76.9%
Taylor expanded in F around inf 76.8%
Taylor expanded in x around 0 76.9%
if -5.49999999999999987e-126 < F < 7.6000000000000001e-103Initial program 99.5%
Taylor expanded in F around -inf 40.8%
Taylor expanded in x around inf 81.8%
mul-1-neg81.8%
associate-/l*81.7%
distribute-lft-neg-in81.7%
Simplified81.7%
distribute-lft-neg-out81.7%
clear-num81.7%
tan-quot81.8%
div-inv82.0%
neg-sub082.0%
Applied egg-rr82.0%
neg-sub082.0%
distribute-neg-frac82.0%
Simplified82.0%
if 165000 < F Initial program 56.2%
Taylor expanded in F around inf 99.3%
Final simplification90.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.0038)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.15e-17)
(- (* F (* (/ 1.0 B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))) t_0)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.0038) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.15e-17) {
tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.0038d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.15d-17) then
tmp = (f * ((1.0d0 / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))) - t_0
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.0038) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.15e-17) {
tmp = (F * ((1.0 / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0;
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.0038: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.15e-17: tmp = (F * ((1.0 / B) * math.sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0 else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0038) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.15e-17) tmp = Float64(Float64(F * Float64(Float64(1.0 / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.0038) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.15e-17) tmp = (F * ((1.0 / B) * sqrt((1.0 / (2.0 + (x * 2.0)))))) - t_0; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0038], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.15e-17], N[(N[(F * N[(N[(1.0 / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.0038:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.15 \cdot 10^{-17}:\\
\;\;\;\;F \cdot \left(\frac{1}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\right) - t\_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -0.00379999999999999999Initial program 63.1%
Simplified80.4%
Taylor expanded in x around 0 80.3%
associate-*l/80.4%
*-lft-identity80.4%
+-commutative80.4%
unpow280.4%
fma-undefine80.4%
Simplified80.4%
Taylor expanded in F around -inf 97.5%
if -0.00379999999999999999 < F < 1.15000000000000004e-17Initial program 99.5%
Simplified99.7%
Taylor expanded in F around 0 99.7%
Taylor expanded in B around 0 81.7%
if 1.15000000000000004e-17 < F Initial program 58.0%
Taylor expanded in F around inf 98.0%
Final simplification90.9%
(FPCore (F B x)
:precision binary64
(if (<= F -3.3e-15)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -1.3e-126)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 1.55e-105)
(/ (- x) (tan B))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e-15) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -1.3e-126) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 1.55e-105) {
tmp = -x / tan(B);
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / 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 (f <= (-3.3d-15)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-1.3d-126)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 1.55d-105) then
tmp = -x / tan(b)
else
tmp = (x * ((-1.0d0) / tan(b))) + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e-15) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -1.3e-126) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 1.55e-105) {
tmp = -x / Math.tan(B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.3e-15: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -1.3e-126: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 1.55e-105: tmp = -x / math.tan(B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.3e-15) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -1.3e-126) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 1.55e-105) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.3e-15) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -1.3e-126) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 1.55e-105) tmp = -x / tan(B); else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.3e-15], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -1.3e-126], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.55e-105], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.3 \cdot 10^{-15}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -1.3 \cdot 10^{-126}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-105}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3.3e-15Initial program 63.6%
Simplified80.7%
Taylor expanded in x around 0 80.6%
associate-*l/80.6%
*-lft-identity80.6%
+-commutative80.6%
unpow280.6%
fma-undefine80.6%
Simplified80.6%
Taylor expanded in F around -inf 97.5%
if -3.3e-15 < F < -1.3e-126Initial program 99.4%
Taylor expanded in B around 0 82.2%
Taylor expanded in F around 0 82.2%
Taylor expanded in F around inf 77.4%
Taylor expanded in x around 0 64.8%
if -1.3e-126 < F < 1.55000000000000007e-105Initial program 99.5%
Taylor expanded in F around -inf 40.5%
Taylor expanded in x around inf 82.6%
mul-1-neg82.6%
associate-/l*82.5%
distribute-lft-neg-in82.5%
Simplified82.5%
distribute-lft-neg-out82.5%
clear-num82.5%
tan-quot82.7%
div-inv82.9%
neg-sub082.9%
Applied egg-rr82.9%
neg-sub082.9%
distribute-neg-frac82.9%
Simplified82.9%
if 1.55000000000000007e-105 < F Initial program 65.5%
Taylor expanded in F around inf 87.9%
Final simplification87.5%
(FPCore (F B x)
:precision binary64
(if (<= F -3.8e-11)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -4.5e-126)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 2.65e+17) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e-11) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -4.5e-126) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 2.65e+17) {
tmp = -x / tan(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 (f <= (-3.8d-11)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-4.5d-126)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 2.65d+17) then
tmp = -x / tan(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 (F <= -3.8e-11) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -4.5e-126) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 2.65e+17) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.8e-11: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -4.5e-126: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 2.65e+17: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.8e-11) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -4.5e-126) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 2.65e+17) tmp = Float64(Float64(-x) / tan(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 (F <= -3.8e-11) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -4.5e-126) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 2.65e+17) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.8e-11], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.5e-126], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+17], N[((-x) / N[Tan[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}\;F \leq -3.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -4.5 \cdot 10^{-126}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.7999999999999998e-11Initial program 63.6%
Simplified80.7%
Taylor expanded in x around 0 80.6%
associate-*l/80.6%
*-lft-identity80.6%
+-commutative80.6%
unpow280.6%
fma-undefine80.6%
Simplified80.6%
Taylor expanded in F around -inf 97.5%
if -3.7999999999999998e-11 < F < -4.50000000000000025e-126Initial program 99.4%
Taylor expanded in B around 0 82.2%
Taylor expanded in F around 0 82.2%
Taylor expanded in F around inf 77.4%
Taylor expanded in x around 0 64.8%
if -4.50000000000000025e-126 < F < 2.65e17Initial program 99.5%
Taylor expanded in F around -inf 41.1%
Taylor expanded in x around inf 74.5%
mul-1-neg74.5%
associate-/l*74.4%
distribute-lft-neg-in74.4%
Simplified74.4%
distribute-lft-neg-out74.4%
clear-num74.5%
tan-quot74.5%
div-inv74.8%
neg-sub074.8%
Applied egg-rr74.8%
neg-sub074.8%
distribute-neg-frac74.8%
Simplified74.8%
if 2.65e17 < F Initial program 54.9%
Taylor expanded in B around 0 34.7%
Taylor expanded in F around inf 79.7%
(FPCore (F B x)
:precision binary64
(if (<= F -4.2e-13)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F -8.2e-131)
(/ (* F (sqrt 0.5)) (sin B))
(if (<= F 2.65e+17) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.2e-13) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= -8.2e-131) {
tmp = (F * sqrt(0.5)) / sin(B);
} else if (F <= 2.65e+17) {
tmp = -x / tan(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 (f <= (-4.2d-13)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= (-8.2d-131)) then
tmp = (f * sqrt(0.5d0)) / sin(b)
else if (f <= 2.65d+17) then
tmp = -x / tan(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 (F <= -4.2e-13) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= -8.2e-131) {
tmp = (F * Math.sqrt(0.5)) / Math.sin(B);
} else if (F <= 2.65e+17) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.2e-13: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= -8.2e-131: tmp = (F * math.sqrt(0.5)) / math.sin(B) elif F <= 2.65e+17: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.2e-13) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= -8.2e-131) tmp = Float64(Float64(F * sqrt(0.5)) / sin(B)); elseif (F <= 2.65e+17) tmp = Float64(Float64(-x) / tan(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 (F <= -4.2e-13) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= -8.2e-131) tmp = (F * sqrt(0.5)) / sin(B); elseif (F <= 2.65e+17) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.2e-13], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8.2e-131], N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+17], N[((-x) / N[Tan[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}\;F \leq -4.2 \cdot 10^{-13}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -8.2 \cdot 10^{-131}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{\sin B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -4.19999999999999977e-13Initial program 63.6%
Simplified80.7%
Taylor expanded in x around 0 80.6%
associate-*l/80.6%
*-lft-identity80.6%
+-commutative80.6%
unpow280.6%
fma-undefine80.6%
Simplified80.6%
Taylor expanded in F around -inf 97.5%
Taylor expanded in B around 0 73.9%
if -4.19999999999999977e-13 < F < -8.2000000000000004e-131Initial program 99.4%
Taylor expanded in B around 0 82.2%
Taylor expanded in F around 0 82.2%
Taylor expanded in F around inf 77.4%
Taylor expanded in x around 0 64.8%
if -8.2000000000000004e-131 < F < 2.65e17Initial program 99.5%
Taylor expanded in F around -inf 41.1%
Taylor expanded in x around inf 74.5%
mul-1-neg74.5%
associate-/l*74.4%
distribute-lft-neg-in74.4%
Simplified74.4%
distribute-lft-neg-out74.4%
clear-num74.5%
tan-quot74.5%
div-inv74.8%
neg-sub074.8%
Applied egg-rr74.8%
neg-sub074.8%
distribute-neg-frac74.8%
Simplified74.8%
if 2.65e17 < F Initial program 54.9%
Taylor expanded in B around 0 34.7%
Taylor expanded in F around inf 79.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.25e-12)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F -3.5e-126)
(* (/ F (sin B)) (sqrt 0.5))
(if (<= F 2.65e+17) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.25e-12) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= -3.5e-126) {
tmp = (F / sin(B)) * sqrt(0.5);
} else if (F <= 2.65e+17) {
tmp = -x / tan(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 (f <= (-1.25d-12)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= (-3.5d-126)) then
tmp = (f / sin(b)) * sqrt(0.5d0)
else if (f <= 2.65d+17) then
tmp = -x / tan(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 (F <= -1.25e-12) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= -3.5e-126) {
tmp = (F / Math.sin(B)) * Math.sqrt(0.5);
} else if (F <= 2.65e+17) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.25e-12: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= -3.5e-126: tmp = (F / math.sin(B)) * math.sqrt(0.5) elif F <= 2.65e+17: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.25e-12) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= -3.5e-126) tmp = Float64(Float64(F / sin(B)) * sqrt(0.5)); elseif (F <= 2.65e+17) tmp = Float64(Float64(-x) / tan(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 (F <= -1.25e-12) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= -3.5e-126) tmp = (F / sin(B)) * sqrt(0.5); elseif (F <= 2.65e+17) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.25e-12], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -3.5e-126], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+17], N[((-x) / N[Tan[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}\;F \leq -1.25 \cdot 10^{-12}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -3.5 \cdot 10^{-126}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{0.5}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.24999999999999992e-12Initial program 63.6%
Simplified80.7%
Taylor expanded in x around 0 80.6%
associate-*l/80.6%
*-lft-identity80.6%
+-commutative80.6%
unpow280.6%
fma-undefine80.6%
Simplified80.6%
Taylor expanded in F around -inf 97.5%
Taylor expanded in B around 0 73.9%
if -1.24999999999999992e-12 < F < -3.5e-126Initial program 99.4%
Taylor expanded in B around 0 82.2%
Taylor expanded in F around 0 82.2%
Taylor expanded in F around inf 77.4%
Taylor expanded in x around 0 64.8%
*-commutative64.8%
associate-/l*64.5%
Simplified64.5%
if -3.5e-126 < F < 2.65e17Initial program 99.5%
Taylor expanded in F around -inf 41.1%
Taylor expanded in x around inf 74.5%
mul-1-neg74.5%
associate-/l*74.4%
distribute-lft-neg-in74.4%
Simplified74.4%
distribute-lft-neg-out74.4%
clear-num74.5%
tan-quot74.5%
div-inv74.8%
neg-sub074.8%
Applied egg-rr74.8%
neg-sub074.8%
distribute-neg-frac74.8%
Simplified74.8%
if 2.65e17 < F Initial program 54.9%
Taylor expanded in B around 0 34.7%
Taylor expanded in F around inf 79.7%
Final simplification75.0%
(FPCore (F B x)
:precision binary64
(if (<= F -0.021)
(- (/ -1.0 B) (/ x (tan B)))
(if (<= F -8e-133)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 2.65e+17) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.021) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= -8e-133) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 2.65e+17) {
tmp = -x / tan(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 (f <= (-0.021d0)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= (-8d-133)) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 2.65d+17) then
tmp = -x / tan(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 (F <= -0.021) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= -8e-133) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 2.65e+17) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.021: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= -8e-133: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 2.65e+17: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.021) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= -8e-133) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 2.65e+17) tmp = Float64(Float64(-x) / tan(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 (F <= -0.021) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= -8e-133) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 2.65e+17) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.021], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8e-133], 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], If[LessEqual[F, 2.65e+17], N[((-x) / N[Tan[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}\;F \leq -0.021:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -8 \cdot 10^{-133}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.0210000000000000013Initial program 62.1%
Simplified79.9%
Taylor expanded in x around 0 79.8%
associate-*l/79.8%
*-lft-identity79.8%
+-commutative79.8%
unpow279.8%
fma-undefine79.8%
Simplified79.8%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 75.5%
if -0.0210000000000000013 < F < -8.0000000000000005e-133Initial program 99.4%
Taylor expanded in B around 0 84.4%
Taylor expanded in F around 0 79.5%
Taylor expanded in B around 0 53.4%
if -8.0000000000000005e-133 < F < 2.65e17Initial program 99.5%
Taylor expanded in F around -inf 41.1%
Taylor expanded in x around inf 74.5%
mul-1-neg74.5%
associate-/l*74.4%
distribute-lft-neg-in74.4%
Simplified74.4%
distribute-lft-neg-out74.4%
clear-num74.5%
tan-quot74.5%
div-inv74.8%
neg-sub074.8%
Applied egg-rr74.8%
neg-sub074.8%
distribute-neg-frac74.8%
Simplified74.8%
if 2.65e17 < F Initial program 54.9%
Taylor expanded in B around 0 34.7%
Taylor expanded in F around inf 79.7%
Final simplification74.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.5e-160)
(- (/ -1.0 B) t_0)
(if (or (<= F 1.9e+65) (not (<= F 1.15e+120)))
(/ (- x) (tan B))
(+ t_0 (/ 1.0 B))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.5e-160) {
tmp = (-1.0 / B) - t_0;
} else if ((F <= 1.9e+65) || !(F <= 1.15e+120)) {
tmp = -x / tan(B);
} else {
tmp = t_0 + (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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.5d-160)) then
tmp = ((-1.0d0) / b) - t_0
else if ((f <= 1.9d+65) .or. (.not. (f <= 1.15d+120))) then
tmp = -x / tan(b)
else
tmp = t_0 + (1.0d0 / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.5e-160) {
tmp = (-1.0 / B) - t_0;
} else if ((F <= 1.9e+65) || !(F <= 1.15e+120)) {
tmp = -x / Math.tan(B);
} else {
tmp = t_0 + (1.0 / B);
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.5e-160: tmp = (-1.0 / B) - t_0 elif (F <= 1.9e+65) or not (F <= 1.15e+120): tmp = -x / math.tan(B) else: tmp = t_0 + (1.0 / B) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.5e-160) tmp = Float64(Float64(-1.0 / B) - t_0); elseif ((F <= 1.9e+65) || !(F <= 1.15e+120)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(t_0 + Float64(1.0 / B)); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.5e-160) tmp = (-1.0 / B) - t_0; elseif ((F <= 1.9e+65) || ~((F <= 1.15e+120))) tmp = -x / tan(B); else tmp = t_0 + (1.0 / B); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.5e-160], N[(N[(-1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision], If[Or[LessEqual[F, 1.9e+65], N[Not[LessEqual[F, 1.15e+120]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(1.0 / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{-1}{B} - t\_0\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+65} \lor \neg \left(F \leq 1.15 \cdot 10^{+120}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{1}{B}\\
\end{array}
\end{array}
if F < -1.49999999999999998e-160Initial program 72.2%
Simplified85.2%
Taylor expanded in x around 0 85.2%
associate-*l/85.2%
*-lft-identity85.2%
+-commutative85.2%
unpow285.2%
fma-undefine85.2%
Simplified85.2%
Taylor expanded in F around -inf 81.3%
Taylor expanded in B around 0 65.2%
if -1.49999999999999998e-160 < F < 1.90000000000000006e65 or 1.14999999999999996e120 < F Initial program 81.4%
Taylor expanded in F around -inf 46.1%
Taylor expanded in x around inf 68.0%
mul-1-neg68.0%
associate-/l*67.9%
distribute-lft-neg-in67.9%
Simplified67.9%
distribute-lft-neg-out67.9%
clear-num67.9%
tan-quot68.0%
div-inv68.2%
neg-sub068.2%
Applied egg-rr68.2%
neg-sub068.2%
distribute-neg-frac68.2%
Simplified68.2%
if 1.90000000000000006e65 < F < 1.14999999999999996e120Initial program 72.9%
Taylor expanded in F around -inf 9.0%
Taylor expanded in B around 0 10.0%
+-commutative10.0%
div-inv10.0%
fma-define10.0%
add-sqr-sqrt9.1%
sqrt-unprod26.7%
frac-times26.7%
metadata-eval26.7%
metadata-eval26.7%
frac-times26.7%
sqrt-unprod38.8%
add-sqr-sqrt63.5%
add-sqr-sqrt24.1%
sqrt-unprod34.3%
div-inv34.3%
div-inv34.3%
sqr-neg34.3%
sqrt-unprod23.8%
add-sqr-sqrt47.8%
Applied egg-rr47.8%
fma-undefine47.8%
associate-*r/47.8%
metadata-eval47.8%
Simplified47.8%
Final simplification65.7%
(FPCore (F B x) :precision binary64 (if (<= F -1.5e-160) (- (/ -1.0 B) (/ x (tan B))) (if (<= F 2.65e+17) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-160) {
tmp = (-1.0 / B) - (x / tan(B));
} else if (F <= 2.65e+17) {
tmp = -x / tan(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 (f <= (-1.5d-160)) then
tmp = ((-1.0d0) / b) - (x / tan(b))
else if (f <= 2.65d+17) then
tmp = -x / tan(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 (F <= -1.5e-160) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else if (F <= 2.65e+17) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.5e-160: tmp = (-1.0 / B) - (x / math.tan(B)) elif F <= 2.65e+17: tmp = -x / math.tan(B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-160) tmp = Float64(Float64(-1.0 / B) - Float64(x / tan(B))); elseif (F <= 2.65e+17) tmp = Float64(Float64(-x) / tan(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 (F <= -1.5e-160) tmp = (-1.0 / B) - (x / tan(B)); elseif (F <= 2.65e+17) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-160], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+17], N[((-x) / N[Tan[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}\;F \leq -1.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.49999999999999998e-160Initial program 72.2%
Simplified85.2%
Taylor expanded in x around 0 85.2%
associate-*l/85.2%
*-lft-identity85.2%
+-commutative85.2%
unpow285.2%
fma-undefine85.2%
Simplified85.2%
Taylor expanded in F around -inf 81.3%
Taylor expanded in B around 0 65.2%
if -1.49999999999999998e-160 < F < 2.65e17Initial program 99.5%
Taylor expanded in F around -inf 41.6%
Taylor expanded in x around inf 75.2%
mul-1-neg75.2%
associate-/l*75.1%
distribute-lft-neg-in75.1%
Simplified75.1%
distribute-lft-neg-out75.1%
clear-num75.1%
tan-quot75.2%
div-inv75.4%
neg-sub075.4%
Applied egg-rr75.4%
neg-sub075.4%
distribute-neg-frac75.4%
Simplified75.4%
if 2.65e17 < F Initial program 54.9%
Taylor expanded in B around 0 34.7%
Taylor expanded in F around inf 79.7%
(FPCore (F B x) :precision binary64 (if (<= B 9.5e-129) (/ (- -1.0 x) B) (/ (- x) (tan B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 9.5e-129) {
tmp = (-1.0 - x) / B;
} else {
tmp = -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 <= 9.5d-129) then
tmp = ((-1.0d0) - x) / b
else
tmp = -x / tan(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 9.5e-129) {
tmp = (-1.0 - x) / B;
} else {
tmp = -x / Math.tan(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 9.5e-129: tmp = (-1.0 - x) / B else: tmp = -x / math.tan(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 9.5e-129) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(Float64(-x) / tan(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 9.5e-129) tmp = (-1.0 - x) / B; else tmp = -x / tan(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 9.5e-129], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 9.5 \cdot 10^{-129}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\end{array}
\end{array}
if B < 9.5000000000000006e-129Initial program 71.1%
Taylor expanded in F around -inf 55.1%
Taylor expanded in B around 0 34.6%
associate-*r/34.6%
neg-mul-134.6%
distribute-neg-in34.6%
metadata-eval34.6%
Simplified34.6%
if 9.5000000000000006e-129 < B Initial program 88.8%
Taylor expanded in F around -inf 61.3%
Taylor expanded in x around inf 63.9%
mul-1-neg63.9%
associate-/l*63.9%
distribute-lft-neg-in63.9%
Simplified63.9%
distribute-lft-neg-out63.9%
clear-num63.9%
tan-quot64.0%
div-inv64.2%
neg-sub064.2%
Applied egg-rr64.2%
neg-sub064.2%
distribute-neg-frac64.2%
Simplified64.2%
Final simplification44.9%
(FPCore (F B x) :precision binary64 (if (or (<= x -4e-192) (not (<= x 2.15e-62))) (/ x (- B)) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -4e-192) || !(x <= 2.15e-62)) {
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 ((x <= (-4d-192)) .or. (.not. (x <= 2.15d-62))) 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 ((x <= -4e-192) || !(x <= 2.15e-62)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -4e-192) or not (x <= 2.15e-62): tmp = x / -B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -4e-192) || !(x <= 2.15e-62)) 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 ((x <= -4e-192) || ~((x <= 2.15e-62))) tmp = x / -B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -4e-192], N[Not[LessEqual[x, 2.15e-62]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{-192} \lor \neg \left(x \leq 2.15 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -4.0000000000000004e-192 or 2.1499999999999998e-62 < x Initial program 79.8%
Taylor expanded in B around 0 42.9%
Taylor expanded in x around inf 40.3%
associate-*r/40.3%
neg-mul-140.3%
Simplified40.3%
if -4.0000000000000004e-192 < x < 2.1499999999999998e-62Initial program 71.6%
Taylor expanded in F around -inf 29.6%
Taylor expanded in B around 0 23.0%
Taylor expanded in x around 0 20.6%
Final simplification34.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.5e-160) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.5e-160) {
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.5d-160)) 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.5e-160) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.5e-160: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.5e-160) 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.5e-160) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.5e-160], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.5 \cdot 10^{-160}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -1.49999999999999998e-160Initial program 72.2%
Taylor expanded in F around -inf 81.2%
Taylor expanded in B around 0 41.7%
associate-*r/41.7%
neg-mul-141.7%
distribute-neg-in41.7%
metadata-eval41.7%
Simplified41.7%
if -1.49999999999999998e-160 < F Initial program 80.5%
Taylor expanded in B around 0 51.0%
Taylor expanded in x around inf 34.0%
associate-*r/34.0%
neg-mul-134.0%
Simplified34.0%
Final simplification37.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 77.3%
Taylor expanded in F around -inf 57.2%
Taylor expanded in B around 0 54.3%
Taylor expanded in x around 0 10.1%
herbie shell --seed 2024106
(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))))))