
(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 -5.2e+58)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 118000000.0)
(- (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.2e+58) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 118000000.0) {
tmp = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5.2d+58)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 118000000.0d0) then
tmp = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5.2e+58) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 118000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.2e+58: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 118000000.0: tmp = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.2e+58) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 118000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5.2e+58) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 118000000.0) tmp = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.2e+58], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 118000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.2 \cdot 10^{+58}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 118000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -5.19999999999999976e58Initial program 45.6%
Taylor expanded in F around -inf 99.6%
+-commutative99.6%
unsub-neg99.6%
un-div-inv99.7%
Applied egg-rr99.7%
if -5.19999999999999976e58 < F < 1.18e8Initial program 99.5%
div-inv99.6%
expm1-log1p-u76.8%
expm1-udef59.2%
Applied egg-rr59.2%
expm1-def76.8%
expm1-log1p99.6%
Simplified99.6%
if 1.18e8 < F Initial program 56.4%
div-inv56.5%
clear-num56.4%
Applied egg-rr56.4%
Taylor expanded in F around inf 99.7%
+-commutative99.7%
unsub-neg99.7%
clear-num99.8%
Applied egg-rr99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(+ (* x (/ -1.0 (tan B))) (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt((2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.45d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (x * ((-1.0d0) / tan(b))) + (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0)))))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.45) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (x * (-1.0 / Math.tan(B))) + (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.45: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (x * (-1.0 / math.tan(B))) + (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.45) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0)))))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.45) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (x * (-1.0 / tan(B))) + (F / (sin(B) * sqrt((2.0 + (x * 2.0))))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.45], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.45:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.44999999999999996Initial program 53.1%
Taylor expanded in F around -inf 98.4%
+-commutative98.4%
unsub-neg98.4%
un-div-inv98.5%
Applied egg-rr98.5%
if -1.44999999999999996 < F < 1.3999999999999999Initial program 99.5%
associate-*l/99.5%
associate-/l*99.5%
+-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 99.5%
if 1.3999999999999999 < F Initial program 56.4%
div-inv56.5%
clear-num56.4%
Applied egg-rr56.4%
Taylor expanded in F around inf 99.7%
+-commutative99.7%
unsub-neg99.7%
clear-num99.8%
Applied egg-rr99.8%
Final simplification99.3%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.9)
(- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.9) {
tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.9d0) then
tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.9) {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.9: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.9) tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.9) tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.9], 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] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.9:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 53.1%
Taylor expanded in F around -inf 98.4%
+-commutative98.4%
unsub-neg98.4%
un-div-inv98.5%
Applied egg-rr98.5%
if -1.4199999999999999 < F < 1.8999999999999999Initial program 99.5%
div-inv99.6%
expm1-log1p-u75.9%
expm1-udef56.9%
Applied egg-rr56.9%
expm1-def75.9%
expm1-log1p99.6%
Simplified99.6%
Taylor expanded in F around 0 99.6%
if 1.8999999999999999 < F Initial program 56.4%
div-inv56.5%
clear-num56.4%
Applied egg-rr56.4%
Taylor expanded in F around inf 99.7%
+-commutative99.7%
unsub-neg99.7%
clear-num99.8%
Applied egg-rr99.8%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -92000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.9e-153)
t_0
(if (<= F 9.6e-115)
(/ (- x) (tan B))
(if (<= F 230000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -92000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.9e-153) {
tmp = t_0;
} else if (F <= 9.6e-115) {
tmp = -x / tan(B);
} else if (F <= 230000.0) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * ((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-92000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-3.9d-153)) then
tmp = t_0
else if (f <= 9.6d-115) then
tmp = -x / tan(b)
else if (f <= 230000.0d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -92000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -3.9e-153) {
tmp = t_0;
} else if (F <= 9.6e-115) {
tmp = -x / Math.tan(B);
} else if (F <= 230000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -92000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -3.9e-153: tmp = t_0 elif F <= 9.6e-115: tmp = -x / math.tan(B) elif F <= 230000.0: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -92000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.9e-153) tmp = t_0; elseif (F <= 9.6e-115) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 230000.0) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * ((((F * F) + 2.0) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -92000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -3.9e-153) tmp = t_0; elseif (F <= 9.6e-115) tmp = -x / tan(B); elseif (F <= 230000.0) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -92000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.9e-153], t$95$0, If[LessEqual[F, 9.6e-115], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 230000.0], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -92000:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq -3.9 \cdot 10^{-153}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 9.6 \cdot 10^{-115}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 230000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -92000Initial program 52.4%
Taylor expanded in F around -inf 99.6%
+-commutative99.6%
unsub-neg99.6%
un-div-inv99.7%
Applied egg-rr99.7%
if -92000 < F < -3.9000000000000002e-153 or 9.60000000000000085e-115 < F < 2.3e5Initial program 99.5%
Taylor expanded in B around 0 86.1%
if -3.9000000000000002e-153 < F < 9.60000000000000085e-115Initial program 99.5%
Taylor expanded in F around -inf 32.6%
Taylor expanded in x around inf 72.1%
mul-1-neg72.1%
associate-/l*72.2%
distribute-neg-frac72.2%
Simplified72.2%
tan-quot72.3%
expm1-log1p-u56.3%
expm1-udef35.5%
Applied egg-rr35.5%
expm1-def56.3%
expm1-log1p72.3%
Simplified72.3%
if 2.3e5 < F Initial program 56.4%
div-inv56.5%
clear-num56.4%
Applied egg-rr56.4%
Taylor expanded in F around inf 99.7%
+-commutative99.7%
unsub-neg99.7%
clear-num99.8%
Applied egg-rr99.8%
Final simplification90.0%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -2.3)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 4.5e-97)
(- (* t_0 (/ F B)) t_1)
(if (<= F 3900000.0)
(- (* (/ F (sin B)) t_0) (/ x B))
(- (/ 1.0 (sin B)) t_1))))))
double code(double F, double B, double x) {
double t_0 = pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_1 = x / tan(B);
double tmp;
if (F <= -2.3) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 4.5e-97) {
tmp = (t_0 * (F / B)) - t_1;
} else if (F <= 3900000.0) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)
t_1 = x / tan(b)
if (f <= (-2.3d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 4.5d-97) then
tmp = (t_0 * (f / b)) - t_1
else if (f <= 3900000.0d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -2.3) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 4.5e-97) {
tmp = (t_0 * (F / B)) - t_1;
} else if (F <= 3900000.0) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) t_1 = x / math.tan(B) tmp = 0 if F <= -2.3: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 4.5e-97: tmp = (t_0 * (F / B)) - t_1 elif F <= 3900000.0: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.3) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 4.5e-97) tmp = Float64(Float64(t_0 * Float64(F / B)) - t_1); elseif (F <= 3900000.0) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = (((F * F) + 2.0) + (x * 2.0)) ^ -0.5; t_1 = x / tan(B); tmp = 0.0; if (F <= -2.3) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 4.5e-97) tmp = (t_0 * (F / B)) - t_1; elseif (F <= 3900000.0) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 4.5e-97], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 3900000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.3:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{-97}:\\
\;\;\;\;t_0 \cdot \frac{F}{B} - t_1\\
\mathbf{elif}\;F \leq 3900000:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -2.2999999999999998Initial program 53.1%
Taylor expanded in F around -inf 98.4%
+-commutative98.4%
unsub-neg98.4%
un-div-inv98.5%
Applied egg-rr98.5%
if -2.2999999999999998 < F < 4.5000000000000001e-97Initial program 99.5%
div-inv99.6%
expm1-log1p-u73.0%
expm1-udef48.7%
Applied egg-rr48.7%
expm1-def73.0%
expm1-log1p99.6%
Simplified99.6%
Taylor expanded in B around 0 84.5%
if 4.5000000000000001e-97 < F < 3.9e6Initial program 99.5%
Taylor expanded in B around 0 95.8%
if 3.9e6 < F Initial program 56.4%
div-inv56.5%
clear-num56.4%
Applied egg-rr56.4%
Taylor expanded in F around inf 99.7%
+-commutative99.7%
unsub-neg99.7%
clear-num99.8%
Applied egg-rr99.8%
Final simplification93.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -0.0265)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1.8e-151)
t_0
(if (<= F 9.6e-115)
(/ (- x) (tan B))
(if (<= F 0.000125) t_0 (- (/ 1.0 (sin B)) t_1)))))))
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 t_1 = x / tan(B);
double tmp;
if (F <= -0.0265) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1.8e-151) {
tmp = t_0;
} else if (F <= 9.6e-115) {
tmp = -x / tan(B);
} else if (F <= 0.000125) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
t_1 = x / tan(b)
if (f <= (-0.0265d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1.8d-151)) then
tmp = t_0
else if (f <= 9.6d-115) then
tmp = -x / tan(b)
else if (f <= 0.000125d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -0.0265) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1.8e-151) {
tmp = t_0;
} else if (F <= 9.6e-115) {
tmp = -x / Math.tan(B);
} else if (F <= 0.000125) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -0.0265: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1.8e-151: tmp = t_0 elif F <= 9.6e-115: tmp = -x / math.tan(B) elif F <= 0.000125: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0265) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1.8e-151) tmp = t_0; elseif (F <= 9.6e-115) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 0.000125) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -0.0265) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1.8e-151) tmp = t_0; elseif (F <= 9.6e-115) tmp = -x / tan(B); elseif (F <= 0.000125) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0265], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1.8e-151], t$95$0, If[LessEqual[F, 9.6e-115], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.000125], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.0265:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq -1.8 \cdot 10^{-151}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 9.6 \cdot 10^{-115}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 0.000125:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -0.0264999999999999993Initial program 53.1%
Taylor expanded in F around -inf 98.4%
+-commutative98.4%
unsub-neg98.4%
un-div-inv98.5%
Applied egg-rr98.5%
if -0.0264999999999999993 < F < -1.80000000000000016e-151 or 9.60000000000000085e-115 < F < 1.25e-4Initial program 99.5%
Taylor expanded in B around 0 85.9%
Taylor expanded in F around 0 85.8%
if -1.80000000000000016e-151 < F < 9.60000000000000085e-115Initial program 99.5%
Taylor expanded in F around -inf 32.6%
Taylor expanded in x around inf 72.1%
mul-1-neg72.1%
associate-/l*72.2%
distribute-neg-frac72.2%
Simplified72.2%
tan-quot72.3%
expm1-log1p-u56.3%
expm1-udef35.5%
Applied egg-rr35.5%
expm1-def56.3%
expm1-log1p72.3%
Simplified72.3%
if 1.25e-4 < F Initial program 56.4%
div-inv56.5%
clear-num56.4%
Applied egg-rr56.4%
Taylor expanded in F around inf 99.7%
+-commutative99.7%
unsub-neg99.7%
clear-num99.8%
Applied egg-rr99.8%
Final simplification89.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))))
(t_1 (/ 1.0 (sin B)))
(t_2 (/ x (tan B))))
(if (<= F -0.0215)
(- (/ -1.0 (sin B)) t_2)
(if (<= F -4e-153)
(- (* t_0 (* F t_1)) (/ x B))
(if (<= F 9.6e-115)
(/ (- x) (tan B))
(if (<= F 0.0026) (- (* (/ F (sin B)) t_0) (/ x B)) (- t_1 t_2)))))))
double code(double F, double B, double x) {
double t_0 = sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = 1.0 / sin(B);
double t_2 = x / tan(B);
double tmp;
if (F <= -0.0215) {
tmp = (-1.0 / sin(B)) - t_2;
} else if (F <= -4e-153) {
tmp = (t_0 * (F * t_1)) - (x / B);
} else if (F <= 9.6e-115) {
tmp = -x / tan(B);
} else if (F <= 0.0026) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else {
tmp = t_1 - t_2;
}
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) :: t_2
real(8) :: tmp
t_0 = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))
t_1 = 1.0d0 / sin(b)
t_2 = x / tan(b)
if (f <= (-0.0215d0)) then
tmp = ((-1.0d0) / sin(b)) - t_2
else if (f <= (-4d-153)) then
tmp = (t_0 * (f * t_1)) - (x / b)
else if (f <= 9.6d-115) then
tmp = -x / tan(b)
else if (f <= 0.0026d0) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else
tmp = t_1 - t_2
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.sqrt((1.0 / (2.0 + (x * 2.0))));
double t_1 = 1.0 / Math.sin(B);
double t_2 = x / Math.tan(B);
double tmp;
if (F <= -0.0215) {
tmp = (-1.0 / Math.sin(B)) - t_2;
} else if (F <= -4e-153) {
tmp = (t_0 * (F * t_1)) - (x / B);
} else if (F <= 9.6e-115) {
tmp = -x / Math.tan(B);
} else if (F <= 0.0026) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else {
tmp = t_1 - t_2;
}
return tmp;
}
def code(F, B, x): t_0 = math.sqrt((1.0 / (2.0 + (x * 2.0)))) t_1 = 1.0 / math.sin(B) t_2 = x / math.tan(B) tmp = 0 if F <= -0.0215: tmp = (-1.0 / math.sin(B)) - t_2 elif F <= -4e-153: tmp = (t_0 * (F * t_1)) - (x / B) elif F <= 9.6e-115: tmp = -x / math.tan(B) elif F <= 0.0026: tmp = ((F / math.sin(B)) * t_0) - (x / B) else: tmp = t_1 - t_2 return tmp
function code(F, B, x) t_0 = sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) t_1 = Float64(1.0 / sin(B)) t_2 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.0215) tmp = Float64(Float64(-1.0 / sin(B)) - t_2); elseif (F <= -4e-153) tmp = Float64(Float64(t_0 * Float64(F * t_1)) - Float64(x / B)); elseif (F <= 9.6e-115) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 0.0026) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); else tmp = Float64(t_1 - t_2); end return tmp end
function tmp_2 = code(F, B, x) t_0 = sqrt((1.0 / (2.0 + (x * 2.0)))); t_1 = 1.0 / sin(B); t_2 = x / tan(B); tmp = 0.0; if (F <= -0.0215) tmp = (-1.0 / sin(B)) - t_2; elseif (F <= -4e-153) tmp = (t_0 * (F * t_1)) - (x / B); elseif (F <= 9.6e-115) tmp = -x / tan(B); elseif (F <= 0.0026) tmp = ((F / sin(B)) * t_0) - (x / B); else tmp = t_1 - t_2; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.0215], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[F, -4e-153], N[(N[(t$95$0 * N[(F * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9.6e-115], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0026], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{\frac{1}{2 + x \cdot 2}}\\
t_1 := \frac{1}{\sin B}\\
t_2 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.0215:\\
\;\;\;\;\frac{-1}{\sin B} - t_2\\
\mathbf{elif}\;F \leq -4 \cdot 10^{-153}:\\
\;\;\;\;t_0 \cdot \left(F \cdot t_1\right) - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9.6 \cdot 10^{-115}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 0.0026:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t_1 - t_2\\
\end{array}
\end{array}
if F < -0.021499999999999998Initial program 53.1%
Taylor expanded in F around -inf 98.4%
+-commutative98.4%
unsub-neg98.4%
un-div-inv98.5%
Applied egg-rr98.5%
if -0.021499999999999998 < F < -4.00000000000000016e-153Initial program 99.5%
Taylor expanded in B around 0 77.9%
clear-num77.7%
associate-/r/78.0%
Applied egg-rr78.0%
Taylor expanded in F around 0 78.0%
if -4.00000000000000016e-153 < F < 9.60000000000000085e-115Initial program 99.5%
Taylor expanded in F around -inf 32.6%
Taylor expanded in x around inf 72.1%
mul-1-neg72.1%
associate-/l*72.2%
distribute-neg-frac72.2%
Simplified72.2%
tan-quot72.3%
expm1-log1p-u56.3%
expm1-udef35.5%
Applied egg-rr35.5%
expm1-def56.3%
expm1-log1p72.3%
Simplified72.3%
if 9.60000000000000085e-115 < F < 0.0025999999999999999Initial program 99.5%
Taylor expanded in B around 0 93.0%
Taylor expanded in F around 0 92.9%
if 0.0025999999999999999 < F Initial program 56.4%
div-inv56.5%
clear-num56.4%
Applied egg-rr56.4%
Taylor expanded in F around inf 99.7%
+-commutative99.7%
unsub-neg99.7%
clear-num99.8%
Applied egg-rr99.8%
Final simplification89.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -8.4e-23)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1e-114)
(/ (- x) (tan B))
(if (<= F 3.7e-23)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -8.4e-23) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1e-114) {
tmp = -x / tan(B);
} else if (F <= 3.7e-23) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-8.4d-23)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1d-114) then
tmp = -x / tan(b)
else if (f <= 3.7d-23) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -8.4e-23) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1e-114) {
tmp = -x / Math.tan(B);
} else if (F <= 3.7e-23) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -8.4e-23: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1e-114: tmp = -x / math.tan(B) elif F <= 3.7e-23: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8.4e-23) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1e-114) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 3.7e-23) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -8.4e-23) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1e-114) tmp = -x / tan(B); elseif (F <= 3.7e-23) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8.4e-23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1e-114], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.7e-23], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8.4 \cdot 10^{-23}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 10^{-114}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 3.7 \cdot 10^{-23}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -8.4000000000000003e-23Initial program 54.5%
Taylor expanded in F around -inf 95.8%
+-commutative95.8%
unsub-neg95.8%
un-div-inv95.9%
Applied egg-rr95.9%
if -8.4000000000000003e-23 < F < 1.0000000000000001e-114Initial program 99.5%
Taylor expanded in F around -inf 31.3%
Taylor expanded in x around inf 64.6%
mul-1-neg64.6%
associate-/l*64.7%
distribute-neg-frac64.7%
Simplified64.7%
tan-quot64.8%
expm1-log1p-u51.0%
expm1-udef30.9%
Applied egg-rr30.9%
expm1-def51.0%
expm1-log1p64.8%
Simplified64.8%
if 1.0000000000000001e-114 < F < 3.7000000000000003e-23Initial program 99.4%
Taylor expanded in B around 0 95.5%
Taylor expanded in B around 0 64.8%
if 3.7000000000000003e-23 < F Initial program 59.7%
div-inv59.8%
clear-num59.8%
Applied egg-rr59.8%
Taylor expanded in F around inf 96.3%
+-commutative96.3%
unsub-neg96.3%
clear-num96.4%
Applied egg-rr96.4%
Final simplification82.6%
(FPCore (F B x)
:precision binary64
(if (<= F -6.2e-23)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 1e-114)
(/ (- x) (tan B))
(if (<= F 8e-8)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.2e-23) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 1e-114) {
tmp = -x / tan(B);
} else if (F <= 8e-8) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / 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 <= (-6.2d-23)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 1d-114) then
tmp = -x / tan(b)
else if (f <= 8d-8) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / 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 <= -6.2e-23) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 1e-114) {
tmp = -x / Math.tan(B);
} else if (F <= 8e-8) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.2e-23: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 1e-114: tmp = -x / math.tan(B) elif F <= 8e-8: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.2e-23) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 1e-114) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 8e-8) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / 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 <= -6.2e-23) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 1e-114) tmp = -x / tan(B); elseif (F <= 8e-8) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.2e-23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-114], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-8], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / 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 -6.2 \cdot 10^{-23}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 10^{-114}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-8}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.1999999999999998e-23Initial program 54.5%
Taylor expanded in F around -inf 95.8%
+-commutative95.8%
unsub-neg95.8%
un-div-inv95.9%
Applied egg-rr95.9%
if -6.1999999999999998e-23 < F < 1.0000000000000001e-114Initial program 99.5%
Taylor expanded in F around -inf 31.3%
Taylor expanded in x around inf 64.6%
mul-1-neg64.6%
associate-/l*64.7%
distribute-neg-frac64.7%
Simplified64.7%
tan-quot64.8%
expm1-log1p-u51.0%
expm1-udef30.9%
Applied egg-rr30.9%
expm1-def51.0%
expm1-log1p64.8%
Simplified64.8%
if 1.0000000000000001e-114 < F < 8.0000000000000002e-8Initial program 99.5%
Taylor expanded in B around 0 92.9%
Taylor expanded in B around 0 64.2%
if 8.0000000000000002e-8 < F Initial program 57.0%
Taylor expanded in B around 0 36.7%
Taylor expanded in F around inf 77.5%
Final simplification76.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.55e-21)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 1e-114)
(/ (- x) (tan B))
(if (<= F 8e-8)
(- (* (pow (+ (+ (* F F) 2.0) (* x 2.0)) -0.5) (/ F B)) (/ x B))
(- (/ 1.0 (sin B)) (/ x B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.55e-21) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 1e-114) {
tmp = -x / tan(B);
} else if (F <= 8e-8) {
tmp = (pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / 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.55d-21)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 1d-114) then
tmp = -x / tan(b)
else if (f <= 8d-8) then
tmp = (((((f * f) + 2.0d0) + (x * 2.0d0)) ** (-0.5d0)) * (f / b)) - (x / 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.55e-21) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 1e-114) {
tmp = -x / Math.tan(B);
} else if (F <= 8e-8) {
tmp = (Math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - (x / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.55e-21: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 1e-114: tmp = -x / math.tan(B) elif F <= 8e-8: tmp = (math.pow((((F * F) + 2.0) + (x * 2.0)), -0.5) * (F / B)) - (x / B) else: tmp = (1.0 / math.sin(B)) - (x / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.55e-21) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 1e-114) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 8e-8) tmp = Float64(Float64((Float64(Float64(Float64(F * F) + 2.0) + Float64(x * 2.0)) ^ -0.5) * Float64(F / B)) - Float64(x / 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.55e-21) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 1e-114) tmp = -x / tan(B); elseif (F <= 8e-8) tmp = (((((F * F) + 2.0) + (x * 2.0)) ^ -0.5) * (F / B)) - (x / B); else tmp = (1.0 / sin(B)) - (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.55e-21], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1e-114], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8e-8], N[(N[(N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x / 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.55 \cdot 10^{-21}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 10^{-114}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 8 \cdot 10^{-8}:\\
\;\;\;\;{\left(\left(F \cdot F + 2\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.5499999999999999e-21Initial program 54.5%
Taylor expanded in B around 0 31.5%
Taylor expanded in F around -inf 72.2%
mul-1-neg72.2%
distribute-neg-in72.2%
distribute-neg-frac72.2%
metadata-eval72.2%
unsub-neg72.2%
Simplified72.2%
if -1.5499999999999999e-21 < F < 1.0000000000000001e-114Initial program 99.5%
Taylor expanded in F around -inf 31.3%
Taylor expanded in x around inf 64.6%
mul-1-neg64.6%
associate-/l*64.7%
distribute-neg-frac64.7%
Simplified64.7%
tan-quot64.8%
expm1-log1p-u51.0%
expm1-udef30.9%
Applied egg-rr30.9%
expm1-def51.0%
expm1-log1p64.8%
Simplified64.8%
if 1.0000000000000001e-114 < F < 8.0000000000000002e-8Initial program 99.5%
Taylor expanded in B around 0 92.9%
Taylor expanded in B around 0 64.2%
if 8.0000000000000002e-8 < F Initial program 57.0%
Taylor expanded in B around 0 36.7%
Taylor expanded in F around inf 77.5%
Final simplification70.3%
(FPCore (F B x)
:precision binary64
(if (<= F -64000000.0)
(+ (* x (* B 0.3333333333333333)) (/ (- -1.0 x) B))
(if (or (<= F 5.2e+39) (and (not (<= F 1.05e+211)) (<= F 9.5e+264)))
(/ (- x) (tan B))
(+ (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -64000000.0) {
tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if ((F <= 5.2e+39) || (!(F <= 1.05e+211) && (F <= 9.5e+264))) {
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 <= (-64000000.0d0)) then
tmp = (x * (b * 0.3333333333333333d0)) + (((-1.0d0) - x) / b)
else if ((f <= 5.2d+39) .or. (.not. (f <= 1.05d+211)) .and. (f <= 9.5d+264)) 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 <= -64000000.0) {
tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if ((F <= 5.2e+39) || (!(F <= 1.05e+211) && (F <= 9.5e+264))) {
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 <= -64000000.0: tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B) elif (F <= 5.2e+39) or (not (F <= 1.05e+211) and (F <= 9.5e+264)): 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 <= -64000000.0) tmp = Float64(Float64(x * Float64(B * 0.3333333333333333)) + Float64(Float64(-1.0 - x) / B)); elseif ((F <= 5.2e+39) || (!(F <= 1.05e+211) && (F <= 9.5e+264))) 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 <= -64000000.0) tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B); elseif ((F <= 5.2e+39) || (~((F <= 1.05e+211)) && (F <= 9.5e+264))) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) + (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -64000000.0], N[(N[(x * N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 5.2e+39], And[N[Not[LessEqual[F, 1.05e+211]], $MachinePrecision], LessEqual[F, 9.5e+264]]], 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 -64000000:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5.2 \cdot 10^{+39} \lor \neg \left(F \leq 1.05 \cdot 10^{+211}\right) \land F \leq 9.5 \cdot 10^{+264}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\
\end{array}
\end{array}
if F < -6.4e7Initial program 51.6%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 69.1%
Taylor expanded in B around 0 48.3%
+-commutative48.3%
mul-1-neg48.3%
unsub-neg48.3%
*-commutative48.3%
*-commutative48.3%
associate-*l*48.3%
+-commutative48.3%
Simplified48.3%
if -6.4e7 < F < 5.2e39 or 1.05e211 < F < 9.50000000000000036e264Initial program 92.8%
Taylor expanded in F around -inf 36.5%
Taylor expanded in x around inf 59.6%
mul-1-neg59.6%
associate-/l*59.7%
distribute-neg-frac59.7%
Simplified59.7%
tan-quot59.7%
expm1-log1p-u50.1%
expm1-udef28.1%
Applied egg-rr28.1%
expm1-def50.1%
expm1-log1p59.7%
Simplified59.7%
if 5.2e39 < F < 1.05e211 or 9.50000000000000036e264 < F Initial program 52.6%
Taylor expanded in B around 0 34.2%
Taylor expanded in F around inf 60.9%
expm1-log1p-u28.3%
expm1-udef28.3%
add-sqr-sqrt16.0%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod14.5%
add-sqr-sqrt24.1%
associate-*l/27.8%
rgt-mult-inverse27.8%
Applied egg-rr27.8%
expm1-def27.8%
expm1-log1p68.8%
+-commutative68.8%
Simplified68.8%
Final simplification58.5%
(FPCore (F B x)
:precision binary64
(if (<= F -8e-23)
(- (/ -1.0 (sin B)) (/ x B))
(if (or (<= F 2.15e+39) (and (not (<= F 2.8e+209)) (<= F 3.3e+265)))
(/ (- x) (tan B))
(+ (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8e-23) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if ((F <= 2.15e+39) || (!(F <= 2.8e+209) && (F <= 3.3e+265))) {
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 <= (-8d-23)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if ((f <= 2.15d+39) .or. (.not. (f <= 2.8d+209)) .and. (f <= 3.3d+265)) 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 <= -8e-23) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if ((F <= 2.15e+39) || (!(F <= 2.8e+209) && (F <= 3.3e+265))) {
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 <= -8e-23: tmp = (-1.0 / math.sin(B)) - (x / B) elif (F <= 2.15e+39) or (not (F <= 2.8e+209) and (F <= 3.3e+265)): 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 <= -8e-23) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif ((F <= 2.15e+39) || (!(F <= 2.8e+209) && (F <= 3.3e+265))) 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 <= -8e-23) tmp = (-1.0 / sin(B)) - (x / B); elseif ((F <= 2.15e+39) || (~((F <= 2.8e+209)) && (F <= 3.3e+265))) tmp = -x / tan(B); else tmp = (1.0 / sin(B)) + (x / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8e-23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 2.15e+39], And[N[Not[LessEqual[F, 2.8e+209]], $MachinePrecision], LessEqual[F, 3.3e+265]]], 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 -8 \cdot 10^{-23}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.15 \cdot 10^{+39} \lor \neg \left(F \leq 2.8 \cdot 10^{+209}\right) \land F \leq 3.3 \cdot 10^{+265}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} + \frac{x}{B}\\
\end{array}
\end{array}
if F < -7.99999999999999968e-23Initial program 54.5%
Taylor expanded in B around 0 31.5%
Taylor expanded in F around -inf 72.2%
mul-1-neg72.2%
distribute-neg-in72.2%
distribute-neg-frac72.2%
metadata-eval72.2%
unsub-neg72.2%
Simplified72.2%
if -7.99999999999999968e-23 < F < 2.15e39 or 2.80000000000000013e209 < F < 3.2999999999999998e265Initial program 92.6%
Taylor expanded in F around -inf 36.5%
Taylor expanded in x around inf 61.0%
mul-1-neg61.0%
associate-/l*61.1%
distribute-neg-frac61.1%
Simplified61.1%
tan-quot61.1%
expm1-log1p-u51.3%
expm1-udef28.6%
Applied egg-rr28.6%
expm1-def51.3%
expm1-log1p61.1%
Simplified61.1%
if 2.15e39 < F < 2.80000000000000013e209 or 3.2999999999999998e265 < F Initial program 52.6%
Taylor expanded in B around 0 34.2%
Taylor expanded in F around inf 60.9%
expm1-log1p-u28.3%
expm1-udef28.3%
add-sqr-sqrt16.0%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod14.5%
add-sqr-sqrt24.1%
associate-*l/27.8%
rgt-mult-inverse27.8%
Applied egg-rr27.8%
expm1-def27.8%
expm1-log1p68.8%
+-commutative68.8%
Simplified68.8%
Final simplification65.4%
(FPCore (F B x)
:precision binary64
(if (<= F -56000000.0)
(+ (* x (* B 0.3333333333333333)) (/ (- -1.0 x) B))
(if (or (<= F 4.1e+65) (and (not (<= F 6.8e+112)) (<= F 1.9e+216)))
(/ (- x) (tan B))
(+
(* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -56000000.0) {
tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if ((F <= 4.1e+65) || (!(F <= 6.8e+112) && (F <= 1.9e+216))) {
tmp = -x / tan(B);
} else {
tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((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 <= (-56000000.0d0)) then
tmp = (x * (b * 0.3333333333333333d0)) + (((-1.0d0) - x) / b)
else if ((f <= 4.1d+65) .or. (.not. (f <= 6.8d+112)) .and. (f <= 1.9d+216)) then
tmp = -x / tan(b)
else
tmp = (b * (0.16666666666666666d0 + (x * 0.3333333333333333d0))) + ((1.0d0 - x) / b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -56000000.0) {
tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if ((F <= 4.1e+65) || (!(F <= 6.8e+112) && (F <= 1.9e+216))) {
tmp = -x / Math.tan(B);
} else {
tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -56000000.0: tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B) elif (F <= 4.1e+65) or (not (F <= 6.8e+112) and (F <= 1.9e+216)): tmp = -x / math.tan(B) else: tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -56000000.0) tmp = Float64(Float64(x * Float64(B * 0.3333333333333333)) + Float64(Float64(-1.0 - x) / B)); elseif ((F <= 4.1e+65) || (!(F <= 6.8e+112) && (F <= 1.9e+216))) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(B * Float64(0.16666666666666666 + Float64(x * 0.3333333333333333))) + Float64(Float64(1.0 - x) / B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -56000000.0) tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B); elseif ((F <= 4.1e+65) || (~((F <= 6.8e+112)) && (F <= 1.9e+216))) tmp = -x / tan(B); else tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -56000000.0], N[(N[(x * N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.1e+65], And[N[Not[LessEqual[F, 6.8e+112]], $MachinePrecision], LessEqual[F, 1.9e+216]]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(B * N[(0.16666666666666666 + N[(x * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -56000000:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.1 \cdot 10^{+65} \lor \neg \left(F \leq 6.8 \cdot 10^{+112}\right) \land F \leq 1.9 \cdot 10^{+216}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.6e7Initial program 51.6%
Taylor expanded in F around -inf 99.6%
Taylor expanded in B around 0 69.1%
Taylor expanded in B around 0 48.3%
+-commutative48.3%
mul-1-neg48.3%
unsub-neg48.3%
*-commutative48.3%
*-commutative48.3%
associate-*l*48.3%
+-commutative48.3%
Simplified48.3%
if -5.6e7 < F < 4.1000000000000001e65 or 6.79999999999999987e112 < F < 1.90000000000000007e216Initial program 93.4%
Taylor expanded in F around -inf 33.0%
Taylor expanded in x around inf 54.8%
mul-1-neg54.8%
associate-/l*54.9%
distribute-neg-frac54.9%
Simplified54.9%
tan-quot55.0%
expm1-log1p-u46.5%
expm1-udef27.2%
Applied egg-rr27.2%
expm1-def46.5%
expm1-log1p55.0%
Simplified55.0%
if 4.1000000000000001e65 < F < 6.79999999999999987e112 or 1.90000000000000007e216 < F Initial program 36.6%
div-inv36.7%
clear-num36.7%
Applied egg-rr36.7%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 66.8%
associate--l+66.8%
*-commutative66.8%
div-sub66.9%
Simplified66.9%
Final simplification54.9%
(FPCore (F B x) :precision binary64 (if (<= F -1.55e-21) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 3.3e-20) (/ (- x) (tan B)) (- (/ 1.0 (sin B)) (/ x B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.55e-21) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 3.3e-20) {
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.55d-21)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 3.3d-20) 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.55e-21) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 3.3e-20) {
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.55e-21: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 3.3e-20: 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.55e-21) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 3.3e-20) 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.55e-21) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 3.3e-20) 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.55e-21], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.3e-20], 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.55 \cdot 10^{-21}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.3 \cdot 10^{-20}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x}{B}\\
\end{array}
\end{array}
if F < -1.5499999999999999e-21Initial program 54.5%
Taylor expanded in B around 0 31.5%
Taylor expanded in F around -inf 72.2%
mul-1-neg72.2%
distribute-neg-in72.2%
distribute-neg-frac72.2%
metadata-eval72.2%
unsub-neg72.2%
Simplified72.2%
if -1.5499999999999999e-21 < F < 3.3e-20Initial program 99.5%
Taylor expanded in F around -inf 28.2%
Taylor expanded in x around inf 59.1%
mul-1-neg59.1%
associate-/l*59.2%
distribute-neg-frac59.2%
Simplified59.2%
tan-quot59.2%
expm1-log1p-u47.6%
expm1-udef25.4%
Applied egg-rr25.4%
expm1-def47.6%
expm1-log1p59.2%
Simplified59.2%
if 3.3e-20 < F Initial program 58.7%
Taylor expanded in B around 0 39.2%
Taylor expanded in F around inf 77.2%
Final simplification68.0%
(FPCore (F B x) :precision binary64 (if (<= F -2.5e-86) (+ (* x (* B 0.3333333333333333)) (/ (- -1.0 x) B)) (if (<= F 3.6e-77) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-86) {
tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if (F <= 3.6e-77) {
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 <= (-2.5d-86)) then
tmp = (x * (b * 0.3333333333333333d0)) + (((-1.0d0) - x) / b)
else if (f <= 3.6d-77) 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 <= -2.5e-86) {
tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B);
} else if (F <= 3.6e-77) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.5e-86: tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B) elif F <= 3.6e-77: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-86) tmp = Float64(Float64(x * Float64(B * 0.3333333333333333)) + Float64(Float64(-1.0 - x) / B)); elseif (F <= 3.6e-77) 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 <= -2.5e-86) tmp = (x * (B * 0.3333333333333333)) + ((-1.0 - x) / B); elseif (F <= 3.6e-77) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-86], N[(N[(x * N[(B * 0.3333333333333333), $MachinePrecision]), $MachinePrecision] + N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e-77], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-86}:\\
\;\;\;\;x \cdot \left(B \cdot 0.3333333333333333\right) + \frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{-77}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.4999999999999999e-86Initial program 60.8%
Taylor expanded in F around -inf 85.5%
Taylor expanded in B around 0 62.1%
Taylor expanded in B around 0 40.2%
+-commutative40.2%
mul-1-neg40.2%
unsub-neg40.2%
*-commutative40.2%
*-commutative40.2%
associate-*l*40.2%
+-commutative40.2%
Simplified40.2%
if -2.4999999999999999e-86 < F < 3.6e-77Initial program 99.5%
Taylor expanded in B around 0 63.7%
Taylor expanded in x around inf 34.6%
associate-*r/34.6%
neg-mul-134.6%
Simplified34.6%
if 3.6e-77 < F Initial program 64.6%
Taylor expanded in B around 0 46.9%
Taylor expanded in F around inf 49.5%
Taylor expanded in B around 0 45.2%
Final simplification40.0%
(FPCore (F B x) :precision binary64 (if (<= F -2.65e-92) (/ -1.0 B) (if (<= F 2.05e-77) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.65e-92) {
tmp = -1.0 / B;
} else if (F <= 2.05e-77) {
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 <= (-2.65d-92)) then
tmp = (-1.0d0) / b
else if (f <= 2.05d-77) 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 <= -2.65e-92) {
tmp = -1.0 / B;
} else if (F <= 2.05e-77) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.65e-92: tmp = -1.0 / B elif F <= 2.05e-77: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.65e-92) tmp = Float64(-1.0 / B); elseif (F <= 2.05e-77) 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 <= -2.65e-92) tmp = -1.0 / B; elseif (F <= 2.05e-77) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.65e-92], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 2.05e-77], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.65 \cdot 10^{-92}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{-77}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.65000000000000015e-92Initial program 62.2%
Taylor expanded in F around -inf 82.8%
Taylor expanded in B around 0 61.1%
Taylor expanded in x around 0 25.2%
if -2.65000000000000015e-92 < F < 2.04999999999999981e-77Initial program 99.5%
Taylor expanded in B around 0 63.6%
Taylor expanded in x around inf 35.6%
associate-*r/35.6%
neg-mul-135.6%
Simplified35.6%
if 2.04999999999999981e-77 < F Initial program 64.6%
Taylor expanded in B around 0 46.9%
Taylor expanded in F around inf 49.5%
Taylor expanded in B around 0 45.2%
Final simplification35.7%
(FPCore (F B x) :precision binary64 (if (<= F -2e-96) (/ (- -1.0 x) B) (if (<= F 1.22e-76) (- (/ x B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2e-96) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.22e-76) {
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 <= (-2d-96)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.22d-76) 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 <= -2e-96) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.22e-76) {
tmp = -(x / B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2e-96: tmp = (-1.0 - x) / B elif F <= 1.22e-76: tmp = -(x / B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2e-96) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.22e-76) 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 <= -2e-96) tmp = (-1.0 - x) / B; elseif (F <= 1.22e-76) tmp = -(x / B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2e-96], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.22e-76], (-N[(x / B), $MachinePrecision]), N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2 \cdot 10^{-96}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-76}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.9999999999999998e-96Initial program 62.2%
Taylor expanded in F around -inf 82.8%
Taylor expanded in B around 0 38.7%
associate-*r/38.7%
distribute-lft-in38.7%
metadata-eval38.7%
neg-mul-138.7%
Simplified38.7%
if -1.9999999999999998e-96 < F < 1.22e-76Initial program 99.5%
Taylor expanded in B around 0 63.6%
Taylor expanded in x around inf 35.6%
associate-*r/35.6%
neg-mul-135.6%
Simplified35.6%
if 1.22e-76 < F Initial program 64.6%
Taylor expanded in B around 0 46.9%
Taylor expanded in F around inf 49.5%
Taylor expanded in B around 0 45.2%
Final simplification39.9%
(FPCore (F B x) :precision binary64 (if (<= F -2.5e-92) (/ -1.0 B) (if (<= F 9.5e+49) (- (/ x B)) (/ 1.0 B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-92) {
tmp = -1.0 / B;
} else if (F <= 9.5e+49) {
tmp = -(x / B);
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.5d-92)) then
tmp = (-1.0d0) / b
else if (f <= 9.5d+49) then
tmp = -(x / b)
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.5e-92) {
tmp = -1.0 / B;
} else if (F <= 9.5e+49) {
tmp = -(x / B);
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.5e-92: tmp = -1.0 / B elif F <= 9.5e+49: tmp = -(x / B) else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.5e-92) tmp = Float64(-1.0 / B); elseif (F <= 9.5e+49) tmp = Float64(-Float64(x / B)); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.5e-92) tmp = -1.0 / B; elseif (F <= 9.5e+49) tmp = -(x / B); else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.5e-92], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 9.5e+49], (-N[(x / B), $MachinePrecision]), N[(1.0 / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.5 \cdot 10^{-92}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{+49}:\\
\;\;\;\;-\frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < -2.50000000000000006e-92Initial program 62.2%
Taylor expanded in F around -inf 82.8%
Taylor expanded in B around 0 61.1%
Taylor expanded in x around 0 25.2%
if -2.50000000000000006e-92 < F < 9.49999999999999969e49Initial program 98.7%
Taylor expanded in B around 0 70.0%
Taylor expanded in x around inf 35.0%
associate-*r/35.0%
neg-mul-135.0%
Simplified35.0%
if 9.49999999999999969e49 < F Initial program 49.5%
Taylor expanded in B around 0 26.6%
Taylor expanded in F around inf 50.3%
Taylor expanded in B around 0 47.1%
Taylor expanded in x around 0 29.3%
Final simplification30.6%
(FPCore (F B x) :precision binary64 (if (<= F 3.4e-78) (/ -1.0 B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 3.4e-78) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 3.4d-78) then
tmp = (-1.0d0) / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 3.4e-78) {
tmp = -1.0 / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 3.4e-78: tmp = -1.0 / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 3.4e-78) tmp = Float64(-1.0 / B); else tmp = Float64(1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 3.4e-78) tmp = -1.0 / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 3.4e-78], N[(-1.0 / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.4 \cdot 10^{-78}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if F < 3.40000000000000012e-78Initial program 81.3%
Taylor expanded in F around -inf 56.6%
Taylor expanded in B around 0 52.0%
Taylor expanded in x around 0 14.5%
if 3.40000000000000012e-78 < F Initial program 65.0%
Taylor expanded in B around 0 47.5%
Taylor expanded in F around inf 49.0%
Taylor expanded in B around 0 44.8%
Taylor expanded in x around 0 22.9%
Final simplification17.5%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 75.6%
Taylor expanded in F around -inf 50.3%
Taylor expanded in B around 0 47.8%
Taylor expanded in x around 0 10.3%
Final simplification10.3%
herbie shell --seed 2023331
(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))))))