
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1e+85)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 150000000.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -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 <= -1e+85) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 150000000.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1e+85) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 150000000.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1e+85], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 150000000.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(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 \cdot 10^{+85}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 150000000:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1e85Initial program 34.6%
Taylor expanded in F around -inf 99.7%
expm1-log1p-u55.8%
expm1-udef55.7%
div-inv55.7%
neg-mul-155.7%
fma-def55.7%
Applied egg-rr55.7%
expm1-def55.8%
expm1-log1p99.8%
rem-log-exp37.0%
fma-udef37.0%
neg-mul-137.0%
prod-exp29.3%
*-commutative29.3%
prod-exp37.0%
rem-log-exp99.8%
unsub-neg99.8%
Simplified99.8%
if -1e85 < F < 1.5e8Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
if 1.5e8 < F Initial program 61.1%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2e+82)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 90000000.0)
(- (* F (/ (sqrt (/ 1.0 (fma F F 2.0))) (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 <= -2e+82) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 90000000.0) {
tmp = (F * (sqrt((1.0 / fma(F, F, 2.0))) / sin(B))) - t_0;
} else {
tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2e+82) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 90000000.0) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / fma(F, F, 2.0))) / sin(B))) - t_0); else tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(1.0 / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2e+82], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 90000000.0], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $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 -2 \cdot 10^{+82}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 90000000:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.9999999999999999e82Initial program 35.8%
Taylor expanded in F around -inf 99.7%
expm1-log1p-u54.8%
expm1-udef54.7%
div-inv54.7%
neg-mul-154.7%
fma-def54.7%
Applied egg-rr54.7%
expm1-def54.8%
expm1-log1p99.8%
rem-log-exp36.4%
fma-udef36.4%
neg-mul-136.4%
prod-exp28.8%
*-commutative28.8%
prod-exp36.4%
rem-log-exp99.8%
unsub-neg99.8%
Simplified99.8%
if -1.9999999999999999e82 < F < 9e7Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
unpow299.6%
fma-udef99.6%
Simplified99.6%
if 9e7 < F Initial program 61.1%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ -1.0 (tan B)))))
(if (<= F -3e+21)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 4.7e-7)
(+ t_0 (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(+ t_0 (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x * (-1.0 / tan(B));
double tmp;
if (F <= -3e+21) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 4.7e-7) {
tmp = t_0 + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 + (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 * ((-1.0d0) / tan(b))
if (f <= (-3d+21)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 4.7d-7) then
tmp = t_0 + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = t_0 + (1.0d0 / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (-1.0 / Math.tan(B));
double tmp;
if (F <= -3e+21) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 4.7e-7) {
tmp = t_0 + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x * (-1.0 / math.tan(B)) tmp = 0 if F <= -3e+21: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 4.7e-7: tmp = t_0 + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = t_0 + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x * Float64(-1.0 / tan(B))) tmp = 0.0 if (F <= -3e+21) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 4.7e-7) tmp = Float64(t_0 + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(t_0 + Float64(1.0 / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (-1.0 / tan(B)); tmp = 0.0; if (F <= -3e+21) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 4.7e-7) tmp = t_0 + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = t_0 + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3e+21], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.7e-7], N[(t$95$0 + 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[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{-1}{\tan B}\\
\mathbf{if}\;F \leq -3 \cdot 10^{+21}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.7 \cdot 10^{-7}:\\
\;\;\;\;t_0 + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;t_0 + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -3e21Initial program 44.7%
Taylor expanded in F around -inf 99.7%
expm1-log1p-u53.0%
expm1-udef53.0%
div-inv53.0%
neg-mul-153.0%
fma-def53.0%
Applied egg-rr53.0%
expm1-def53.0%
expm1-log1p99.8%
rem-log-exp34.9%
fma-udef34.9%
neg-mul-134.9%
prod-exp28.2%
*-commutative28.2%
prod-exp34.9%
rem-log-exp99.8%
unsub-neg99.8%
Simplified99.8%
if -3e21 < F < 4.7e-7Initial program 99.5%
if 4.7e-7 < F Initial program 63.1%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(if (<= F -9.6e+70)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 4.7e-7)
(+
(/ -1.0 (/ (tan B) x))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.6e+70) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 4.7e-7) {
tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} 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 <= (-9.6d+70)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 4.7d-7) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
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 <= -9.6e+70) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 4.7e-7) {
tmp = (-1.0 / (Math.tan(B) / x)) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.6e+70: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 4.7e-7: tmp = (-1.0 / (math.tan(B) / x)) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) 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 <= -9.6e+70) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 4.7e-7) 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(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 <= -9.6e+70) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 4.7e-7) tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.6e+70], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.7e-7], 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[(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 -9.6 \cdot 10^{+70}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.7 \cdot 10^{-7}:\\
\;\;\;\;\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}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -9.59999999999999947e70Initial program 36.9%
Taylor expanded in F around -inf 99.7%
expm1-log1p-u53.8%
expm1-udef53.7%
div-inv53.7%
neg-mul-153.7%
fma-def53.7%
Applied egg-rr53.7%
expm1-def53.8%
expm1-log1p99.8%
rem-log-exp35.8%
fma-udef35.8%
neg-mul-135.8%
prod-exp28.4%
*-commutative28.4%
prod-exp35.8%
rem-log-exp99.8%
unsub-neg99.8%
Simplified99.8%
if -9.59999999999999947e70 < F < 4.7e-7Initial program 99.5%
div-inv99.6%
clear-num99.6%
Applied egg-rr99.6%
if 4.7e-7 < F Initial program 63.1%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1900000.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.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1900000.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.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1900000.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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1900000.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.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1900000.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.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1900000.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.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1900000.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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1900000.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.4:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1900000:\\
\;\;\;\;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.3999999999999999Initial program 49.4%
Taylor expanded in F around -inf 98.7%
expm1-log1p-u51.6%
expm1-udef51.5%
div-inv51.5%
neg-mul-151.5%
fma-def51.5%
Applied egg-rr51.5%
expm1-def51.6%
expm1-log1p98.8%
rem-log-exp33.7%
fma-udef33.7%
neg-mul-133.7%
prod-exp27.6%
*-commutative27.6%
prod-exp33.7%
rem-log-exp98.8%
unsub-neg98.8%
Simplified98.8%
if -1.3999999999999999 < F < 1.9e6Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in x around 0 99.6%
if 1.9e6 < F Initial program 61.1%
Taylor expanded in F around inf 99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1900000.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.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1900000.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.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1900000.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.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1900000.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.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1900000.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.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1900000.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.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1900000.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.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1900000.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.4:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1900000:\\
\;\;\;\;\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.3999999999999999Initial program 49.4%
Taylor expanded in F around -inf 98.7%
expm1-log1p-u51.6%
expm1-udef51.5%
div-inv51.5%
neg-mul-151.5%
fma-def51.5%
Applied egg-rr51.5%
expm1-def51.6%
expm1-log1p98.8%
rem-log-exp33.7%
fma-udef33.7%
neg-mul-133.7%
prod-exp27.6%
*-commutative27.6%
prod-exp33.7%
rem-log-exp98.8%
unsub-neg98.8%
Simplified98.8%
if -1.3999999999999999 < F < 1.9e6Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.6%
Taylor expanded in x around 0 99.6%
if 1.9e6 < F Initial program 61.1%
Taylor expanded in F around inf 99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (+ 2.0 (* F F))) (t_1 (/ x (tan B))))
(if (<= F -13600000000000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 4.6e-108)
(- (* F (* (sqrt (/ 1.0 t_0)) (/ 1.0 B))) t_1)
(if (<= F 4.7e-7)
(- (* (/ F (sin B)) (pow (+ t_0 (* x 2.0)) -0.5)) (/ x B))
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B))))))))
double code(double F, double B, double x) {
double t_0 = 2.0 + (F * F);
double t_1 = x / tan(B);
double tmp;
if (F <= -13600000000000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 4.6e-108) {
tmp = (F * (sqrt((1.0 / t_0)) * (1.0 / B))) - t_1;
} else if (F <= 4.7e-7) {
tmp = ((F / sin(B)) * pow((t_0 + (x * 2.0)), -0.5)) - (x / 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) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 2.0d0 + (f * f)
t_1 = x / tan(b)
if (f <= (-13600000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 4.6d-108) then
tmp = (f * (sqrt((1.0d0 / t_0)) * (1.0d0 / b))) - t_1
else if (f <= 4.7d-7) then
tmp = ((f / sin(b)) * ((t_0 + (x * 2.0d0)) ** (-0.5d0))) - (x / 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 t_0 = 2.0 + (F * F);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -13600000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 4.6e-108) {
tmp = (F * (Math.sqrt((1.0 / t_0)) * (1.0 / B))) - t_1;
} else if (F <= 4.7e-7) {
tmp = ((F / Math.sin(B)) * Math.pow((t_0 + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (x * (-1.0 / Math.tan(B))) + (1.0 / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = 2.0 + (F * F) t_1 = x / math.tan(B) tmp = 0 if F <= -13600000000000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 4.6e-108: tmp = (F * (math.sqrt((1.0 / t_0)) * (1.0 / B))) - t_1 elif F <= 4.7e-7: tmp = ((F / math.sin(B)) * math.pow((t_0 + (x * 2.0)), -0.5)) - (x / B) else: tmp = (x * (-1.0 / math.tan(B))) + (1.0 / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(2.0 + Float64(F * F)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -13600000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 4.6e-108) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / t_0)) * Float64(1.0 / B))) - t_1); elseif (F <= 4.7e-7) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(t_0 + Float64(x * 2.0)) ^ -0.5)) - Float64(x / 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) t_0 = 2.0 + (F * F); t_1 = x / tan(B); tmp = 0.0; if (F <= -13600000000000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 4.6e-108) tmp = (F * (sqrt((1.0 / t_0)) * (1.0 / B))) - t_1; elseif (F <= 4.7e-7) tmp = ((F / sin(B)) * ((t_0 + (x * 2.0)) ^ -0.5)) - (x / B); 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[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -13600000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 4.6e-108], N[(N[(F * N[(N[Sqrt[N[(1.0 / t$95$0), $MachinePrecision]], $MachinePrecision] * N[(1.0 / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 4.7e-7], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(t$95$0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / 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}
t_0 := 2 + F \cdot F\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -13600000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-108}:\\
\;\;\;\;F \cdot \left(\sqrt{\frac{1}{t_0}} \cdot \frac{1}{B}\right) - t_1\\
\mathbf{elif}\;F \leq 4.7 \cdot 10^{-7}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(t_0 + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.36e13Initial program 46.4%
Taylor expanded in F around -inf 99.7%
expm1-log1p-u52.9%
expm1-udef52.9%
div-inv52.9%
neg-mul-152.9%
fma-def52.9%
Applied egg-rr52.9%
expm1-def52.9%
expm1-log1p99.8%
rem-log-exp35.5%
fma-udef35.5%
neg-mul-135.5%
prod-exp29.0%
*-commutative29.0%
prod-exp35.5%
rem-log-exp99.8%
unsub-neg99.8%
Simplified99.8%
if -1.36e13 < F < 4.59999999999999992e-108Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in B around 0 86.1%
unpow286.1%
+-commutative86.1%
fma-def86.1%
Simplified86.1%
Taylor expanded in x around 0 86.1%
+-commutative86.1%
unpow286.1%
Simplified86.1%
if 4.59999999999999992e-108 < F < 4.7e-7Initial program 99.5%
Taylor expanded in B around 0 87.6%
if 4.7e-7 < F Initial program 63.1%
Taylor expanded in F around inf 99.7%
Final simplification93.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -13600000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7e-33)
(- (* (sqrt (/ 1.0 (+ 2.0 (* F F)))) (/ F 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 <= -13600000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7e-33) {
tmp = (sqrt((1.0 / (2.0 + (F * F)))) * (F / 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 <= (-13600000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7d-33) then
tmp = (sqrt((1.0d0 / (2.0d0 + (f * f)))) * (f / 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 <= -13600000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7e-33) {
tmp = (Math.sqrt((1.0 / (2.0 + (F * F)))) * (F / 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 <= -13600000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7e-33: tmp = (math.sqrt((1.0 / (2.0 + (F * F)))) * (F / 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 <= -13600000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7e-33) tmp = Float64(Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(F * F)))) * Float64(F / 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 <= -13600000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7e-33) tmp = (sqrt((1.0 / (2.0 + (F * F)))) * (F / 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, -13600000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7e-33], N[(N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / 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 -13600000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-33}:\\
\;\;\;\;\sqrt{\frac{1}{2 + F \cdot F}} \cdot \frac{F}{B} - t_0\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.36e13Initial program 46.4%
Taylor expanded in F around -inf 99.7%
expm1-log1p-u52.9%
expm1-udef52.9%
div-inv52.9%
neg-mul-152.9%
fma-def52.9%
Applied egg-rr52.9%
expm1-def52.9%
expm1-log1p99.8%
rem-log-exp35.5%
fma-udef35.5%
neg-mul-135.5%
prod-exp29.0%
*-commutative29.0%
prod-exp35.5%
rem-log-exp99.8%
unsub-neg99.8%
Simplified99.8%
if -1.36e13 < F < 6.9999999999999997e-33Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in B around 0 84.7%
unpow284.7%
+-commutative84.7%
fma-def84.7%
Simplified84.7%
Taylor expanded in x around 0 84.7%
*-commutative84.7%
+-commutative84.7%
unpow284.7%
Simplified84.7%
if 6.9999999999999997e-33 < F Initial program 66.1%
Taylor expanded in F around inf 95.4%
Final simplification92.1%
(FPCore (F B x)
:precision binary64
(if (<= F -1.05e-51)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1.9e-109)
(/ (- x) (tan B))
(if (<= F 1.8e-36)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(+ (* x (/ -1.0 (tan B))) (/ 1.0 (sin B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05e-51) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1.9e-109) {
tmp = -x / tan(B);
} else if (F <= 1.8e-36) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / 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 <= (-1.05d-51)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1.9d-109) then
tmp = -x / tan(b)
else if (f <= 1.8d-36) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / 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 <= -1.05e-51) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1.9e-109) {
tmp = -x / Math.tan(B);
} else if (F <= 1.8e-36) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / 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 <= -1.05e-51: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1.9e-109: tmp = -x / math.tan(B) elif F <= 1.8e-36: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / 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 <= -1.05e-51) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1.9e-109) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 1.8e-36) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / 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 <= -1.05e-51) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1.9e-109) tmp = -x / tan(B); elseif (F <= 1.8e-36) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; else tmp = (x * (-1.0 / tan(B))) + (1.0 / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.05e-51], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e-109], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.8e-36], 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], 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 -1.05 \cdot 10^{-51}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{-109}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{-36}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{1}{\sin B}\\
\end{array}
\end{array}
if F < -1.05000000000000001e-51Initial program 54.5%
Taylor expanded in F around -inf 92.9%
expm1-log1p-u46.6%
expm1-udef46.5%
div-inv46.5%
neg-mul-146.5%
fma-def46.5%
Applied egg-rr46.5%
expm1-def46.6%
expm1-log1p93.0%
rem-log-exp32.1%
fma-udef32.1%
neg-mul-132.1%
prod-exp26.5%
*-commutative26.5%
prod-exp32.1%
rem-log-exp93.0%
unsub-neg93.0%
Simplified93.0%
if -1.05000000000000001e-51 < F < 1.90000000000000001e-109Initial program 99.6%
Taylor expanded in F around -inf 44.0%
Taylor expanded in x around inf 80.0%
mul-1-neg80.0%
associate-/l*80.0%
associate-/r/80.0%
distribute-rgt-neg-in80.0%
Simplified80.0%
distribute-rgt-neg-out80.0%
add-sqr-sqrt59.6%
sqrt-unprod45.3%
sqr-neg45.3%
sqrt-unprod1.3%
add-sqr-sqrt2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
add-sqr-sqrt1.3%
sqrt-unprod45.3%
sqr-neg45.3%
sqrt-unprod59.6%
add-sqr-sqrt80.1%
quot-tan80.2%
Applied egg-rr80.2%
distribute-frac-neg80.2%
Simplified80.2%
if 1.90000000000000001e-109 < F < 1.80000000000000016e-36Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 77.5%
if 1.80000000000000016e-36 < F Initial program 66.1%
Taylor expanded in F around inf 95.4%
Final simplification88.9%
(FPCore (F B x)
:precision binary64
(if (<= F -8.8e-51)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 4.1e-108)
(/ (- x) (tan B))
(if (<= F 9.5e-34)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (or (<= F 1.8e+63) (not (<= F 5.6e+151)))
(- (/ 1.0 B) (* x (/ 1.0 (tan B))))
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.8e-51) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 4.1e-108) {
tmp = -x / tan(B);
} else if (F <= 9.5e-34) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if ((F <= 1.8e+63) || !(F <= 5.6e+151)) {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
} else {
tmp = ((F / sin(B)) * (1.0 / F)) - (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 <= (-8.8d-51)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 4.1d-108) then
tmp = -x / tan(b)
else if (f <= 9.5d-34) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if ((f <= 1.8d+63) .or. (.not. (f <= 5.6d+151))) then
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
else
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -8.8e-51) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 4.1e-108) {
tmp = -x / Math.tan(B);
} else if (F <= 9.5e-34) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if ((F <= 1.8e+63) || !(F <= 5.6e+151)) {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
} else {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.8e-51: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 4.1e-108: tmp = -x / math.tan(B) elif F <= 9.5e-34: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif (F <= 1.8e+63) or not (F <= 5.6e+151): tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) else: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.8e-51) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 4.1e-108) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 9.5e-34) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif ((F <= 1.8e+63) || !(F <= 5.6e+151)) tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -8.8e-51) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 4.1e-108) tmp = -x / tan(B); elseif (F <= 9.5e-34) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif ((F <= 1.8e+63) || ~((F <= 5.6e+151))) tmp = (1.0 / B) - (x * (1.0 / tan(B))); else tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.8e-51], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.1e-108], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.5e-34], 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[Or[LessEqual[F, 1.8e+63], N[Not[LessEqual[F, 5.6e+151]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -8.8 \cdot 10^{-51}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.1 \cdot 10^{-108}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 1.8 \cdot 10^{+63} \lor \neg \left(F \leq 5.6 \cdot 10^{+151}\right):\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -8.8000000000000001e-51Initial program 54.5%
Taylor expanded in F around -inf 92.9%
expm1-log1p-u46.6%
expm1-udef46.5%
div-inv46.5%
neg-mul-146.5%
fma-def46.5%
Applied egg-rr46.5%
expm1-def46.6%
expm1-log1p93.0%
rem-log-exp32.1%
fma-udef32.1%
neg-mul-132.1%
prod-exp26.5%
*-commutative26.5%
prod-exp32.1%
rem-log-exp93.0%
unsub-neg93.0%
Simplified93.0%
if -8.8000000000000001e-51 < F < 4.10000000000000037e-108Initial program 99.6%
Taylor expanded in F around -inf 44.0%
Taylor expanded in x around inf 80.0%
mul-1-neg80.0%
associate-/l*80.0%
associate-/r/80.0%
distribute-rgt-neg-in80.0%
Simplified80.0%
distribute-rgt-neg-out80.0%
add-sqr-sqrt59.6%
sqrt-unprod45.3%
sqr-neg45.3%
sqrt-unprod1.3%
add-sqr-sqrt2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
add-sqr-sqrt1.3%
sqrt-unprod45.3%
sqr-neg45.3%
sqrt-unprod59.6%
add-sqr-sqrt80.1%
quot-tan80.2%
Applied egg-rr80.2%
distribute-frac-neg80.2%
Simplified80.2%
if 4.10000000000000037e-108 < F < 9.49999999999999985e-34Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 77.5%
if 9.49999999999999985e-34 < F < 1.79999999999999999e63 or 5.59999999999999975e151 < F Initial program 57.6%
Taylor expanded in F around inf 73.9%
Taylor expanded in B around 0 73.6%
if 1.79999999999999999e63 < F < 5.59999999999999975e151Initial program 85.0%
Taylor expanded in F around inf 85.0%
Taylor expanded in B around 0 77.9%
Final simplification82.2%
(FPCore (F B x)
:precision binary64
(if (<= F -3.9)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 7e-109)
(/ (- x) (tan B))
(if (<= F 4.4e-34)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (or (<= F 5.2e+62) (not (<= F 1.15e+152)))
(- (/ 1.0 B) (* x (/ 1.0 (tan B))))
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.9) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7e-109) {
tmp = -x / tan(B);
} else if (F <= 4.4e-34) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if ((F <= 5.2e+62) || !(F <= 1.15e+152)) {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
} else {
tmp = ((F / sin(B)) * (1.0 / F)) - (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.9d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 7d-109) then
tmp = -x / tan(b)
else if (f <= 4.4d-34) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if ((f <= 5.2d+62) .or. (.not. (f <= 1.15d+152))) then
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
else
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.9) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 7e-109) {
tmp = -x / Math.tan(B);
} else if (F <= 4.4e-34) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if ((F <= 5.2e+62) || !(F <= 1.15e+152)) {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
} else {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.9: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 7e-109: tmp = -x / math.tan(B) elif F <= 4.4e-34: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif (F <= 5.2e+62) or not (F <= 1.15e+152): tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) else: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.9) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7e-109) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 4.4e-34) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif ((F <= 5.2e+62) || !(F <= 1.15e+152)) tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.9) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 7e-109) tmp = -x / tan(B); elseif (F <= 4.4e-34) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif ((F <= 5.2e+62) || ~((F <= 1.15e+152))) tmp = (1.0 / B) - (x * (1.0 / tan(B))); else tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e-109], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.4e-34], 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[Or[LessEqual[F, 5.2e+62], N[Not[LessEqual[F, 1.15e+152]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.9:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{-109}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 4.4 \cdot 10^{-34}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+62} \lor \neg \left(F \leq 1.15 \cdot 10^{+152}\right):\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -3.89999999999999991Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 83.9%
if -3.89999999999999991 < F < 7e-109Initial program 99.5%
Taylor expanded in F around -inf 43.8%
Taylor expanded in x around inf 76.2%
mul-1-neg76.2%
associate-/l*76.1%
associate-/r/76.1%
distribute-rgt-neg-in76.1%
Simplified76.1%
distribute-rgt-neg-out76.1%
add-sqr-sqrt57.5%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod1.3%
add-sqr-sqrt2.1%
*-commutative2.1%
clear-num2.1%
un-div-inv2.1%
add-sqr-sqrt1.3%
sqrt-unprod44.7%
sqr-neg44.7%
sqrt-unprod57.6%
add-sqr-sqrt76.2%
quot-tan76.3%
Applied egg-rr76.3%
distribute-frac-neg76.3%
Simplified76.3%
if 7e-109 < F < 4.3999999999999998e-34Initial program 99.5%
+-commutative99.5%
unsub-neg99.5%
associate-*l/99.5%
associate-*r/99.5%
*-commutative99.5%
Simplified99.6%
Taylor expanded in F around 0 99.4%
Taylor expanded in B around 0 77.5%
if 4.3999999999999998e-34 < F < 5.19999999999999968e62 or 1.14999999999999993e152 < F Initial program 57.6%
Taylor expanded in F around inf 73.9%
Taylor expanded in B around 0 73.6%
if 5.19999999999999968e62 < F < 1.14999999999999993e152Initial program 85.0%
Taylor expanded in F around inf 85.0%
Taylor expanded in B around 0 77.9%
Final simplification78.0%
(FPCore (F B x)
:precision binary64
(if (<= F -0.72)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 4.6e-33)
(/ (- x) (tan B))
(if (or (<= F 1.9e+62) (not (<= F 2.8e+152)))
(- (/ 1.0 B) (* x (/ 1.0 (tan B))))
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.72) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 4.6e-33) {
tmp = -x / tan(B);
} else if ((F <= 1.9e+62) || !(F <= 2.8e+152)) {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
} else {
tmp = ((F / sin(B)) * (1.0 / F)) - (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.72d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 4.6d-33) then
tmp = -x / tan(b)
else if ((f <= 1.9d+62) .or. (.not. (f <= 2.8d+152))) then
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
else
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.72) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 4.6e-33) {
tmp = -x / Math.tan(B);
} else if ((F <= 1.9e+62) || !(F <= 2.8e+152)) {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
} else {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.72: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 4.6e-33: tmp = -x / math.tan(B) elif (F <= 1.9e+62) or not (F <= 2.8e+152): tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) else: tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.72) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 4.6e-33) tmp = Float64(Float64(-x) / tan(B)); elseif ((F <= 1.9e+62) || !(F <= 2.8e+152)) tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); else tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.72) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 4.6e-33) tmp = -x / tan(B); elseif ((F <= 1.9e+62) || ~((F <= 2.8e+152))) tmp = (1.0 / B) - (x * (1.0 / tan(B))); else tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.72], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.6e-33], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.9e+62], N[Not[LessEqual[F, 2.8e+152]], $MachinePrecision]], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.72:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+62} \lor \neg \left(F \leq 2.8 \cdot 10^{+152}\right):\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -0.71999999999999997Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 83.9%
if -0.71999999999999997 < F < 4.59999999999999971e-33Initial program 99.5%
Taylor expanded in F around -inf 41.0%
Taylor expanded in x around inf 70.8%
mul-1-neg70.8%
associate-/l*70.8%
associate-/r/70.8%
distribute-rgt-neg-in70.8%
Simplified70.8%
distribute-rgt-neg-out70.8%
add-sqr-sqrt53.0%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod1.2%
add-sqr-sqrt2.1%
*-commutative2.1%
clear-num2.1%
un-div-inv2.1%
add-sqr-sqrt1.2%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod53.0%
add-sqr-sqrt70.9%
quot-tan70.9%
Applied egg-rr70.9%
distribute-frac-neg70.9%
Simplified70.9%
if 4.59999999999999971e-33 < F < 1.89999999999999992e62 or 2.8000000000000002e152 < F Initial program 57.6%
Taylor expanded in F around inf 73.9%
Taylor expanded in B around 0 73.6%
if 1.89999999999999992e62 < F < 2.8000000000000002e152Initial program 85.0%
Taylor expanded in F around inf 85.0%
Taylor expanded in B around 0 77.9%
Final simplification75.8%
(FPCore (F B x) :precision binary64 (if (<= F -1.05) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 7.2e-37) (/ (- x) (tan B)) (- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.05) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 7.2e-37) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.05d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 7.2d-37) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.05) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 7.2e-37) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.05: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 7.2e-37: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.05) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 7.2e-37) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.05) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 7.2e-37) tmp = -x / tan(B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.05], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7.2e-37], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.05:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{-37}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -1.05000000000000004Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 83.9%
if -1.05000000000000004 < F < 7.20000000000000014e-37Initial program 99.5%
Taylor expanded in F around -inf 41.0%
Taylor expanded in x around inf 70.8%
mul-1-neg70.8%
associate-/l*70.8%
associate-/r/70.8%
distribute-rgt-neg-in70.8%
Simplified70.8%
distribute-rgt-neg-out70.8%
add-sqr-sqrt53.0%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod1.2%
add-sqr-sqrt2.1%
*-commutative2.1%
clear-num2.1%
un-div-inv2.1%
add-sqr-sqrt1.2%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod53.0%
add-sqr-sqrt70.9%
quot-tan70.9%
Applied egg-rr70.9%
distribute-frac-neg70.9%
Simplified70.9%
if 7.20000000000000014e-37 < F Initial program 66.1%
Taylor expanded in F around inf 77.3%
Taylor expanded in B around 0 66.8%
Final simplification73.1%
(FPCore (F B x)
:precision binary64
(if (<= F -0.125)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 5.4e+69)
(/ (- x) (tan B))
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.125) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5.4e+69) {
tmp = -x / tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((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 <= (-0.125d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5.4d+69) then
tmp = -x / tan(b)
else
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.125) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5.4e+69) {
tmp = -x / Math.tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.125: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5.4e+69: tmp = -x / math.tan(B) else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.125) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5.4e+69) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.125) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5.4e+69) tmp = -x / tan(B); else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.125], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.4e+69], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.125:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{+69}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.125Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 83.9%
if -0.125 < F < 5.3999999999999996e69Initial program 98.8%
Taylor expanded in F around -inf 43.8%
Taylor expanded in x around inf 67.4%
mul-1-neg67.4%
associate-/l*67.4%
associate-/r/67.3%
distribute-rgt-neg-in67.3%
Simplified67.3%
distribute-rgt-neg-out67.3%
add-sqr-sqrt51.6%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod1.1%
add-sqr-sqrt2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
add-sqr-sqrt1.1%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod51.6%
add-sqr-sqrt67.4%
quot-tan67.5%
Applied egg-rr67.5%
distribute-frac-neg67.5%
Simplified67.5%
if 5.3999999999999996e69 < F Initial program 51.0%
Taylor expanded in F around inf 74.3%
Taylor expanded in B around 0 38.5%
Taylor expanded in B around 0 49.4%
associate--l+49.4%
div-sub49.4%
Simplified49.4%
Final simplification68.0%
(FPCore (F B x)
:precision binary64
(if (<= F -9.5)
(/ (- -1.0 x) B)
(if (<= F 1.25e+69)
(/ (- x) (tan B))
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9.5) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.25e+69) {
tmp = -x / tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((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.5d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.25d+69) then
tmp = -x / tan(b)
else
tmp = (0.3333333333333333d0 * (b * x)) + ((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.5) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.25e+69) {
tmp = -x / Math.tan(B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9.5: tmp = (-1.0 - x) / B elif F <= 1.25e+69: tmp = -x / math.tan(B) else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9.5) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.25e+69) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -9.5) tmp = (-1.0 - x) / B; elseif (F <= 1.25e+69) tmp = -x / tan(B); else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9.5], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.25e+69], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9.5:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.25 \cdot 10^{+69}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.5Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 61.9%
associate-*r/61.9%
distribute-lft-in61.9%
metadata-eval61.9%
neg-mul-161.9%
Simplified61.9%
if -9.5 < F < 1.25000000000000009e69Initial program 98.8%
Taylor expanded in F around -inf 43.8%
Taylor expanded in x around inf 67.4%
mul-1-neg67.4%
associate-/l*67.4%
associate-/r/67.3%
distribute-rgt-neg-in67.3%
Simplified67.3%
distribute-rgt-neg-out67.3%
add-sqr-sqrt51.6%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod1.1%
add-sqr-sqrt2.0%
*-commutative2.0%
clear-num2.0%
un-div-inv2.0%
add-sqr-sqrt1.1%
sqrt-unprod39.3%
sqr-neg39.3%
sqrt-unprod51.6%
add-sqr-sqrt67.4%
quot-tan67.5%
Applied egg-rr67.5%
distribute-frac-neg67.5%
Simplified67.5%
if 1.25000000000000009e69 < F Initial program 51.0%
Taylor expanded in F around inf 74.3%
Taylor expanded in B around 0 38.5%
Taylor expanded in B around 0 49.4%
associate--l+49.4%
div-sub49.4%
Simplified49.4%
Final simplification62.0%
(FPCore (F B x)
:precision binary64
(if (<= F -0.00086)
(/ (- -1.0 x) B)
(if (<= F 5.5e-37)
(- (* B (* x 0.3333333333333333)) (/ x B))
(+ (* 0.3333333333333333 (* B x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.00086) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.5e-37) {
tmp = (B * (x * 0.3333333333333333)) - (x / B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((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 <= (-0.00086d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 5.5d-37) then
tmp = (b * (x * 0.3333333333333333d0)) - (x / b)
else
tmp = (0.3333333333333333d0 * (b * x)) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.00086) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.5e-37) {
tmp = (B * (x * 0.3333333333333333)) - (x / B);
} else {
tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.00086: tmp = (-1.0 - x) / B elif F <= 5.5e-37: tmp = (B * (x * 0.3333333333333333)) - (x / B) else: tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.00086) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 5.5e-37) tmp = Float64(Float64(B * Float64(x * 0.3333333333333333)) - Float64(x / B)); else tmp = Float64(Float64(0.3333333333333333 * Float64(B * x)) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.00086) tmp = (-1.0 - x) / B; elseif (F <= 5.5e-37) tmp = (B * (x * 0.3333333333333333)) - (x / B); else tmp = (0.3333333333333333 * (B * x)) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.00086], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.5e-37], N[(N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(0.3333333333333333 * N[(B * x), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.00086:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-37}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(B \cdot x\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.59999999999999979e-4Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 61.9%
associate-*r/61.9%
distribute-lft-in61.9%
metadata-eval61.9%
neg-mul-161.9%
Simplified61.9%
if -8.59999999999999979e-4 < F < 5.4999999999999998e-37Initial program 99.5%
Taylor expanded in F around -inf 41.0%
Taylor expanded in x around inf 70.8%
mul-1-neg70.8%
associate-/l*70.8%
associate-/r/70.8%
distribute-rgt-neg-in70.8%
Simplified70.8%
distribute-rgt-neg-out70.8%
add-sqr-sqrt53.0%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod1.2%
add-sqr-sqrt2.1%
*-commutative2.1%
clear-num2.1%
un-div-inv2.1%
add-sqr-sqrt1.2%
sqrt-unprod42.5%
sqr-neg42.5%
sqrt-unprod53.0%
add-sqr-sqrt70.9%
quot-tan70.9%
Applied egg-rr70.9%
distribute-frac-neg70.9%
Simplified70.9%
Taylor expanded in B around 0 39.8%
mul-1-neg39.8%
+-commutative39.8%
unsub-neg39.8%
*-commutative39.8%
associate-*l*39.8%
Simplified39.8%
if 5.4999999999999998e-37 < F Initial program 66.1%
Taylor expanded in F around inf 77.3%
Taylor expanded in B around 0 48.9%
Taylor expanded in B around 0 43.9%
associate--l+43.9%
div-sub43.9%
Simplified43.9%
Final simplification47.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.00038)
(/ (- -1.0 x) B)
(if (<= F 2.5e-26)
(- (* B (* x 0.3333333333333333)) (/ x B))
(/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.00038) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-26) {
tmp = (B * (x * 0.3333333333333333)) - (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 <= (-0.00038d0)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.5d-26) then
tmp = (b * (x * 0.3333333333333333d0)) - (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 <= -0.00038) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-26) {
tmp = (B * (x * 0.3333333333333333)) - (x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.00038: tmp = (-1.0 - x) / B elif F <= 2.5e-26: tmp = (B * (x * 0.3333333333333333)) - (x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.00038) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.5e-26) tmp = Float64(Float64(B * Float64(x * 0.3333333333333333)) - Float64(x / B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.00038) tmp = (-1.0 - x) / B; elseif (F <= 2.5e-26) tmp = (B * (x * 0.3333333333333333)) - (x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.00038], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-26], N[(N[(B * N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.00038:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-26}:\\
\;\;\;\;B \cdot \left(x \cdot 0.3333333333333333\right) - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.8000000000000002e-4Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 61.9%
associate-*r/61.9%
distribute-lft-in61.9%
metadata-eval61.9%
neg-mul-161.9%
Simplified61.9%
if -3.8000000000000002e-4 < F < 2.5000000000000001e-26Initial program 99.5%
Taylor expanded in F around -inf 41.6%
Taylor expanded in x around inf 71.1%
mul-1-neg71.1%
associate-/l*71.1%
associate-/r/71.0%
distribute-rgt-neg-in71.0%
Simplified71.0%
distribute-rgt-neg-out71.0%
add-sqr-sqrt53.4%
sqrt-unprod42.1%
sqr-neg42.1%
sqrt-unprod1.2%
add-sqr-sqrt2.1%
*-commutative2.1%
clear-num2.1%
un-div-inv2.1%
add-sqr-sqrt1.2%
sqrt-unprod42.2%
sqr-neg42.2%
sqrt-unprod53.5%
add-sqr-sqrt71.1%
quot-tan71.2%
Applied egg-rr71.2%
distribute-frac-neg71.2%
Simplified71.2%
Taylor expanded in B around 0 39.5%
mul-1-neg39.5%
+-commutative39.5%
unsub-neg39.5%
*-commutative39.5%
associate-*l*39.5%
Simplified39.5%
if 2.5000000000000001e-26 < F Initial program 65.7%
Taylor expanded in F around inf 77.1%
Taylor expanded in B around 0 48.3%
Taylor expanded in B around 0 44.0%
Final simplification47.1%
(FPCore (F B x) :precision binary64 (if (<= F -3.2) (/ -1.0 B) (if (<= F 4.8e-36) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2) {
tmp = -1.0 / B;
} else if (F <= 4.8e-36) {
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.2d0)) then
tmp = (-1.0d0) / b
else if (f <= 4.8d-36) 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.2) {
tmp = -1.0 / B;
} else if (F <= 4.8e-36) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.2: tmp = -1.0 / B elif F <= 4.8e-36: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.2) tmp = Float64(-1.0 / B); elseif (F <= 4.8e-36) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.2) tmp = -1.0 / B; elseif (F <= 4.8e-36) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.2], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 4.8e-36], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 4.8 \cdot 10^{-36}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.2000000000000002Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 61.9%
associate-*r/61.9%
distribute-lft-in61.9%
metadata-eval61.9%
neg-mul-161.9%
Simplified61.9%
Taylor expanded in x around 0 37.0%
if -3.2000000000000002 < F < 4.8e-36Initial program 99.5%
Taylor expanded in F around -inf 41.0%
Taylor expanded in B around 0 23.3%
associate-*r/23.3%
distribute-lft-in23.3%
metadata-eval23.3%
neg-mul-123.3%
Simplified23.3%
Taylor expanded in x around inf 39.4%
associate-*r/39.4%
neg-mul-139.4%
Simplified39.4%
if 4.8e-36 < F Initial program 66.1%
Taylor expanded in F around inf 77.3%
Taylor expanded in B around 0 48.9%
Taylor expanded in B around 0 43.5%
Final simplification40.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.8e-58) (/ (- -1.0 x) B) (if (<= F 2.8e-25) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-58) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.8e-25) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.8d-58)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.8d-25) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.8e-58) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.8e-25) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.8e-58: tmp = (-1.0 - x) / B elif F <= 2.8e-25: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.8e-58) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.8e-25) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.8e-58) tmp = (-1.0 - x) / B; elseif (F <= 2.8e-25) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.8e-58], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.8e-25], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.8 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.80000000000000005e-58Initial program 55.1%
Taylor expanded in F around -inf 91.8%
Taylor expanded in B around 0 57.4%
associate-*r/57.4%
distribute-lft-in57.4%
metadata-eval57.4%
neg-mul-157.4%
Simplified57.4%
if -1.80000000000000005e-58 < F < 2.79999999999999988e-25Initial program 99.6%
Taylor expanded in F around -inf 42.5%
Taylor expanded in B around 0 23.0%
associate-*r/23.0%
distribute-lft-in23.0%
metadata-eval23.0%
neg-mul-123.0%
Simplified23.0%
Taylor expanded in x around inf 40.4%
associate-*r/40.4%
neg-mul-140.4%
Simplified40.4%
if 2.79999999999999988e-25 < F Initial program 65.3%
Taylor expanded in F around inf 76.8%
Taylor expanded in B around 0 47.6%
Taylor expanded in B around 0 44.5%
Final simplification46.9%
(FPCore (F B x) :precision binary64 (if (<= F -0.0085) (/ -1.0 B) (/ (- x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0085) {
tmp = -1.0 / 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 <= (-0.0085d0)) then
tmp = (-1.0d0) / 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 <= -0.0085) {
tmp = -1.0 / B;
} else {
tmp = -x / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.0085: tmp = -1.0 / B else: tmp = -x / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.0085) tmp = Float64(-1.0 / B); else tmp = Float64(Float64(-x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.0085) tmp = -1.0 / B; else tmp = -x / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.0085], N[(-1.0 / B), $MachinePrecision], N[((-x) / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0085:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{B}\\
\end{array}
\end{array}
if F < -0.0085000000000000006Initial program 49.4%
Taylor expanded in F around -inf 98.7%
Taylor expanded in B around 0 61.9%
associate-*r/61.9%
distribute-lft-in61.9%
metadata-eval61.9%
neg-mul-161.9%
Simplified61.9%
Taylor expanded in x around 0 37.0%
if -0.0085000000000000006 < F Initial program 84.4%
Taylor expanded in F around -inf 40.9%
Taylor expanded in B around 0 21.2%
associate-*r/21.2%
distribute-lft-in21.2%
metadata-eval21.2%
neg-mul-121.2%
Simplified21.2%
Taylor expanded in x around inf 30.1%
associate-*r/30.1%
neg-mul-130.1%
Simplified30.1%
Final simplification32.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 74.9%
Taylor expanded in F around -inf 56.7%
Taylor expanded in B around 0 32.3%
associate-*r/32.3%
distribute-lft-in32.3%
metadata-eval32.3%
neg-mul-132.3%
Simplified32.3%
Taylor expanded in x around 0 12.8%
Final simplification12.8%
herbie shell --seed 2023229
(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))))))