
(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 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= F -8e+34)
(- (/ -1.0 (sin B)) t_1)
(if (<= F 40000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (* F t_0) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- t_0 t_1)))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (F <= -8e+34) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= 40000000.0) {
tmp = (x * (-1.0 / tan(B))) + ((F * t_0) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 1.0d0 / sin(b)
t_1 = x / tan(b)
if (f <= (-8d+34)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= 40000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f * t_0) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = t_0 - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = 1.0 / Math.sin(B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -8e+34) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= 40000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F * t_0) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = t_0 - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = 1.0 / math.sin(B) t_1 = x / math.tan(B) tmp = 0 if F <= -8e+34: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= 40000000.0: tmp = (x * (-1.0 / math.tan(B))) + ((F * t_0) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = t_0 - t_1 return tmp
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -8e+34) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= 40000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F * t_0) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(t_0 - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = 1.0 / sin(B); t_1 = x / tan(B); tmp = 0.0; if (F <= -8e+34) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= 40000000.0) tmp = (x * (-1.0 / tan(B))) + ((F * t_0) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = t_0 - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -8e+34], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, 40000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F * t$95$0), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -8 \cdot 10^{+34}:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \left(F \cdot t_0\right) \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;t_0 - t_1\\
\end{array}
\end{array}
if F < -7.99999999999999956e34Initial program 47.9%
+-commutative47.9%
unsub-neg47.9%
associate-*l/62.7%
associate-*r/62.6%
*-commutative62.6%
Simplified62.7%
clear-num62.6%
inv-pow62.6%
fma-def62.6%
fma-udef62.6%
*-commutative62.6%
fma-def62.6%
fma-def62.6%
Applied egg-rr62.6%
unpow-162.6%
fma-udef62.6%
fma-udef62.6%
unpow262.6%
+-commutative62.6%
associate-+r+62.6%
+-commutative62.6%
+-commutative62.6%
unpow262.6%
fma-def62.6%
+-commutative62.6%
fma-def62.6%
Simplified62.6%
Taylor expanded in F around -inf 99.8%
if -7.99999999999999956e34 < F < 4e7Initial program 99.4%
clear-num99.4%
associate-/r/99.5%
Applied egg-rr99.5%
if 4e7 < F Initial program 60.2%
+-commutative60.2%
unsub-neg60.2%
associate-*l/67.3%
associate-*r/67.3%
*-commutative67.3%
Simplified67.5%
clear-num67.4%
inv-pow67.4%
fma-def67.4%
fma-udef67.4%
*-commutative67.4%
fma-def67.4%
fma-def67.4%
Applied egg-rr67.4%
unpow-167.4%
fma-udef67.4%
fma-udef67.4%
unpow267.4%
+-commutative67.4%
associate-+r+67.4%
+-commutative67.4%
+-commutative67.4%
unpow267.4%
fma-def67.4%
+-commutative67.4%
fma-def67.4%
Simplified67.4%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= x -1.0)
(- (* F (/ (pow (fma x 2.0 (fma F F 2.0)) -0.5) (sin B))) t_0)
(- (* F (/ (/ 1.0 (sin B)) (hypot F (sqrt (fma 2.0 x 2.0))))) t_0))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (x <= -1.0) {
tmp = (F * (pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5) / sin(B))) - t_0;
} else {
tmp = (F * ((1.0 / sin(B)) / hypot(F, sqrt(fma(2.0, x, 2.0))))) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (x <= -1.0) tmp = Float64(Float64(F * Float64((fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5) / sin(B))) - t_0); else tmp = Float64(Float64(F * Float64(Float64(1.0 / sin(B)) / hypot(F, sqrt(fma(2.0, x, 2.0))))) - t_0); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(N[(F * N[(N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F * N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] / N[Sqrt[F ^ 2 + N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;F \cdot \frac{{\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{\frac{1}{\sin B}}{\mathsf{hypot}\left(F, \sqrt{\mathsf{fma}\left(2, x, 2\right)}\right)} - t_0\\
\end{array}
\end{array}
if x < -1Initial program 62.5%
+-commutative62.5%
unsub-neg62.5%
associate-*l/95.9%
associate-*r/95.8%
*-commutative95.8%
Simplified95.8%
if -1 < x Initial program 80.2%
+-commutative80.2%
unsub-neg80.2%
associate-*l/82.9%
associate-*r/82.9%
*-commutative82.9%
Simplified83.0%
clear-num83.0%
inv-pow83.0%
fma-def83.0%
fma-udef83.0%
*-commutative83.0%
fma-def83.0%
fma-def83.0%
Applied egg-rr83.0%
unpow-183.0%
fma-udef83.0%
fma-udef83.0%
unpow283.0%
+-commutative83.0%
associate-+r+83.0%
+-commutative83.0%
+-commutative83.0%
unpow283.0%
fma-def83.0%
+-commutative83.0%
fma-def83.0%
Simplified83.0%
inv-pow83.0%
div-inv83.0%
unpow-prod-down83.0%
inv-pow83.0%
pow-flip83.0%
metadata-eval83.0%
pow1/283.0%
fma-udef83.0%
add-sqr-sqrt83.0%
hypot-def99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ 1.0 (sin B))) (t_1 (/ x (tan B))))
(if (<= x -1.0)
(- t_0 t_1)
(- (* F (/ t_0 (hypot F (sqrt (fma 2.0 x 2.0))))) t_1))))
double code(double F, double B, double x) {
double t_0 = 1.0 / sin(B);
double t_1 = x / tan(B);
double tmp;
if (x <= -1.0) {
tmp = t_0 - t_1;
} else {
tmp = (F * (t_0 / hypot(F, sqrt(fma(2.0, x, 2.0))))) - t_1;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(1.0 / sin(B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (x <= -1.0) tmp = Float64(t_0 - t_1); else tmp = Float64(Float64(F * Float64(t_0 / hypot(F, sqrt(fma(2.0, x, 2.0))))) - t_1); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.0], N[(t$95$0 - t$95$1), $MachinePrecision], N[(N[(F * N[(t$95$0 / N[Sqrt[F ^ 2 + N[Sqrt[N[(2.0 * x + 2.0), $MachinePrecision]], $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{1}{\sin B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_0 - t_1\\
\mathbf{else}:\\
\;\;\;\;F \cdot \frac{t_0}{\mathsf{hypot}\left(F, \sqrt{\mathsf{fma}\left(2, x, 2\right)}\right)} - t_1\\
\end{array}
\end{array}
if x < -1Initial program 62.5%
+-commutative62.5%
unsub-neg62.5%
associate-*l/95.9%
associate-*r/95.8%
*-commutative95.8%
Simplified95.8%
clear-num95.8%
inv-pow95.8%
fma-def95.8%
fma-udef95.8%
*-commutative95.8%
fma-def95.8%
fma-def95.8%
Applied egg-rr95.8%
unpow-195.8%
fma-udef95.8%
fma-udef95.8%
unpow295.8%
+-commutative95.8%
associate-+r+95.8%
+-commutative95.8%
+-commutative95.8%
unpow295.8%
fma-def95.8%
+-commutative95.8%
fma-def95.8%
Simplified95.8%
Taylor expanded in F around inf 95.1%
if -1 < x Initial program 80.2%
+-commutative80.2%
unsub-neg80.2%
associate-*l/82.9%
associate-*r/82.9%
*-commutative82.9%
Simplified83.0%
clear-num83.0%
inv-pow83.0%
fma-def83.0%
fma-udef83.0%
*-commutative83.0%
fma-def83.0%
fma-def83.0%
Applied egg-rr83.0%
unpow-183.0%
fma-udef83.0%
fma-udef83.0%
unpow283.0%
+-commutative83.0%
associate-+r+83.0%
+-commutative83.0%
+-commutative83.0%
unpow283.0%
fma-def83.0%
+-commutative83.0%
fma-def83.0%
Simplified83.0%
inv-pow83.0%
div-inv83.0%
unpow-prod-down83.0%
inv-pow83.0%
pow-flip83.0%
metadata-eval83.0%
pow1/283.0%
fma-udef83.0%
add-sqr-sqrt83.0%
hypot-def99.6%
Applied egg-rr99.6%
unpow-199.6%
Simplified99.6%
un-div-inv99.7%
Applied egg-rr99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.45e+35)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 40000000.0)
(+
(* x (/ -1.0 (tan B)))
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F (sin 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 <= -1.45e+35) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 40000000.0) {
tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / sin(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 <= (-1.45d+35)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 40000000.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / sin(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 <= -1.45e+35) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 40000000.0) {
tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / Math.sin(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 <= -1.45e+35: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 40000000.0: tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / math.sin(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 <= -1.45e+35) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 40000000.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / sin(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 <= -1.45e+35) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 40000000.0) tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / sin(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, -1.45e+35], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 40000000.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.45 \cdot 10^{+35}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 40000000:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.44999999999999997e35Initial program 47.9%
+-commutative47.9%
unsub-neg47.9%
associate-*l/62.7%
associate-*r/62.6%
*-commutative62.6%
Simplified62.7%
clear-num62.6%
inv-pow62.6%
fma-def62.6%
fma-udef62.6%
*-commutative62.6%
fma-def62.6%
fma-def62.6%
Applied egg-rr62.6%
unpow-162.6%
fma-udef62.6%
fma-udef62.6%
unpow262.6%
+-commutative62.6%
associate-+r+62.6%
+-commutative62.6%
+-commutative62.6%
unpow262.6%
fma-def62.6%
+-commutative62.6%
fma-def62.6%
Simplified62.6%
Taylor expanded in F around -inf 99.8%
if -1.44999999999999997e35 < F < 4e7Initial program 99.4%
if 4e7 < F Initial program 60.2%
+-commutative60.2%
unsub-neg60.2%
associate-*l/67.3%
associate-*r/67.3%
*-commutative67.3%
Simplified67.5%
clear-num67.4%
inv-pow67.4%
fma-def67.4%
fma-udef67.4%
*-commutative67.4%
fma-def67.4%
fma-def67.4%
Applied egg-rr67.4%
unpow-167.4%
fma-udef67.4%
fma-udef67.4%
unpow267.4%
+-commutative67.4%
associate-+r+67.4%
+-commutative67.4%
+-commutative67.4%
unpow267.4%
fma-def67.4%
+-commutative67.4%
fma-def67.4%
Simplified67.4%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.46)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.65)
(- (* F (/ 1.0 (* (sin B) (sqrt (+ 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.46) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.65) {
tmp = (F * (1.0 / (sin(B) * sqrt((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.46d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.65d0) then
tmp = (f * (1.0d0 / (sin(b) * sqrt((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.46) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.65) {
tmp = (F * (1.0 / (Math.sin(B) * Math.sqrt((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.46: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.65: tmp = (F * (1.0 / (math.sin(B) * math.sqrt((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.46) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.65) tmp = Float64(Float64(F * Float64(1.0 / Float64(sin(B) * sqrt(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.46) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.65) tmp = (F * (1.0 / (sin(B) * sqrt((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.46], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.65], N[(N[(F * N[(1.0 / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $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.46:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.65:\\
\;\;\;\;F \cdot \frac{1}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.46Initial program 52.1%
+-commutative52.1%
unsub-neg52.1%
associate-*l/65.6%
associate-*r/65.6%
*-commutative65.6%
Simplified65.6%
clear-num65.6%
inv-pow65.6%
fma-def65.6%
fma-udef65.6%
*-commutative65.6%
fma-def65.6%
fma-def65.6%
Applied egg-rr65.6%
unpow-165.6%
fma-udef65.6%
fma-udef65.6%
unpow265.6%
+-commutative65.6%
associate-+r+65.6%
+-commutative65.6%
+-commutative65.6%
unpow265.6%
fma-def65.6%
+-commutative65.6%
fma-def65.6%
Simplified65.6%
Taylor expanded in F around -inf 99.8%
if -1.46 < F < 1.6499999999999999Initial program 99.4%
+-commutative99.4%
unsub-neg99.4%
associate-*l/99.4%
associate-*r/99.4%
*-commutative99.4%
Simplified99.6%
clear-num99.6%
inv-pow99.6%
fma-def99.6%
fma-udef99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
Applied egg-rr99.6%
unpow-199.6%
fma-udef99.6%
fma-udef99.6%
unpow299.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
unpow299.6%
fma-def99.6%
+-commutative99.6%
fma-def99.6%
Simplified99.6%
Taylor expanded in F around 0 99.5%
if 1.6499999999999999 < F Initial program 62.1%
+-commutative62.1%
unsub-neg62.1%
associate-*l/68.9%
associate-*r/68.9%
*-commutative68.9%
Simplified69.0%
clear-num69.0%
inv-pow69.0%
fma-def69.0%
fma-udef69.0%
*-commutative69.0%
fma-def69.0%
fma-def69.0%
Applied egg-rr69.0%
unpow-169.0%
fma-udef69.0%
fma-udef69.0%
unpow269.0%
+-commutative69.0%
associate-+r+69.0%
+-commutative69.0%
+-commutative69.0%
unpow269.0%
fma-def69.0%
+-commutative69.0%
fma-def69.0%
Simplified69.0%
Taylor expanded in F around inf 98.6%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.75)
(- (* F (/ (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.75) {
tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.75d0) then
tmp = (f * (sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.75) {
tmp = (F * (Math.sqrt((1.0 / (2.0 + (x * 2.0)))) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.75: tmp = (F * (math.sqrt((1.0 / (2.0 + (x * 2.0)))) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.75) tmp = Float64(Float64(F * Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.75) tmp = (F * (sqrt((1.0 / (2.0 + (x * 2.0)))) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.75], N[(N[(F * N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.4:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.75:\\
\;\;\;\;F \cdot \frac{\sqrt{\frac{1}{2 + x \cdot 2}}}{\sin B} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 52.1%
+-commutative52.1%
unsub-neg52.1%
associate-*l/65.6%
associate-*r/65.6%
*-commutative65.6%
Simplified65.6%
clear-num65.6%
inv-pow65.6%
fma-def65.6%
fma-udef65.6%
*-commutative65.6%
fma-def65.6%
fma-def65.6%
Applied egg-rr65.6%
unpow-165.6%
fma-udef65.6%
fma-udef65.6%
unpow265.6%
+-commutative65.6%
associate-+r+65.6%
+-commutative65.6%
+-commutative65.6%
unpow265.6%
fma-def65.6%
+-commutative65.6%
fma-def65.6%
Simplified65.6%
Taylor expanded in F around -inf 99.8%
if -1.3999999999999999 < F < 1.75Initial program 99.4%
+-commutative99.4%
unsub-neg99.4%
associate-*l/99.4%
associate-*r/99.4%
*-commutative99.4%
Simplified99.6%
Taylor expanded in F around 0 99.6%
if 1.75 < F Initial program 62.1%
+-commutative62.1%
unsub-neg62.1%
associate-*l/68.9%
associate-*r/68.9%
*-commutative68.9%
Simplified69.0%
clear-num69.0%
inv-pow69.0%
fma-def69.0%
fma-udef69.0%
*-commutative69.0%
fma-def69.0%
fma-def69.0%
Applied egg-rr69.0%
unpow-169.0%
fma-udef69.0%
fma-udef69.0%
unpow269.0%
+-commutative69.0%
associate-+r+69.0%
+-commutative69.0%
+-commutative69.0%
unpow269.0%
fma-def69.0%
+-commutative69.0%
fma-def69.0%
Simplified69.0%
Taylor expanded in F around inf 98.6%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F (sin B)))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -1.25e-37)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -2e-112)
t_0
(if (<= F 1.36e-157)
(/ (- x) (tan B))
(if (<= F 23500000.0) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / sin(B))) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -1.25e-37) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -2e-112) {
tmp = t_0;
} else if (F <= 1.36e-157) {
tmp = -x / tan(B);
} else if (F <= 23500000.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 = ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / sin(b))) - (x / b)
t_1 = x / tan(b)
if (f <= (-1.25d-37)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-2d-112)) then
tmp = t_0
else if (f <= 1.36d-157) then
tmp = -x / tan(b)
else if (f <= 23500000.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 = (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / Math.sin(B))) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -1.25e-37) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -2e-112) {
tmp = t_0;
} else if (F <= 1.36e-157) {
tmp = -x / Math.tan(B);
} else if (F <= 23500000.0) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / math.sin(B))) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -1.25e-37: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -2e-112: tmp = t_0 elif F <= 1.36e-157: tmp = -x / math.tan(B) elif F <= 23500000.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(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / sin(B))) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.25e-37) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -2e-112) tmp = t_0; elseif (F <= 1.36e-157) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 23500000.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 = ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / sin(B))) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -1.25e-37) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -2e-112) tmp = t_0; elseif (F <= 1.36e-157) tmp = -x / tan(B); elseif (F <= 23500000.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[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.25e-37], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -2e-112], t$95$0, If[LessEqual[F, 1.36e-157], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 23500000.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 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{\sin B} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.25 \cdot 10^{-37}:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq -2 \cdot 10^{-112}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.36 \cdot 10^{-157}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 23500000:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -1.2499999999999999e-37Initial program 56.8%
+-commutative56.8%
unsub-neg56.8%
associate-*l/69.0%
associate-*r/69.0%
*-commutative69.0%
Simplified69.0%
clear-num69.0%
inv-pow69.0%
fma-def69.0%
fma-udef69.0%
*-commutative69.0%
fma-def69.0%
fma-def69.0%
Applied egg-rr69.0%
unpow-169.0%
fma-udef69.0%
fma-udef69.0%
unpow269.0%
+-commutative69.0%
associate-+r+69.0%
+-commutative69.0%
+-commutative69.0%
unpow269.0%
fma-def69.0%
+-commutative69.0%
fma-def69.0%
Simplified69.0%
Taylor expanded in F around -inf 94.6%
if -1.2499999999999999e-37 < F < -1.9999999999999999e-112 or 1.36e-157 < F < 2.35e7Initial program 99.4%
Taylor expanded in B around 0 78.6%
if -1.9999999999999999e-112 < F < 1.36e-157Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 83.3%
mul-1-neg83.3%
*-commutative83.3%
associate-*l/83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in B around inf 83.3%
*-commutative83.3%
associate-*r/83.1%
Simplified83.1%
clear-num83.0%
tan-quot83.1%
expm1-log1p-u54.7%
expm1-udef25.4%
un-div-inv25.4%
Applied egg-rr25.4%
expm1-def54.8%
expm1-log1p83.4%
Simplified83.4%
if 2.35e7 < F Initial program 60.2%
+-commutative60.2%
unsub-neg60.2%
associate-*l/67.3%
associate-*r/67.3%
*-commutative67.3%
Simplified67.5%
clear-num67.4%
inv-pow67.4%
fma-def67.4%
fma-udef67.4%
*-commutative67.4%
fma-def67.4%
fma-def67.4%
Applied egg-rr67.4%
unpow-167.4%
fma-udef67.4%
fma-udef67.4%
unpow267.4%
+-commutative67.4%
associate-+r+67.4%
+-commutative67.4%
+-commutative67.4%
unpow267.4%
fma-def67.4%
+-commutative67.4%
fma-def67.4%
Simplified67.4%
Taylor expanded in F around inf 99.8%
Final simplification89.1%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.12e+28)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7300.0)
(+
(* x (/ -1.0 (tan B)))
(* (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5) (/ F 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 <= -1.12e+28) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7300.0) {
tmp = (x * (-1.0 / tan(B))) + (pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= (-1.12d+28)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7300.0d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)) * (f / 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 <= -1.12e+28) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7300.0) {
tmp = (x * (-1.0 / Math.tan(B))) + (Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -1.12e+28: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7300.0: tmp = (x * (-1.0 / math.tan(B))) + (math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) * (F / 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 <= -1.12e+28) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7300.0) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64((Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5) * Float64(F / 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 <= -1.12e+28) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7300.0) tmp = (x * (-1.0 / tan(B))) + ((((2.0 + (F * F)) + (x * 2.0)) ^ -0.5) * (F / 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, -1.12e+28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7300.0], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] * N[(F / B), $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.12 \cdot 10^{+28}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 7300:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.12e28Initial program 49.7%
+-commutative49.7%
unsub-neg49.7%
associate-*l/63.9%
associate-*r/63.8%
*-commutative63.8%
Simplified63.9%
clear-num63.9%
inv-pow63.9%
fma-def63.9%
fma-udef63.9%
*-commutative63.9%
fma-def63.9%
fma-def63.9%
Applied egg-rr63.9%
unpow-163.9%
fma-udef63.9%
fma-udef63.9%
unpow263.9%
+-commutative63.9%
associate-+r+63.9%
+-commutative63.9%
+-commutative63.9%
unpow263.9%
fma-def63.9%
+-commutative63.9%
fma-def63.9%
Simplified63.9%
Taylor expanded in F around -inf 99.9%
if -1.12e28 < F < 7300Initial program 99.4%
Taylor expanded in B around 0 84.1%
if 7300 < F Initial program 61.5%
+-commutative61.5%
unsub-neg61.5%
associate-*l/68.4%
associate-*r/68.4%
*-commutative68.4%
Simplified68.5%
clear-num68.5%
inv-pow68.5%
fma-def68.5%
fma-udef68.5%
*-commutative68.5%
fma-def68.5%
fma-def68.5%
Applied egg-rr68.5%
unpow-168.5%
fma-udef68.5%
fma-udef68.5%
unpow268.5%
+-commutative68.5%
associate-+r+68.5%
+-commutative68.5%
+-commutative68.5%
unpow268.5%
fma-def68.5%
+-commutative68.5%
fma-def68.5%
Simplified68.5%
Taylor expanded in F around inf 99.8%
Final simplification91.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.1e-56)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.55e-155)
(/ (- x) (tan B))
(if (<= F 2.5e-25)
(- (/ (sqrt 0.5) (/ B F)) (/ 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 <= -2.1e-56) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.55e-155) {
tmp = -x / tan(B);
} else if (F <= 2.5e-25) {
tmp = (sqrt(0.5) / (B / F)) - (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 <= (-2.1d-56)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.55d-155) then
tmp = -x / tan(b)
else if (f <= 2.5d-25) then
tmp = (sqrt(0.5d0) / (b / f)) - (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 <= -2.1e-56) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.55e-155) {
tmp = -x / Math.tan(B);
} else if (F <= 2.5e-25) {
tmp = (Math.sqrt(0.5) / (B / F)) - (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 <= -2.1e-56: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.55e-155: tmp = -x / math.tan(B) elif F <= 2.5e-25: tmp = (math.sqrt(0.5) / (B / F)) - (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 <= -2.1e-56) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.55e-155) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 2.5e-25) tmp = Float64(Float64(sqrt(0.5) / Float64(B / F)) - 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 <= -2.1e-56) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.55e-155) tmp = -x / tan(B); elseif (F <= 2.5e-25) tmp = (sqrt(0.5) / (B / F)) - (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, -2.1e-56], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.55e-155], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.5e-25], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[(B / F), $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 -2.1 \cdot 10^{-56}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-155}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-25}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -2.10000000000000006e-56Initial program 60.7%
+-commutative60.7%
unsub-neg60.7%
associate-*l/71.8%
associate-*r/71.8%
*-commutative71.8%
Simplified71.8%
clear-num71.8%
inv-pow71.8%
fma-def71.8%
fma-udef71.8%
*-commutative71.8%
fma-def71.8%
fma-def71.8%
Applied egg-rr71.8%
unpow-171.8%
fma-udef71.8%
fma-udef71.8%
unpow271.8%
+-commutative71.8%
associate-+r+71.8%
+-commutative71.8%
+-commutative71.8%
unpow271.8%
fma-def71.8%
+-commutative71.8%
fma-def71.8%
Simplified71.8%
Taylor expanded in F around -inf 89.0%
if -2.10000000000000006e-56 < F < 1.55e-155Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 80.1%
mul-1-neg80.1%
*-commutative80.1%
associate-*l/80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in B around inf 80.1%
*-commutative80.1%
associate-*r/79.9%
Simplified79.9%
clear-num79.8%
tan-quot79.9%
expm1-log1p-u53.0%
expm1-udef25.5%
un-div-inv25.5%
Applied egg-rr25.5%
expm1-def53.1%
expm1-log1p80.1%
Simplified80.1%
if 1.55e-155 < F < 2.49999999999999981e-25Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in B around 0 61.5%
Taylor expanded in x around 0 61.5%
rem-square-sqrt61.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
rem-square-sqrt61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in F around 0 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.5%
Simplified61.5%
if 2.49999999999999981e-25 < F Initial program 64.4%
+-commutative64.4%
unsub-neg64.4%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
clear-num70.9%
inv-pow70.9%
fma-def70.9%
fma-udef70.9%
*-commutative70.9%
fma-def70.9%
fma-def70.9%
Applied egg-rr70.9%
unpow-170.9%
fma-udef70.9%
fma-udef70.9%
unpow270.9%
+-commutative70.9%
associate-+r+70.9%
+-commutative70.9%
+-commutative70.9%
unpow270.9%
fma-def70.9%
+-commutative70.9%
fma-def70.9%
Simplified70.9%
Taylor expanded in F around inf 94.9%
Final simplification84.0%
(FPCore (F B x)
:precision binary64
(if (<= B -7.6e-5)
(/ (- x) (tan B))
(if (<= B 3.6e-7)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* F F))))) x) B)
(/ (* x (- (cos B))) (sin B)))))
double code(double F, double B, double x) {
double tmp;
if (B <= -7.6e-5) {
tmp = -x / tan(B);
} else if (B <= 3.6e-7) {
tmp = ((F * sqrt((1.0 / (2.0 + (F * F))))) - x) / B;
} else {
tmp = (x * -cos(B)) / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= (-7.6d-5)) then
tmp = -x / tan(b)
else if (b <= 3.6d-7) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (f * f))))) - x) / b
else
tmp = (x * -cos(b)) / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= -7.6e-5) {
tmp = -x / Math.tan(B);
} else if (B <= 3.6e-7) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (F * F))))) - x) / B;
} else {
tmp = (x * -Math.cos(B)) / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= -7.6e-5: tmp = -x / math.tan(B) elif B <= 3.6e-7: tmp = ((F * math.sqrt((1.0 / (2.0 + (F * F))))) - x) / B else: tmp = (x * -math.cos(B)) / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= -7.6e-5) tmp = Float64(Float64(-x) / tan(B)); elseif (B <= 3.6e-7) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(F * F))))) - x) / B); else tmp = Float64(Float64(x * Float64(-cos(B))) / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= -7.6e-5) tmp = -x / tan(B); elseif (B <= 3.6e-7) tmp = ((F * sqrt((1.0 / (2.0 + (F * F))))) - x) / B; else tmp = (x * -cos(B)) / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, -7.6e-5], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[B, 3.6e-7], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], N[(N[(x * (-N[Cos[B], $MachinePrecision])), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -7.6 \cdot 10^{-5}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;B \leq 3.6 \cdot 10^{-7}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + F \cdot F}} - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(-\cos B\right)}{\sin B}\\
\end{array}
\end{array}
if B < -7.6000000000000004e-5Initial program 77.2%
+-commutative77.2%
fma-def77.2%
+-commutative77.2%
*-commutative77.2%
fma-def77.2%
fma-def77.2%
metadata-eval77.2%
metadata-eval77.2%
distribute-lft-neg-in77.2%
associate-*r/77.4%
*-rgt-identity77.4%
Simplified77.4%
Taylor expanded in F around 0 55.5%
mul-1-neg55.5%
*-commutative55.5%
associate-*l/55.5%
*-commutative55.5%
Simplified55.5%
Taylor expanded in B around inf 55.5%
*-commutative55.5%
associate-*r/55.5%
Simplified55.5%
clear-num55.4%
tan-quot55.5%
expm1-log1p-u34.9%
expm1-udef23.2%
un-div-inv23.2%
Applied egg-rr23.2%
expm1-def35.0%
expm1-log1p55.7%
Simplified55.7%
if -7.6000000000000004e-5 < B < 3.59999999999999994e-7Initial program 75.4%
+-commutative75.4%
fma-def75.4%
+-commutative75.4%
*-commutative75.4%
fma-def75.4%
fma-def75.4%
metadata-eval75.4%
metadata-eval75.4%
distribute-lft-neg-in75.4%
associate-*r/75.5%
*-rgt-identity75.5%
Simplified75.5%
Taylor expanded in B around 0 84.1%
Taylor expanded in x around 0 84.1%
rem-square-sqrt84.1%
unpow284.1%
+-commutative84.1%
unpow284.1%
rem-square-sqrt84.1%
unpow284.1%
Simplified84.1%
if 3.59999999999999994e-7 < B Initial program 87.8%
+-commutative87.8%
fma-def87.8%
+-commutative87.8%
*-commutative87.8%
fma-def87.8%
fma-def87.8%
metadata-eval87.8%
metadata-eval87.8%
distribute-lft-neg-in87.8%
associate-*r/88.0%
*-rgt-identity88.0%
Simplified88.0%
Taylor expanded in F around 0 56.2%
associate-*r/56.2%
*-commutative56.2%
associate-*r*56.2%
mul-1-neg56.2%
Simplified56.2%
Final simplification70.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -4.1e-57)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.55e-155)
(/ (- x) (tan B))
(if (<= F 3.4e-25)
(- (/ (sqrt 0.5) (/ B F)) (/ x B))
(- (/ 1.0 B) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -4.1e-57) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.55e-155) {
tmp = -x / tan(B);
} else if (F <= 3.4e-25) {
tmp = (sqrt(0.5) / (B / F)) - (x / 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 <= (-4.1d-57)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.55d-155) then
tmp = -x / tan(b)
else if (f <= 3.4d-25) then
tmp = (sqrt(0.5d0) / (b / f)) - (x / 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 <= -4.1e-57) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.55e-155) {
tmp = -x / Math.tan(B);
} else if (F <= 3.4e-25) {
tmp = (Math.sqrt(0.5) / (B / F)) - (x / 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 <= -4.1e-57: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.55e-155: tmp = -x / math.tan(B) elif F <= 3.4e-25: tmp = (math.sqrt(0.5) / (B / F)) - (x / 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 <= -4.1e-57) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.55e-155) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 3.4e-25) tmp = Float64(Float64(sqrt(0.5) / Float64(B / F)) - Float64(x / 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 <= -4.1e-57) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.55e-155) tmp = -x / tan(B); elseif (F <= 3.4e-25) tmp = (sqrt(0.5) / (B / F)) - (x / 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, -4.1e-57], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.55e-155], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e-25], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $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 -4.1 \cdot 10^{-57}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 1.55 \cdot 10^{-155}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-25}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t_0\\
\end{array}
\end{array}
if F < -4.1000000000000001e-57Initial program 60.7%
+-commutative60.7%
unsub-neg60.7%
associate-*l/71.8%
associate-*r/71.8%
*-commutative71.8%
Simplified71.8%
clear-num71.8%
inv-pow71.8%
fma-def71.8%
fma-udef71.8%
*-commutative71.8%
fma-def71.8%
fma-def71.8%
Applied egg-rr71.8%
unpow-171.8%
fma-udef71.8%
fma-udef71.8%
unpow271.8%
+-commutative71.8%
associate-+r+71.8%
+-commutative71.8%
+-commutative71.8%
unpow271.8%
fma-def71.8%
+-commutative71.8%
fma-def71.8%
Simplified71.8%
Taylor expanded in F around -inf 89.0%
if -4.1000000000000001e-57 < F < 1.55e-155Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 80.1%
mul-1-neg80.1%
*-commutative80.1%
associate-*l/80.0%
*-commutative80.0%
Simplified80.0%
Taylor expanded in B around inf 80.1%
*-commutative80.1%
associate-*r/79.9%
Simplified79.9%
clear-num79.8%
tan-quot79.9%
expm1-log1p-u53.0%
expm1-udef25.5%
un-div-inv25.5%
Applied egg-rr25.5%
expm1-def53.1%
expm1-log1p80.1%
Simplified80.1%
if 1.55e-155 < F < 3.40000000000000002e-25Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in B around 0 61.5%
Taylor expanded in x around 0 61.5%
rem-square-sqrt61.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
rem-square-sqrt61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in F around 0 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.5%
Simplified61.5%
if 3.40000000000000002e-25 < F Initial program 64.4%
+-commutative64.4%
unsub-neg64.4%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
Taylor expanded in F around inf 94.7%
Taylor expanded in B around 0 73.1%
Final simplification78.4%
(FPCore (F B x) :precision binary64 (if (or (<= B -8.8e-5) (not (<= B 2.4e-6))) (/ (- x) (tan B)) (/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* F F))))) x) B)))
double code(double F, double B, double x) {
double tmp;
if ((B <= -8.8e-5) || !(B <= 2.4e-6)) {
tmp = -x / tan(B);
} else {
tmp = ((F * sqrt((1.0 / (2.0 + (F * F))))) - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((b <= (-8.8d-5)) .or. (.not. (b <= 2.4d-6))) then
tmp = -x / tan(b)
else
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (f * f))))) - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((B <= -8.8e-5) || !(B <= 2.4e-6)) {
tmp = -x / Math.tan(B);
} else {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (F * F))))) - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (B <= -8.8e-5) or not (B <= 2.4e-6): tmp = -x / math.tan(B) else: tmp = ((F * math.sqrt((1.0 / (2.0 + (F * F))))) - x) / B return tmp
function code(F, B, x) tmp = 0.0 if ((B <= -8.8e-5) || !(B <= 2.4e-6)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(F * F))))) - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((B <= -8.8e-5) || ~((B <= 2.4e-6))) tmp = -x / tan(B); else tmp = ((F * sqrt((1.0 / (2.0 + (F * F))))) - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[B, -8.8e-5], N[Not[LessEqual[B, 2.4e-6]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq -8.8 \cdot 10^{-5} \lor \neg \left(B \leq 2.4 \cdot 10^{-6}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + F \cdot F}} - x}{B}\\
\end{array}
\end{array}
if B < -8.7999999999999998e-5 or 2.3999999999999999e-6 < B Initial program 82.8%
+-commutative82.8%
fma-def82.8%
+-commutative82.8%
*-commutative82.8%
fma-def82.8%
fma-def82.8%
metadata-eval82.8%
metadata-eval82.8%
distribute-lft-neg-in82.8%
associate-*r/83.0%
*-rgt-identity83.0%
Simplified83.0%
Taylor expanded in F around 0 55.9%
mul-1-neg55.9%
*-commutative55.9%
associate-*l/55.8%
*-commutative55.8%
Simplified55.8%
Taylor expanded in B around inf 55.9%
*-commutative55.9%
associate-*r/55.8%
Simplified55.8%
clear-num55.7%
tan-quot55.8%
expm1-log1p-u36.8%
expm1-udef21.9%
un-div-inv21.9%
Applied egg-rr21.9%
expm1-def36.8%
expm1-log1p55.9%
Simplified55.9%
if -8.7999999999999998e-5 < B < 2.3999999999999999e-6Initial program 75.4%
+-commutative75.4%
fma-def75.4%
+-commutative75.4%
*-commutative75.4%
fma-def75.4%
fma-def75.4%
metadata-eval75.4%
metadata-eval75.4%
distribute-lft-neg-in75.4%
associate-*r/75.5%
*-rgt-identity75.5%
Simplified75.5%
Taylor expanded in B around 0 84.1%
Taylor expanded in x around 0 84.1%
rem-square-sqrt84.1%
unpow284.1%
+-commutative84.1%
unpow284.1%
rem-square-sqrt84.1%
unpow284.1%
Simplified84.1%
Final simplification70.8%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45e-16)
(/ (- -1.0 x) B)
(if (<= F 1.35e-155)
(/ (- x) (tan B))
(if (<= F 3.4e-25)
(- (/ (sqrt 0.5) (/ B F)) (/ x B))
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-16) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.35e-155) {
tmp = -x / tan(B);
} else if (F <= 3.4e-25) {
tmp = (sqrt(0.5) / (B / F)) - (x / 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 <= (-1.45d-16)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.35d-155) then
tmp = -x / tan(b)
else if (f <= 3.4d-25) then
tmp = (sqrt(0.5d0) / (b / f)) - (x / 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 <= -1.45e-16) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.35e-155) {
tmp = -x / Math.tan(B);
} else if (F <= 3.4e-25) {
tmp = (Math.sqrt(0.5) / (B / F)) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.45e-16: tmp = (-1.0 - x) / B elif F <= 1.35e-155: tmp = -x / math.tan(B) elif F <= 3.4e-25: tmp = (math.sqrt(0.5) / (B / F)) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.45e-16) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.35e-155) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 3.4e-25) tmp = Float64(Float64(sqrt(0.5) / Float64(B / F)) - Float64(x / 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 <= -1.45e-16) tmp = (-1.0 - x) / B; elseif (F <= 1.35e-155) tmp = -x / tan(B); elseif (F <= 3.4e-25) tmp = (sqrt(0.5) / (B / F)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.45e-16], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.35e-155], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e-25], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision] - N[(x / 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 -1.45 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.35 \cdot 10^{-155}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-25}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.4499999999999999e-16Initial program 53.5%
Taylor expanded in B around 0 43.5%
Taylor expanded in F around -inf 52.7%
Taylor expanded in B around 0 58.0%
mul-1-neg58.0%
Simplified58.0%
if -1.4499999999999999e-16 < F < 1.34999999999999991e-155Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in F around 0 75.4%
mul-1-neg75.4%
*-commutative75.4%
associate-*l/75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in B around inf 75.4%
*-commutative75.4%
associate-*r/75.3%
Simplified75.3%
clear-num75.2%
tan-quot75.3%
expm1-log1p-u46.5%
expm1-udef22.3%
un-div-inv22.3%
Applied egg-rr22.3%
expm1-def46.5%
expm1-log1p75.4%
Simplified75.4%
if 1.34999999999999991e-155 < F < 3.40000000000000002e-25Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in B around 0 61.5%
Taylor expanded in x around 0 61.5%
rem-square-sqrt61.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
rem-square-sqrt61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in F around 0 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.5%
Simplified61.5%
if 3.40000000000000002e-25 < F Initial program 64.4%
+-commutative64.4%
unsub-neg64.4%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
Taylor expanded in F around inf 94.7%
Taylor expanded in B around 0 73.1%
Final simplification68.6%
(FPCore (F B x)
:precision binary64
(if (<= F -8.6e-101)
(+ (* x (/ -1.0 (tan B))) (/ -1.0 B))
(if (<= F 1.5e-155)
(/ (- x) (tan B))
(if (<= F 3.4e-25)
(- (/ (sqrt 0.5) (/ B F)) (/ x B))
(- (/ 1.0 B) (/ x (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -8.6e-101) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= 1.5e-155) {
tmp = -x / tan(B);
} else if (F <= 3.4e-25) {
tmp = (sqrt(0.5) / (B / F)) - (x / 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 <= (-8.6d-101)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= 1.5d-155) then
tmp = -x / tan(b)
else if (f <= 3.4d-25) then
tmp = (sqrt(0.5d0) / (b / f)) - (x / 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 <= -8.6e-101) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= 1.5e-155) {
tmp = -x / Math.tan(B);
} else if (F <= 3.4e-25) {
tmp = (Math.sqrt(0.5) / (B / F)) - (x / B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -8.6e-101: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= 1.5e-155: tmp = -x / math.tan(B) elif F <= 3.4e-25: tmp = (math.sqrt(0.5) / (B / F)) - (x / B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -8.6e-101) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= 1.5e-155) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 3.4e-25) tmp = Float64(Float64(sqrt(0.5) / Float64(B / F)) - Float64(x / 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 <= -8.6e-101) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= 1.5e-155) tmp = -x / tan(B); elseif (F <= 3.4e-25) tmp = (sqrt(0.5) / (B / F)) - (x / B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -8.6e-101], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.5e-155], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.4e-25], N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[(B / F), $MachinePrecision]), $MachinePrecision] - N[(x / 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 -8.6 \cdot 10^{-101}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{-155}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 3.4 \cdot 10^{-25}:\\
\;\;\;\;\frac{\sqrt{0.5}}{\frac{B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -8.5999999999999995e-101Initial program 62.7%
Taylor expanded in B around 0 50.0%
Taylor expanded in F around -inf 67.0%
if -8.5999999999999995e-101 < F < 1.49999999999999992e-155Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 81.6%
mul-1-neg81.6%
*-commutative81.6%
associate-*l/81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in B around inf 81.6%
*-commutative81.6%
associate-*r/81.4%
Simplified81.4%
clear-num81.4%
tan-quot81.5%
expm1-log1p-u53.1%
expm1-udef25.4%
un-div-inv25.4%
Applied egg-rr25.4%
expm1-def53.2%
expm1-log1p81.7%
Simplified81.7%
if 1.49999999999999992e-155 < F < 3.40000000000000002e-25Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in B around 0 61.5%
Taylor expanded in x around 0 61.5%
rem-square-sqrt61.4%
unpow261.4%
+-commutative61.4%
unpow261.4%
rem-square-sqrt61.5%
unpow261.5%
Simplified61.5%
Taylor expanded in F around 0 61.5%
mul-1-neg61.5%
unsub-neg61.5%
associate-/l*61.5%
Simplified61.5%
if 3.40000000000000002e-25 < F Initial program 64.4%
+-commutative64.4%
unsub-neg64.4%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
Taylor expanded in F around inf 94.7%
Taylor expanded in B around 0 73.1%
Final simplification72.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.45e-16) (/ (- -1.0 x) B) (if (<= F 9.5e-26) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.45e-16) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.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 <= (-1.45d-16)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 9.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 <= -1.45e-16) {
tmp = (-1.0 - x) / B;
} else if (F <= 9.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 <= -1.45e-16: tmp = (-1.0 - x) / B elif F <= 9.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 <= -1.45e-16) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 9.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 <= -1.45e-16) tmp = (-1.0 - x) / B; elseif (F <= 9.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, -1.45e-16], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 9.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 -1.45 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-26}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -1.4499999999999999e-16Initial program 53.5%
Taylor expanded in B around 0 43.5%
Taylor expanded in F around -inf 52.7%
Taylor expanded in B around 0 58.0%
mul-1-neg58.0%
Simplified58.0%
if -1.4499999999999999e-16 < F < 9.4999999999999995e-26Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in F around 0 67.8%
mul-1-neg67.8%
*-commutative67.8%
associate-*l/67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in B around inf 67.8%
*-commutative67.8%
associate-*r/67.6%
Simplified67.6%
clear-num67.5%
tan-quot67.6%
expm1-log1p-u43.2%
expm1-udef23.4%
un-div-inv23.4%
Applied egg-rr23.4%
expm1-def43.3%
expm1-log1p67.8%
Simplified67.8%
if 9.4999999999999995e-26 < F Initial program 64.4%
+-commutative64.4%
unsub-neg64.4%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
Taylor expanded in F around inf 94.7%
Taylor expanded in B around 0 73.1%
Final simplification66.7%
(FPCore (F B x)
:precision binary64
(if (<= F -1.45e-16)
(/ (- -1.0 x) B)
(if (<= F 4.1e-14)
(/ (- 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 <= -1.45e-16) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.1e-14) {
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 <= (-1.45d-16)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.1d-14) 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 <= -1.45e-16) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.1e-14) {
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 <= -1.45e-16: tmp = (-1.0 - x) / B elif F <= 4.1e-14: 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 <= -1.45e-16) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.1e-14) 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 <= -1.45e-16) tmp = (-1.0 - x) / B; elseif (F <= 4.1e-14) 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, -1.45e-16], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.1e-14], 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 -1.45 \cdot 10^{-16}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.1 \cdot 10^{-14}:\\
\;\;\;\;\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 < -1.4499999999999999e-16Initial program 53.5%
Taylor expanded in B around 0 43.5%
Taylor expanded in F around -inf 52.7%
Taylor expanded in B around 0 58.0%
mul-1-neg58.0%
Simplified58.0%
if -1.4499999999999999e-16 < F < 4.1000000000000002e-14Initial program 99.4%
+-commutative99.4%
fma-def99.4%
+-commutative99.4%
*-commutative99.4%
fma-def99.4%
fma-def99.4%
metadata-eval99.4%
metadata-eval99.4%
distribute-lft-neg-in99.4%
associate-*r/99.6%
*-rgt-identity99.6%
Simplified99.6%
Taylor expanded in F around 0 68.2%
mul-1-neg68.2%
*-commutative68.2%
associate-*l/68.2%
*-commutative68.2%
Simplified68.2%
Taylor expanded in B around inf 68.2%
*-commutative68.2%
associate-*r/68.1%
Simplified68.1%
clear-num68.0%
tan-quot68.1%
expm1-log1p-u43.3%
expm1-udef23.8%
un-div-inv23.8%
Applied egg-rr23.8%
expm1-def43.4%
expm1-log1p68.3%
Simplified68.3%
if 4.1000000000000002e-14 < F Initial program 63.3%
+-commutative63.3%
unsub-neg63.3%
associate-*l/69.9%
associate-*r/69.8%
*-commutative69.8%
Simplified69.9%
Taylor expanded in F around inf 95.6%
un-div-inv95.7%
*-commutative95.7%
Applied egg-rr95.7%
Taylor expanded in B around 0 58.6%
associate--l+58.6%
*-commutative58.6%
*-commutative58.6%
div-sub58.6%
Simplified58.6%
Final simplification63.3%
(FPCore (F B x)
:precision binary64
(if (<= F -1.1e-90)
(/ (- -1.0 x) B)
(if (<= F 1.4e-25)
(/ (- x) B)
(+
(* B (+ 0.16666666666666666 (* x 0.3333333333333333)))
(/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.1e-90) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-25) {
tmp = -x / 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 <= (-1.1d-90)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.4d-25) then
tmp = -x / 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 <= -1.1e-90) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.4e-25) {
tmp = -x / B;
} else {
tmp = (B * (0.16666666666666666 + (x * 0.3333333333333333))) + ((1.0 - x) / B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.1e-90: tmp = (-1.0 - x) / B elif F <= 1.4e-25: tmp = -x / 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 <= -1.1e-90) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.4e-25) tmp = Float64(Float64(-x) / 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 <= -1.1e-90) tmp = (-1.0 - x) / B; elseif (F <= 1.4e-25) tmp = -x / 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, -1.1e-90], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.4e-25], N[((-x) / B), $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 -1.1 \cdot 10^{-90}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.4 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;B \cdot \left(0.16666666666666666 + x \cdot 0.3333333333333333\right) + \frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.09999999999999993e-90Initial program 62.2%
Taylor expanded in B around 0 50.6%
Taylor expanded in F around -inf 52.3%
Taylor expanded in B around 0 50.2%
mul-1-neg50.2%
Simplified50.2%
if -1.09999999999999993e-90 < F < 1.39999999999999994e-25Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 70.2%
mul-1-neg70.2%
*-commutative70.2%
associate-*l/70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in B around 0 36.9%
if 1.39999999999999994e-25 < F Initial program 64.4%
+-commutative64.4%
unsub-neg64.4%
associate-*l/70.8%
associate-*r/70.7%
*-commutative70.7%
Simplified70.8%
Taylor expanded in F around inf 94.7%
un-div-inv94.7%
*-commutative94.7%
Applied egg-rr94.7%
Taylor expanded in B around 0 56.9%
associate--l+56.9%
*-commutative56.9%
*-commutative56.9%
div-sub56.9%
Simplified56.9%
Final simplification46.1%
(FPCore (F B x) :precision binary64 (if (<= F -1.55e-82) (/ (- -1.0 x) B) (if (<= F 2.5e-25) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.55e-82) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-25) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.55d-82)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 2.5d-25) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.55e-82) {
tmp = (-1.0 - x) / B;
} else if (F <= 2.5e-25) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.55e-82: tmp = (-1.0 - x) / B elif F <= 2.5e-25: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.55e-82) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 2.5e-25) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.55e-82) tmp = (-1.0 - x) / B; elseif (F <= 2.5e-25) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.55e-82], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.5e-25], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.55 \cdot 10^{-82}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 2.5 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.55e-82Initial program 62.2%
Taylor expanded in B around 0 50.6%
Taylor expanded in F around -inf 52.3%
Taylor expanded in B around 0 50.2%
mul-1-neg50.2%
Simplified50.2%
if -1.55e-82 < F < 2.49999999999999981e-25Initial program 99.5%
+-commutative99.5%
fma-def99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
fma-def99.5%
metadata-eval99.5%
metadata-eval99.5%
distribute-lft-neg-in99.5%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 70.2%
mul-1-neg70.2%
*-commutative70.2%
associate-*l/70.2%
*-commutative70.2%
Simplified70.2%
Taylor expanded in B around 0 36.9%
if 2.49999999999999981e-25 < F Initial program 64.4%
+-commutative64.4%
fma-def64.4%
+-commutative64.4%
*-commutative64.4%
fma-def64.4%
fma-def64.4%
metadata-eval64.4%
metadata-eval64.4%
distribute-lft-neg-in64.4%
associate-*r/64.5%
*-rgt-identity64.5%
Simplified64.5%
Taylor expanded in B around 0 41.2%
Taylor expanded in F around inf 56.0%
neg-mul-156.0%
unsub-neg56.0%
Simplified56.0%
Final simplification45.9%
(FPCore (F B x) :precision binary64 (if (<= F 1.9e-25) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.9e-25) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1.9d-25) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1.9e-25) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.9e-25: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.9e-25) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1.9e-25) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.9e-25], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.9 \cdot 10^{-25}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 1.8999999999999999e-25Initial program 84.0%
+-commutative84.0%
fma-def84.0%
+-commutative84.0%
*-commutative84.0%
fma-def84.0%
fma-def84.0%
metadata-eval84.0%
metadata-eval84.0%
distribute-lft-neg-in84.0%
associate-*r/84.1%
*-rgt-identity84.1%
Simplified84.1%
Taylor expanded in F around 0 57.9%
mul-1-neg57.9%
*-commutative57.9%
associate-*l/57.8%
*-commutative57.8%
Simplified57.8%
Taylor expanded in B around 0 30.9%
if 1.8999999999999999e-25 < F Initial program 64.4%
+-commutative64.4%
fma-def64.4%
+-commutative64.4%
*-commutative64.4%
fma-def64.4%
fma-def64.4%
metadata-eval64.4%
metadata-eval64.4%
distribute-lft-neg-in64.4%
associate-*r/64.5%
*-rgt-identity64.5%
Simplified64.5%
Taylor expanded in B around 0 41.2%
Taylor expanded in F around inf 56.0%
neg-mul-156.0%
unsub-neg56.0%
Simplified56.0%
Final simplification37.4%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 78.9%
+-commutative78.9%
fma-def78.9%
+-commutative78.9%
*-commutative78.9%
fma-def78.9%
fma-def78.9%
metadata-eval78.9%
metadata-eval78.9%
distribute-lft-neg-in78.9%
associate-*r/79.1%
*-rgt-identity79.1%
Simplified79.1%
Taylor expanded in F around 0 52.4%
mul-1-neg52.4%
*-commutative52.4%
associate-*l/52.4%
*-commutative52.4%
Simplified52.4%
Taylor expanded in B around 0 28.1%
Final simplification28.1%
herbie shell --seed 2023192
(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))))))