
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (F B x) :precision binary64 (+ (- (* x (/ 1.0 (tan B)))) (* (/ F (sin B)) (pow (+ (+ (* F F) 2.0) (* 2.0 x)) (- (/ 1.0 2.0))))))
double code(double F, double B, double x) {
return -(x * (1.0 / tan(B))) + ((F / sin(B)) * pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -(x * (1.0d0 / tan(b))) + ((f / sin(b)) * ((((f * f) + 2.0d0) + (2.0d0 * x)) ** -(1.0d0 / 2.0d0)))
end function
public static double code(double F, double B, double x) {
return -(x * (1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)));
}
def code(F, B, x): return -(x * (1.0 / math.tan(B))) + ((F / math.sin(B)) * math.pow((((F * F) + 2.0) + (2.0 * x)), -(1.0 / 2.0)))
function code(F, B, x) return Float64(Float64(-Float64(x * Float64(1.0 / tan(B)))) + Float64(Float64(F / sin(B)) * (Float64(Float64(Float64(F * F) + 2.0) + Float64(2.0 * x)) ^ Float64(-Float64(1.0 / 2.0))))) end
function tmp = code(F, B, x) tmp = -(x * (1.0 / tan(B))) + ((F / sin(B)) * ((((F * F) + 2.0) + (2.0 * x)) ^ -(1.0 / 2.0))); end
code[F_, B_, x_] := N[((-N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]) + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(N[(F * F), $MachinePrecision] + 2.0), $MachinePrecision] + N[(2.0 * x), $MachinePrecision]), $MachinePrecision], (-N[(1.0 / 2.0), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(-x \cdot \frac{1}{\tan B}\right) + \frac{F}{\sin B} \cdot {\left(\left(F \cdot F + 2\right) + 2 \cdot x\right)}^{\left(-\frac{1}{2}\right)}
\end{array}
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.4e+23)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 20000000.0)
(- (/ (/ F (sin B)) (hypot (sqrt (fma 2.0 x 2.0)) F)) t_0)
(- (/ -1.0 (- (sin B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.4e+23) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 20000000.0) {
tmp = ((F / sin(B)) / hypot(sqrt(fma(2.0, x, 2.0)), F)) - t_0;
} else {
tmp = (-1.0 / -sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.4e+23) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 20000000.0) tmp = Float64(Float64(Float64(F / sin(B)) / hypot(sqrt(fma(2.0, x, 2.0)), F)) - t_0); else tmp = Float64(Float64(-1.0 / Float64(-sin(B))) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.4e+23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 20000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision] ^ 2 + F ^ 2], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.4 \cdot 10^{+23}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 20000000:\\
\;\;\;\;\frac{\frac{F}{\sin B}}{\mathsf{hypot}\left(\sqrt{\mathsf{fma}\left(2, x, 2\right)}, F\right)} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{-\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.4e23Initial program 53.2%
Taylor expanded in F around -inf 99.7%
+-commutative99.7%
add-sqr-sqrt48.8%
sqrt-unprod57.7%
frac-times57.7%
metadata-eval57.7%
metadata-eval57.7%
frac-times57.7%
sqrt-unprod25.5%
add-sqr-sqrt50.9%
metadata-eval50.9%
metadata-eval50.9%
pow-prod-up50.9%
pow150.9%
inv-pow50.9%
associate-*r/50.9%
add-sqr-sqrt25.5%
fma-def25.5%
Applied egg-rr99.8%
if -2.4e23 < F < 2e7Initial program 99.4%
associate-*l/99.5%
+-commutative99.5%
*-commutative99.5%
fma-udef99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
associate-/l*99.4%
fma-def99.4%
fma-udef99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
Applied egg-rr99.4%
Taylor expanded in B around inf 99.4%
div-inv99.6%
expm1-log1p-u71.8%
expm1-udef56.0%
Applied egg-rr56.0%
expm1-def71.8%
expm1-log1p99.6%
Simplified99.6%
expm1-log1p-u85.0%
expm1-udef69.7%
*-commutative69.7%
associate-+r+69.7%
add-sqr-sqrt69.7%
unpow269.7%
hypot-def69.7%
+-commutative69.7%
fma-def69.7%
Applied egg-rr69.7%
expm1-def85.0%
expm1-log1p99.6%
*-lft-identity99.6%
associate-*r/99.6%
times-frac99.6%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
if 2e7 < F Initial program 54.4%
Simplified68.7%
Taylor expanded in F around inf 99.5%
associate-/r*99.5%
Simplified99.5%
associate-*r/99.6%
pow199.6%
inv-pow99.6%
pow-prod-up99.7%
metadata-eval99.7%
metadata-eval99.7%
frac-2neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4e+50)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 120000000.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* 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 <= -4e+50) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (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 <= (-4d+50)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 120000000.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (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 <= -4e+50) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 120000000.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (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 <= -4e+50: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 120000000.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (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 <= -4e+50) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 120000000.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - t_0); else tmp = Float64(Float64(-1.0 / Float64(-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 <= -4e+50) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 120000000.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (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, -4e+50], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 120000000.0], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - 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 -4 \cdot 10^{+50}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 120000000:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{-\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.0000000000000003e50Initial program 50.9%
Taylor expanded in F around -inf 99.7%
+-commutative99.7%
add-sqr-sqrt47.9%
sqrt-unprod56.2%
frac-times56.2%
metadata-eval56.2%
metadata-eval56.2%
frac-times56.2%
sqrt-unprod25.7%
add-sqr-sqrt50.8%
metadata-eval50.8%
metadata-eval50.8%
pow-prod-up50.8%
pow150.8%
inv-pow50.8%
associate-*r/50.8%
add-sqr-sqrt25.7%
fma-def25.7%
Applied egg-rr99.8%
if -4.0000000000000003e50 < F < 1.2e8Initial program 99.4%
div-inv99.6%
expm1-log1p-u70.9%
expm1-udef55.5%
Applied egg-rr55.5%
expm1-def70.9%
expm1-log1p99.6%
Simplified99.6%
if 1.2e8 < F Initial program 54.4%
Simplified68.7%
Taylor expanded in F around inf 99.5%
associate-/r*99.5%
Simplified99.5%
associate-*r/99.6%
pow199.6%
inv-pow99.6%
pow-prod-up99.7%
metadata-eval99.7%
metadata-eval99.7%
frac-2neg99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Final simplification99.7%
(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.4)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ -1.0 (- (sin B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (-1.0 / -sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = ((-1.0d0) / -sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (-1.0 / -Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (-1.0 / -math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(-1.0 / Float64(-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.4) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (-1.0 / -sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.42:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{-\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 56.6%
Taylor expanded in F around -inf 99.4%
+-commutative99.4%
add-sqr-sqrt49.6%
sqrt-unprod57.8%
frac-times57.8%
metadata-eval57.8%
metadata-eval57.8%
frac-times57.8%
sqrt-unprod23.6%
add-sqr-sqrt51.6%
metadata-eval51.6%
metadata-eval51.6%
pow-prod-up51.6%
pow151.6%
inv-pow51.6%
associate-*r/51.6%
add-sqr-sqrt23.6%
fma-def23.6%
Applied egg-rr99.5%
if -1.4199999999999999 < F < 1.3999999999999999Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.1%
Taylor expanded in x around 0 99.2%
if 1.3999999999999999 < F Initial program 55.1%
Simplified69.1%
Taylor expanded in F around inf 99.4%
associate-/r*99.4%
Simplified99.4%
associate-*r/99.5%
pow199.5%
inv-pow99.5%
pow-prod-up99.6%
metadata-eval99.6%
metadata-eval99.6%
frac-2neg99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.35e-25)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F 0.0205)
(/ (- x) (tan B))
(if (<= F 3.2e+53) (+ t_0 (/ 1.0 (sin B))) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.35e-25) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= 0.0205) {
tmp = -x / tan(B);
} else if (F <= 3.2e+53) {
tmp = t_0 + (1.0 / sin(B));
} else {
tmp = (1.0 / 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.35d-25)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= 0.0205d0) then
tmp = -x / tan(b)
else if (f <= 3.2d+53) then
tmp = t_0 + (1.0d0 / sin(b))
else
tmp = (1.0d0 / 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.35e-25) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= 0.0205) {
tmp = -x / Math.tan(B);
} else if (F <= 3.2e+53) {
tmp = t_0 + (1.0 / Math.sin(B));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.35e-25: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= 0.0205: tmp = -x / math.tan(B) elif F <= 3.2e+53: tmp = t_0 + (1.0 / math.sin(B)) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.35e-25) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= 0.0205) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 3.2e+53) tmp = Float64(t_0 + Float64(1.0 / sin(B))); else tmp = Float64(Float64(1.0 / 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.35e-25) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= 0.0205) tmp = -x / tan(B); elseif (F <= 3.2e+53) tmp = t_0 + (1.0 / sin(B)); else tmp = (1.0 / 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.35e-25], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.0205], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.2e+53], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.35 \cdot 10^{-25}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 0.0205:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{+53}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -1.35000000000000008e-25Initial program 57.8%
Taylor expanded in F around -inf 96.8%
Taylor expanded in B around 0 75.1%
if -1.35000000000000008e-25 < F < 0.0205000000000000009Initial program 99.4%
Taylor expanded in F around -inf 37.4%
Taylor expanded in x around inf 73.0%
associate-/l*73.0%
tan-quot73.1%
expm1-log1p-u46.5%
expm1-udef29.9%
Applied egg-rr29.9%
expm1-def46.5%
expm1-log1p73.1%
Simplified73.1%
if 0.0205000000000000009 < F < 3.2e53Initial program 99.3%
Taylor expanded in F around -inf 8.8%
+-commutative8.8%
add-sqr-sqrt8.6%
sqrt-unprod16.7%
frac-times16.7%
metadata-eval16.7%
metadata-eval16.7%
frac-times16.7%
sqrt-unprod15.4%
add-sqr-sqrt92.6%
metadata-eval92.6%
metadata-eval92.6%
pow-prod-up92.5%
pow192.5%
inv-pow92.5%
associate-*r/92.1%
add-sqr-sqrt15.2%
add-sqr-sqrt92.1%
Applied egg-rr82.9%
fma-udef82.9%
*-commutative82.9%
associate-*l/83.2%
lft-mult-inverse83.3%
Simplified83.3%
if 3.2e53 < F Initial program 45.5%
Simplified62.6%
Taylor expanded in F around inf 99.5%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 81.0%
Final simplification75.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -3.1e-31)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.0205)
(/ (- x) (tan B))
(if (<= F 4.4e+54) (+ t_0 (/ 1.0 (sin B))) (- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -3.1e-31) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.0205) {
tmp = -x / tan(B);
} else if (F <= 4.4e+54) {
tmp = t_0 + (1.0 / sin(B));
} else {
tmp = (1.0 / 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 <= (-3.1d-31)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.0205d0) then
tmp = -x / tan(b)
else if (f <= 4.4d+54) then
tmp = t_0 + (1.0d0 / sin(b))
else
tmp = (1.0d0 / 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 <= -3.1e-31) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.0205) {
tmp = -x / Math.tan(B);
} else if (F <= 4.4e+54) {
tmp = t_0 + (1.0 / Math.sin(B));
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -3.1e-31: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.0205: tmp = -x / math.tan(B) elif F <= 4.4e+54: tmp = t_0 + (1.0 / math.sin(B)) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -3.1e-31) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.0205) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 4.4e+54) tmp = Float64(t_0 + Float64(1.0 / sin(B))); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -3.1e-31) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.0205) tmp = -x / tan(B); elseif (F <= 4.4e+54) tmp = t_0 + (1.0 / sin(B)); else tmp = (1.0 / 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, -3.1e-31], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.0205], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.4e+54], N[(t$95$0 + N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -3.1 \cdot 10^{-31}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 0.0205:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 4.4 \cdot 10^{+54}:\\
\;\;\;\;t\_0 + \frac{1}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -3.1e-31Initial program 58.4%
Taylor expanded in F around -inf 95.6%
+-commutative95.6%
add-sqr-sqrt47.6%
sqrt-unprod55.5%
frac-times55.5%
metadata-eval55.5%
metadata-eval55.5%
frac-times55.5%
sqrt-unprod22.6%
add-sqr-sqrt49.5%
metadata-eval49.5%
metadata-eval49.5%
pow-prod-up49.5%
pow149.5%
inv-pow49.5%
associate-*r/49.5%
add-sqr-sqrt22.6%
fma-def22.6%
Applied egg-rr95.7%
if -3.1e-31 < F < 0.0205000000000000009Initial program 99.4%
Taylor expanded in F around -inf 37.7%
Taylor expanded in x around inf 73.6%
associate-/l*73.6%
tan-quot73.7%
expm1-log1p-u46.8%
expm1-udef30.1%
Applied egg-rr30.1%
expm1-def46.8%
expm1-log1p73.7%
Simplified73.7%
if 0.0205000000000000009 < F < 4.3999999999999998e54Initial program 99.3%
Taylor expanded in F around -inf 8.8%
+-commutative8.8%
add-sqr-sqrt8.6%
sqrt-unprod16.7%
frac-times16.7%
metadata-eval16.7%
metadata-eval16.7%
frac-times16.7%
sqrt-unprod15.4%
add-sqr-sqrt92.6%
metadata-eval92.6%
metadata-eval92.6%
pow-prod-up92.5%
pow192.5%
inv-pow92.5%
associate-*r/92.1%
add-sqr-sqrt15.2%
add-sqr-sqrt92.1%
Applied egg-rr82.9%
fma-udef82.9%
*-commutative82.9%
associate-*l/83.2%
lft-mult-inverse83.3%
Simplified83.3%
if 4.3999999999999998e54 < F Initial program 45.5%
Simplified62.6%
Taylor expanded in F around inf 99.5%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 81.0%
Final simplification81.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -0.32)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 4.4e-9)
(- (/ (* F (sqrt 0.5)) B) t_0)
(- (/ -1.0 (- (sin B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -0.32) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 4.4e-9) {
tmp = ((F * sqrt(0.5)) / B) - t_0;
} else {
tmp = (-1.0 / -sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-0.32d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 4.4d-9) then
tmp = ((f * sqrt(0.5d0)) / b) - t_0
else
tmp = ((-1.0d0) / -sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -0.32) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 4.4e-9) {
tmp = ((F * Math.sqrt(0.5)) / B) - t_0;
} else {
tmp = (-1.0 / -Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -0.32: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 4.4e-9: tmp = ((F * math.sqrt(0.5)) / B) - t_0 else: tmp = (-1.0 / -math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -0.32) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 4.4e-9) tmp = Float64(Float64(Float64(F * sqrt(0.5)) / B) - t_0); else tmp = Float64(Float64(-1.0 / Float64(-sin(B))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -0.32) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 4.4e-9) tmp = ((F * sqrt(0.5)) / B) - t_0; else tmp = (-1.0 / -sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -0.32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4.4e-9], N[(N[(N[(F * N[Sqrt[0.5], $MachinePrecision]), $MachinePrecision] / B), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(-1.0 / (-N[Sin[B], $MachinePrecision])), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -0.32:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 4.4 \cdot 10^{-9}:\\
\;\;\;\;\frac{F \cdot \sqrt{0.5}}{B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{-\sin B} - t\_0\\
\end{array}
\end{array}
if F < -0.320000000000000007Initial program 56.6%
Taylor expanded in F around -inf 99.4%
+-commutative99.4%
add-sqr-sqrt49.6%
sqrt-unprod57.8%
frac-times57.8%
metadata-eval57.8%
metadata-eval57.8%
frac-times57.8%
sqrt-unprod23.6%
add-sqr-sqrt51.6%
metadata-eval51.6%
metadata-eval51.6%
pow-prod-up51.6%
pow151.6%
inv-pow51.6%
associate-*r/51.6%
add-sqr-sqrt23.6%
fma-def23.6%
Applied egg-rr99.5%
if -0.320000000000000007 < F < 4.3999999999999997e-9Initial program 99.4%
Simplified99.7%
Taylor expanded in F around 0 99.6%
Taylor expanded in B around 0 86.3%
Taylor expanded in x around 0 86.3%
if 4.3999999999999997e-9 < F Initial program 57.0%
Simplified70.4%
Taylor expanded in F around inf 96.9%
associate-/r*96.9%
Simplified96.9%
associate-*r/97.0%
pow197.0%
inv-pow97.0%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
frac-2neg97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Final simplification92.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5.6e-33)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.9e-26) (/ (- x) (tan B)) (- (/ -1.0 (- (sin B))) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.6e-33) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.9e-26) {
tmp = -x / tan(B);
} else {
tmp = (-1.0 / -sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5.6d-33)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.9d-26) then
tmp = -x / tan(b)
else
tmp = ((-1.0d0) / -sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5.6e-33) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.9e-26) {
tmp = -x / Math.tan(B);
} else {
tmp = (-1.0 / -Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.6e-33: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.9e-26: tmp = -x / math.tan(B) else: tmp = (-1.0 / -math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.6e-33) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.9e-26) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(-1.0 / Float64(-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.6e-33) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.9e-26) tmp = -x / tan(B); else tmp = (-1.0 / -sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.6e-33], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.9e-26], N[((-x) / N[Tan[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 -5.6 \cdot 10^{-33}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.9 \cdot 10^{-26}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{-\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5.6e-33Initial program 58.4%
Taylor expanded in F around -inf 95.6%
+-commutative95.6%
add-sqr-sqrt47.6%
sqrt-unprod55.5%
frac-times55.5%
metadata-eval55.5%
metadata-eval55.5%
frac-times55.5%
sqrt-unprod22.6%
add-sqr-sqrt49.5%
metadata-eval49.5%
metadata-eval49.5%
pow-prod-up49.5%
pow149.5%
inv-pow49.5%
associate-*r/49.5%
add-sqr-sqrt22.6%
fma-def22.6%
Applied egg-rr95.7%
if -5.6e-33 < F < 2.8999999999999998e-26Initial program 99.4%
Taylor expanded in F around -inf 37.8%
Taylor expanded in x around inf 74.6%
associate-/l*74.5%
tan-quot74.7%
expm1-log1p-u48.0%
expm1-udef30.8%
Applied egg-rr30.8%
expm1-def48.0%
expm1-log1p74.7%
Simplified74.7%
if 2.8999999999999998e-26 < F Initial program 57.6%
Simplified70.8%
Taylor expanded in F around inf 95.7%
associate-/r*95.7%
Simplified95.7%
associate-*r/95.8%
pow195.8%
inv-pow95.8%
pow-prod-up95.9%
metadata-eval95.9%
metadata-eval95.9%
frac-2neg95.9%
metadata-eval95.9%
Applied egg-rr95.9%
Final simplification86.4%
(FPCore (F B x)
:precision binary64
(if (<= F 200000000.0)
(/ (- x) (tan B))
(if (<= F 3.6e+109)
(- (/ 1.0 B) (/ x B))
(if (<= F 3.5e+185) (/ -1.0 (/ (tan B) x)) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= 200000000.0) {
tmp = -x / tan(B);
} else if (F <= 3.6e+109) {
tmp = (1.0 / B) - (x / B);
} else if (F <= 3.5e+185) {
tmp = -1.0 / (tan(B) / x);
} 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 <= 200000000.0d0) then
tmp = -x / tan(b)
else if (f <= 3.6d+109) then
tmp = (1.0d0 / b) - (x / b)
else if (f <= 3.5d+185) then
tmp = (-1.0d0) / (tan(b) / x)
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 <= 200000000.0) {
tmp = -x / Math.tan(B);
} else if (F <= 3.6e+109) {
tmp = (1.0 / B) - (x / B);
} else if (F <= 3.5e+185) {
tmp = -1.0 / (Math.tan(B) / x);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 200000000.0: tmp = -x / math.tan(B) elif F <= 3.6e+109: tmp = (1.0 / B) - (x / B) elif F <= 3.5e+185: tmp = -1.0 / (math.tan(B) / x) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 200000000.0) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 3.6e+109) tmp = Float64(Float64(1.0 / B) - Float64(x / B)); elseif (F <= 3.5e+185) tmp = Float64(-1.0 / Float64(tan(B) / x)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 200000000.0) tmp = -x / tan(B); elseif (F <= 3.6e+109) tmp = (1.0 / B) - (x / B); elseif (F <= 3.5e+185) tmp = -1.0 / (tan(B) / x); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 200000000.0], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.6e+109], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.5e+185], N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 200000000:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 3.6 \cdot 10^{+109}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.5 \cdot 10^{+185}:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2e8Initial program 84.1%
Taylor expanded in F around -inf 58.9%
Taylor expanded in x around inf 64.4%
associate-/l*64.4%
tan-quot64.5%
expm1-log1p-u37.9%
expm1-udef27.5%
Applied egg-rr27.5%
expm1-def37.9%
expm1-log1p64.5%
Simplified64.5%
if 2e8 < F < 3.6e109Initial program 99.4%
Simplified99.3%
Taylor expanded in F around inf 99.4%
associate-/r*99.3%
Simplified99.3%
Taylor expanded in B around 0 54.9%
div-sub55.0%
Applied egg-rr55.0%
if 3.6e109 < F < 3.50000000000000023e185Initial program 73.2%
Taylor expanded in F around -inf 72.6%
Taylor expanded in x around inf 75.3%
associate-/l*75.0%
tan-quot75.1%
clear-num75.3%
inv-pow75.3%
Applied egg-rr75.3%
unpow-175.3%
Simplified75.3%
if 3.50000000000000023e185 < F Initial program 20.6%
Simplified42.3%
Taylor expanded in F around inf 99.5%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 66.1%
Final simplification64.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) (tan B))))
(if (<= F 235000000000.0)
t_0
(if (<= F 2e+117)
(- (/ 1.0 B) (/ x B))
(if (<= F 2.65e+185) t_0 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = -x / tan(B);
double tmp;
if (F <= 235000000000.0) {
tmp = t_0;
} else if (F <= 2e+117) {
tmp = (1.0 / B) - (x / B);
} else if (F <= 2.65e+185) {
tmp = t_0;
} 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) :: t_0
real(8) :: tmp
t_0 = -x / tan(b)
if (f <= 235000000000.0d0) then
tmp = t_0
else if (f <= 2d+117) then
tmp = (1.0d0 / b) - (x / b)
else if (f <= 2.65d+185) then
tmp = t_0
else
tmp = (1.0d0 - x) / 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 <= 235000000000.0) {
tmp = t_0;
} else if (F <= 2e+117) {
tmp = (1.0 / B) - (x / B);
} else if (F <= 2.65e+185) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = -x / math.tan(B) tmp = 0 if F <= 235000000000.0: tmp = t_0 elif F <= 2e+117: tmp = (1.0 / B) - (x / B) elif F <= 2.65e+185: tmp = t_0 else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / tan(B)) tmp = 0.0 if (F <= 235000000000.0) tmp = t_0; elseif (F <= 2e+117) tmp = Float64(Float64(1.0 / B) - Float64(x / B)); elseif (F <= 2.65e+185) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / tan(B); tmp = 0.0; if (F <= 235000000000.0) tmp = t_0; elseif (F <= 2e+117) tmp = (1.0 / B) - (x / B); elseif (F <= 2.65e+185) tmp = t_0; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, 235000000000.0], t$95$0, If[LessEqual[F, 2e+117], N[(N[(1.0 / B), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.65e+185], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{\tan B}\\
\mathbf{if}\;F \leq 235000000000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq 2 \cdot 10^{+117}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.65 \cdot 10^{+185}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.35e11 or 2.0000000000000001e117 < F < 2.65000000000000004e185Initial program 83.5%
Taylor expanded in F around -inf 59.7%
Taylor expanded in x around inf 65.0%
associate-/l*65.0%
tan-quot65.1%
expm1-log1p-u37.9%
expm1-udef28.0%
Applied egg-rr28.0%
expm1-def37.9%
expm1-log1p65.1%
Simplified65.1%
if 2.35e11 < F < 2.0000000000000001e117Initial program 99.4%
Simplified99.3%
Taylor expanded in F around inf 99.4%
associate-/r*99.3%
Simplified99.3%
Taylor expanded in B around 0 54.9%
div-sub55.0%
Applied egg-rr55.0%
if 2.65000000000000004e185 < F Initial program 20.6%
Simplified42.3%
Taylor expanded in F around inf 99.5%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 66.1%
Final simplification64.4%
(FPCore (F B x) :precision binary64 (if (<= F -2.05e+43) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 5.7e-27) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.05e+43) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 5.7e-27) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.05d+43)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 5.7d-27) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.05e+43) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 5.7e-27) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.05e+43: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 5.7e-27: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.05e+43) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 5.7e-27) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -2.05e+43) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 5.7e-27) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.05e+43], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.7e-27], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.05 \cdot 10^{+43}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 5.7 \cdot 10^{-27}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -2.05e43Initial program 51.7%
Taylor expanded in F around -inf 99.7%
Taylor expanded in B around 0 73.0%
if -2.05e43 < F < 5.6999999999999996e-27Initial program 99.4%
Taylor expanded in F around -inf 40.4%
Taylor expanded in x around inf 72.4%
associate-/l*72.4%
tan-quot72.5%
expm1-log1p-u46.5%
expm1-udef30.7%
Applied egg-rr30.7%
expm1-def46.5%
expm1-log1p72.5%
Simplified72.5%
if 5.6999999999999996e-27 < F Initial program 57.6%
Simplified70.8%
Taylor expanded in F around inf 95.7%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in B around 0 69.6%
Final simplification71.8%
(FPCore (F B x) :precision binary64 (if (<= F -4.5e-27) (+ (* x (/ -1.0 (tan B))) (/ -1.0 B)) (if (<= F 2.05e-26) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-27) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= 2.05e-26) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.5d-27)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= 2.05d-26) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.5e-27) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= 2.05e-26) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.5e-27: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= 2.05e-26: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.5e-27) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= 2.05e-26) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.5e-27) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= 2.05e-26) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.5e-27], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.05e-26], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.5 \cdot 10^{-27}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 2.05 \cdot 10^{-26}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -4.5000000000000002e-27Initial program 57.8%
Taylor expanded in F around -inf 96.8%
Taylor expanded in B around 0 75.1%
if -4.5000000000000002e-27 < F < 2.0499999999999999e-26Initial program 99.4%
Taylor expanded in F around -inf 37.5%
Taylor expanded in x around inf 74.0%
associate-/l*73.9%
tan-quot74.1%
expm1-log1p-u47.6%
expm1-udef30.6%
Applied egg-rr30.6%
expm1-def47.6%
expm1-log1p74.1%
Simplified74.1%
if 2.0499999999999999e-26 < F Initial program 57.6%
Simplified70.8%
Taylor expanded in F around inf 95.7%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in B around 0 69.6%
Final simplification73.1%
(FPCore (F B x) :precision binary64 (if (<= F -9e-25) (+ (/ (- -1.0 x) B) (* B (- (* x 0.3333333333333333) 0.16666666666666666))) (if (<= F 4.2e+23) (/ (- x) (sin B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -9e-25) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 4.2e+23) {
tmp = -x / sin(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 <= (-9d-25)) then
tmp = (((-1.0d0) - x) / b) + (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0))
else if (f <= 4.2d+23) then
tmp = -x / sin(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 <= -9e-25) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 4.2e+23) {
tmp = -x / Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -9e-25: tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)) elif F <= 4.2e+23: tmp = -x / math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -9e-25) tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666))); elseif (F <= 4.2e+23) tmp = Float64(Float64(-x) / sin(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 <= -9e-25) tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)); elseif (F <= 4.2e+23) tmp = -x / sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -9e-25], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e+23], N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -9 \cdot 10^{-25}:\\
\;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+23}:\\
\;\;\;\;\frac{-x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -9.0000000000000002e-25Initial program 57.8%
Taylor expanded in F around -inf 96.8%
Taylor expanded in B around 0 46.2%
if -9.0000000000000002e-25 < F < 4.2000000000000003e23Initial program 99.4%
Taylor expanded in F around -inf 36.5%
Taylor expanded in x around inf 71.3%
Taylor expanded in B around 0 43.5%
if 4.2000000000000003e23 < F Initial program 53.8%
Simplified68.2%
Taylor expanded in F around inf 99.4%
associate-/r*99.5%
Simplified99.5%
Taylor expanded in B around 0 57.2%
Final simplification47.7%
(FPCore (F B x) :precision binary64 (if (<= F 5e-26) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= 5e-26) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 5d-26) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 5e-26) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 5e-26: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 5e-26) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 5e-26) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 5e-26], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5 \cdot 10^{-26}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < 5.00000000000000019e-26Initial program 83.7%
Taylor expanded in F around -inf 59.9%
Taylor expanded in x around inf 65.4%
associate-/l*65.5%
tan-quot65.5%
expm1-log1p-u38.8%
expm1-udef28.1%
Applied egg-rr28.1%
expm1-def38.8%
expm1-log1p65.5%
Simplified65.5%
if 5.00000000000000019e-26 < F Initial program 57.6%
Simplified70.8%
Taylor expanded in F around inf 95.7%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in B around 0 69.6%
Final simplification66.7%
(FPCore (F B x) :precision binary64 (if (<= F -2.4e-27) (+ (/ (- -1.0 x) B) (* B (- (* x 0.3333333333333333) 0.16666666666666666))) (if (<= F 8.2e-29) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.4e-27) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 8.2e-29) {
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.4d-27)) then
tmp = (((-1.0d0) - x) / b) + (b * ((x * 0.3333333333333333d0) - 0.16666666666666666d0))
else if (f <= 8.2d-29) 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.4e-27) {
tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666));
} else if (F <= 8.2e-29) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.4e-27: tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)) elif F <= 8.2e-29: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.4e-27) tmp = Float64(Float64(Float64(-1.0 - x) / B) + Float64(B * Float64(Float64(x * 0.3333333333333333) - 0.16666666666666666))); elseif (F <= 8.2e-29) 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.4e-27) tmp = ((-1.0 - x) / B) + (B * ((x * 0.3333333333333333) - 0.16666666666666666)); elseif (F <= 8.2e-29) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.4e-27], N[(N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision] + N[(B * N[(N[(x * 0.3333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 8.2e-29], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.4 \cdot 10^{-27}:\\
\;\;\;\;\frac{-1 - x}{B} + B \cdot \left(x \cdot 0.3333333333333333 - 0.16666666666666666\right)\\
\mathbf{elif}\;F \leq 8.2 \cdot 10^{-29}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.40000000000000002e-27Initial program 57.8%
Taylor expanded in F around -inf 96.8%
Taylor expanded in B around 0 46.2%
if -2.40000000000000002e-27 < F < 8.1999999999999996e-29Initial program 99.4%
Simplified99.7%
Taylor expanded in F around inf 24.5%
associate-/r*24.5%
Simplified24.5%
Taylor expanded in B around 0 22.6%
Taylor expanded in x around inf 44.1%
associate-*r/44.1%
neg-mul-144.1%
Simplified44.1%
if 8.1999999999999996e-29 < F Initial program 57.6%
Simplified70.8%
Taylor expanded in F around inf 95.7%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in B around 0 52.7%
Final simplification47.1%
(FPCore (F B x) :precision binary64 (if (<= F -4.7e-29) (/ (- -1.0 x) B) (if (<= F 4.2e-25) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.7e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.2e-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 <= (-4.7d-29)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.2d-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 <= -4.7e-29) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.2e-25) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.7e-29: tmp = (-1.0 - x) / B elif F <= 4.2e-25: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.7e-29) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.2e-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 <= -4.7e-29) tmp = (-1.0 - x) / B; elseif (F <= 4.2e-25) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.7e-29], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.2e-25], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.7 \cdot 10^{-29}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -4.6999999999999998e-29Initial program 57.8%
Taylor expanded in F around -inf 96.8%
Taylor expanded in B around 0 45.9%
associate-*r/45.9%
distribute-lft-in45.9%
metadata-eval45.9%
neg-mul-145.9%
Simplified45.9%
if -4.6999999999999998e-29 < F < 4.20000000000000005e-25Initial program 99.4%
Simplified99.7%
Taylor expanded in F around inf 24.5%
associate-/r*24.5%
Simplified24.5%
Taylor expanded in B around 0 22.6%
Taylor expanded in x around inf 44.1%
associate-*r/44.1%
neg-mul-144.1%
Simplified44.1%
if 4.20000000000000005e-25 < F Initial program 57.6%
Simplified70.8%
Taylor expanded in F around inf 95.7%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in B around 0 52.7%
Final simplification47.0%
(FPCore (F B x) :precision binary64 (if (or (<= x -6.5e-133) (not (<= x 1.4e-146))) (/ (- x) B) (/ 1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -6.5e-133) || !(x <= 1.4e-146)) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-6.5d-133)) .or. (.not. (x <= 1.4d-146))) then
tmp = -x / b
else
tmp = 1.0d0 / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -6.5e-133) || !(x <= 1.4e-146)) {
tmp = -x / B;
} else {
tmp = 1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -6.5e-133) or not (x <= 1.4e-146): tmp = -x / B else: tmp = 1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -6.5e-133) || !(x <= 1.4e-146)) 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 ((x <= -6.5e-133) || ~((x <= 1.4e-146))) tmp = -x / B; else tmp = 1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -6.5e-133], N[Not[LessEqual[x, 1.4e-146]], $MachinePrecision]], N[((-x) / B), $MachinePrecision], N[(1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.5 \cdot 10^{-133} \lor \neg \left(x \leq 1.4 \cdot 10^{-146}\right):\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B}\\
\end{array}
\end{array}
if x < -6.5000000000000002e-133 or 1.40000000000000001e-146 < x Initial program 80.7%
Simplified91.4%
Taylor expanded in F around inf 61.8%
associate-/r*61.8%
Simplified61.8%
Taylor expanded in B around 0 36.0%
Taylor expanded in x around inf 43.8%
associate-*r/43.8%
neg-mul-143.8%
Simplified43.8%
if -6.5000000000000002e-133 < x < 1.40000000000000001e-146Initial program 66.8%
Simplified68.3%
Taylor expanded in F around inf 27.4%
associate-/r*27.4%
Simplified27.4%
Taylor expanded in B around 0 18.4%
Taylor expanded in x around 0 18.4%
Final simplification36.1%
(FPCore (F B x) :precision binary64 (if (<= F 3.6e-28) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 3.6e-28) {
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.6d-28) 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.6e-28) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 3.6e-28: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 3.6e-28) 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.6e-28) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 3.6e-28], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.6 \cdot 10^{-28}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 3.5999999999999999e-28Initial program 83.7%
Simplified89.6%
Taylor expanded in F around inf 34.3%
associate-/r*34.3%
Simplified34.3%
Taylor expanded in B around 0 22.2%
Taylor expanded in x around inf 35.8%
associate-*r/35.8%
neg-mul-135.8%
Simplified35.8%
if 3.5999999999999999e-28 < F Initial program 57.6%
Simplified70.8%
Taylor expanded in F around inf 95.7%
associate-/r*95.7%
Simplified95.7%
Taylor expanded in B around 0 52.7%
Final simplification40.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 76.4%
Simplified84.4%
Taylor expanded in F around inf 51.3%
associate-/r*51.3%
Simplified51.3%
Taylor expanded in B around 0 30.6%
Taylor expanded in x around 0 10.9%
Final simplification10.9%
herbie shell --seed 2024031
(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))))))