
(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 19 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 -7e+23)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.32)
(fma
(/ F (sin B))
(pow (fma x 2.0 (fma F F 2.0)) -0.5)
(/ (- 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 <= -7e+23) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.32) {
tmp = fma((F / sin(B)), pow(fma(x, 2.0, fma(F, F, 2.0)), -0.5), (-x / tan(B)));
} 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 <= -7e+23) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.32) tmp = fma(Float64(F / sin(B)), (fma(x, 2.0, fma(F, F, 2.0)) ^ -0.5), Float64(Float64(-x) / tan(B))); else tmp = Float64(Float64(1.0 / 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, -7e+23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.32], N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(x * 2.0 + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision] + N[((-x) / N[Tan[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 -7 \cdot 10^{+23}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.32:\\
\;\;\;\;\mathsf{fma}\left(\frac{F}{\sin B}, {\left(\mathsf{fma}\left(x, 2, \mathsf{fma}\left(F, F, 2\right)\right)\right)}^{-0.5}, \frac{-x}{\tan B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -7.0000000000000004e23Initial program 53.4%
div-inv53.5%
expm1-log1p-u38.3%
expm1-udef38.0%
Applied egg-rr38.0%
expm1-def38.3%
expm1-log1p53.5%
Simplified53.5%
Taylor expanded in F around -inf 78.3%
+-commutative78.3%
unsub-neg78.3%
associate-*l/99.8%
frac-2neg99.8%
metadata-eval99.8%
un-div-inv99.9%
Applied egg-rr99.9%
neg-mul-199.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
if -7.0000000000000004e23 < F < 0.320000000000000007Initial program 99.6%
distribute-lft-neg-in99.6%
+-commutative99.6%
fma-def99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
if 0.320000000000000007 < F Initial program 65.3%
div-inv65.4%
expm1-log1p-u51.7%
expm1-udef51.7%
Applied egg-rr51.7%
expm1-def51.7%
expm1-log1p65.4%
Simplified65.4%
Taylor expanded in F around inf 99.8%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5e+23)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.32)
(- (* (/ 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 <= -5e+23) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.32) {
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 <= (-5d+23)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.32d0) 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 <= -5e+23) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.32) {
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 <= -5e+23: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.32: 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 <= -5e+23) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.32) 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 / 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 <= -5e+23) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.32) 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, -5e+23], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.32], 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 -5 \cdot 10^{+23}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.32:\\
\;\;\;\;\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.9999999999999999e23Initial program 53.4%
div-inv53.5%
expm1-log1p-u38.3%
expm1-udef38.0%
Applied egg-rr38.0%
expm1-def38.3%
expm1-log1p53.5%
Simplified53.5%
Taylor expanded in F around -inf 78.3%
+-commutative78.3%
unsub-neg78.3%
associate-*l/99.8%
frac-2neg99.8%
metadata-eval99.8%
un-div-inv99.9%
Applied egg-rr99.9%
neg-mul-199.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
if -4.9999999999999999e23 < F < 0.320000000000000007Initial program 99.6%
div-inv99.7%
expm1-log1p-u74.8%
expm1-udef62.3%
Applied egg-rr62.3%
expm1-def74.8%
expm1-log1p99.7%
Simplified99.7%
if 0.320000000000000007 < F Initial program 65.3%
div-inv65.4%
expm1-log1p-u51.7%
expm1-udef51.7%
Applied egg-rr51.7%
expm1-def51.7%
expm1-log1p65.4%
Simplified65.4%
Taylor expanded in F around inf 99.8%
Final simplification99.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.32)
(+
(* x (/ -1.0 (tan B)))
(* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))))
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.32) {
tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.4d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.32d0) then
tmp = (x * ((-1.0d0) / tan(b))) + ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.4) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.32) {
tmp = (x * (-1.0 / Math.tan(B))) + ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0)))));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.4: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.32: tmp = (x * (-1.0 / math.tan(B))) + ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.4) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.32) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.4) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.32) tmp = (x * (-1.0 / tan(B))) + ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.4], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.32], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $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 0.32:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.3999999999999999Initial program 57.0%
div-inv57.1%
expm1-log1p-u42.8%
expm1-udef42.5%
Applied egg-rr42.5%
expm1-def42.8%
expm1-log1p57.1%
Simplified57.1%
Taylor expanded in F around -inf 78.8%
+-commutative78.8%
unsub-neg78.8%
associate-*l/98.6%
frac-2neg98.6%
metadata-eval98.6%
un-div-inv98.7%
Applied egg-rr98.7%
neg-mul-198.7%
*-commutative98.7%
remove-double-neg98.7%
*-commutative98.7%
neg-mul-198.7%
distribute-frac-neg98.7%
*-inverses98.7%
metadata-eval98.7%
Simplified98.7%
if -1.3999999999999999 < F < 0.320000000000000007Initial program 99.6%
Taylor expanded in F around 0 98.5%
if 0.320000000000000007 < F Initial program 65.3%
div-inv65.4%
expm1-log1p-u51.7%
expm1-udef51.7%
Applied egg-rr51.7%
expm1-def51.7%
expm1-log1p65.4%
Simplified65.4%
Taylor expanded in F around inf 99.8%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.42)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 0.32)
(- (* F (/ (sqrt 0.5) (sin B))) (* x (/ 1.0 (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 <= -1.42) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 0.32) {
tmp = (F * (sqrt(0.5) / sin(B))) - (x * (1.0 / 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 <= (-1.42d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 0.32d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - (x * (1.0d0 / 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 <= -1.42) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 0.32) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - (x * (1.0 / 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 <= -1.42: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 0.32: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - (x * (1.0 / 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 <= -1.42) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 0.32) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - Float64(x * Float64(1.0 / tan(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.42) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 0.32) tmp = (F * (sqrt(0.5) / sin(B))) - (x * (1.0 / 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, -1.42], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 0.32], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[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.42:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 0.32:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.4199999999999999Initial program 57.0%
div-inv57.1%
expm1-log1p-u42.8%
expm1-udef42.5%
Applied egg-rr42.5%
expm1-def42.8%
expm1-log1p57.1%
Simplified57.1%
Taylor expanded in F around -inf 78.8%
+-commutative78.8%
unsub-neg78.8%
associate-*l/98.6%
frac-2neg98.6%
metadata-eval98.6%
un-div-inv98.7%
Applied egg-rr98.7%
neg-mul-198.7%
*-commutative98.7%
remove-double-neg98.7%
*-commutative98.7%
neg-mul-198.7%
distribute-frac-neg98.7%
*-inverses98.7%
metadata-eval98.7%
Simplified98.7%
if -1.4199999999999999 < F < 0.320000000000000007Initial program 99.6%
+-commutative99.6%
*-commutative99.6%
fma-udef99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*l/99.5%
associate-/l*99.6%
fma-def99.6%
fma-udef99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 99.5%
+-commutative99.5%
unpow299.5%
fma-udef99.5%
Simplified99.5%
clear-num99.4%
associate-/r/99.4%
*-commutative99.4%
Applied egg-rr99.4%
Taylor expanded in F around 0 98.5%
if 0.320000000000000007 < F Initial program 65.3%
div-inv65.4%
expm1-log1p-u51.7%
expm1-udef51.7%
Applied egg-rr51.7%
expm1-def51.7%
expm1-log1p65.4%
Simplified65.4%
Taylor expanded in F around inf 99.8%
Final simplification98.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0
(-
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5))
(/ x B)))
(t_1 (/ x (tan B))))
(if (<= F -5e+19)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3.8e-175)
t_0
(if (<= F 1.7e-245)
(/ (- x) (tan B))
(if (<= F 0.32) t_0 (- (/ 1.0 (sin B)) t_1)))))))
double code(double F, double B, double x) {
double t_0 = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / tan(B);
double tmp;
if (F <= -5e+19) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3.8e-175) {
tmp = t_0;
} else if (F <= 1.7e-245) {
tmp = -x / tan(B);
} else if (F <= 0.32) {
tmp = t_0;
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
t_1 = x / tan(b)
if (f <= (-5d+19)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-3.8d-175)) then
tmp = t_0
else if (f <= 1.7d-245) then
tmp = -x / tan(b)
else if (f <= 0.32d0) then
tmp = t_0
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -5e+19) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -3.8e-175) {
tmp = t_0;
} else if (F <= 1.7e-245) {
tmp = -x / Math.tan(B);
} else if (F <= 0.32) {
tmp = t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_1;
}
return tmp;
}
def code(F, B, x): t_0 = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) t_1 = x / math.tan(B) tmp = 0 if F <= -5e+19: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -3.8e-175: tmp = t_0 elif F <= 1.7e-245: tmp = -x / math.tan(B) elif F <= 0.32: tmp = t_0 else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)) t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+19) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3.8e-175) tmp = t_0; elseif (F <= 1.7e-245) tmp = Float64(Float64(-x) / tan(B)); elseif (F <= 0.32) tmp = t_0; else tmp = Float64(Float64(1.0 / sin(B)) - t_1); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); t_1 = x / tan(B); tmp = 0.0; if (F <= -5e+19) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -3.8e-175) tmp = t_0; elseif (F <= 1.7e-245) tmp = -x / tan(B); elseif (F <= 0.32) tmp = t_0; else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3.8e-175], t$95$0, If[LessEqual[F, 1.7e-245], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 0.32], t$95$0, N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+19}:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq -3.8 \cdot 10^{-175}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;F \leq 1.7 \cdot 10^{-245}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 0.32:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -5e19Initial program 53.4%
div-inv53.5%
expm1-log1p-u38.3%
expm1-udef38.0%
Applied egg-rr38.0%
expm1-def38.3%
expm1-log1p53.5%
Simplified53.5%
Taylor expanded in F around -inf 78.3%
+-commutative78.3%
unsub-neg78.3%
associate-*l/99.8%
frac-2neg99.8%
metadata-eval99.8%
un-div-inv99.9%
Applied egg-rr99.9%
neg-mul-199.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
if -5e19 < F < -3.8e-175 or 1.7e-245 < F < 0.320000000000000007Initial program 99.6%
Taylor expanded in B around 0 79.6%
if -3.8e-175 < F < 1.7e-245Initial program 99.7%
distribute-lft-neg-in99.7%
+-commutative99.7%
fma-def99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in F around 0 88.2%
mul-1-neg88.2%
associate-*l/88.3%
distribute-rgt-neg-in88.3%
Simplified88.3%
associate-*l/88.2%
clear-num88.2%
add-sqr-sqrt28.1%
sqrt-unprod29.3%
sqr-neg29.3%
sqrt-unprod1.1%
add-sqr-sqrt1.7%
Applied egg-rr1.7%
associate-/r/1.7%
Simplified1.7%
*-commutative1.7%
div-inv1.7%
associate-/l*1.7%
tan-quot1.7%
un-div-inv1.7%
add-sqr-sqrt0.8%
sqrt-unprod24.7%
sqr-neg24.7%
sqrt-unprod44.4%
add-sqr-sqrt88.4%
neg-sub088.4%
un-div-inv88.5%
Applied egg-rr88.5%
neg-sub088.5%
distribute-frac-neg88.5%
Simplified88.5%
if 0.320000000000000007 < F Initial program 65.3%
div-inv65.4%
expm1-log1p-u51.7%
expm1-udef51.7%
Applied egg-rr51.7%
expm1-def51.7%
expm1-log1p65.4%
Simplified65.4%
Taylor expanded in F around inf 99.8%
Final simplification91.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (t_1 (/ x (tan B))))
(if (<= F -5e+19)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -1e-107)
(- (* (/ F (sin B)) t_0) (/ x B))
(if (<= F 3.1e-5)
(- (* t_0 (/ F B)) (* x (/ 1.0 (tan B))))
(- (/ 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);
double t_1 = x / tan(B);
double tmp;
if (F <= -5e+19) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -1e-107) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else if (F <= 3.1e-5) {
tmp = (t_0 * (F / B)) - (x * (1.0 / tan(B)));
} else {
tmp = (1.0 / sin(B)) - t_1;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
t_1 = x / tan(b)
if (f <= (-5d+19)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-1d-107)) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else if (f <= 3.1d-5) then
tmp = (t_0 * (f / b)) - (x * (1.0d0 / tan(b)))
else
tmp = (1.0d0 / sin(b)) - t_1
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double t_1 = x / Math.tan(B);
double tmp;
if (F <= -5e+19) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -1e-107) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else if (F <= 3.1e-5) {
tmp = (t_0 * (F / B)) - (x * (1.0 / Math.tan(B)));
} 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) t_1 = x / math.tan(B) tmp = 0 if F <= -5e+19: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -1e-107: tmp = ((F / math.sin(B)) * t_0) - (x / B) elif F <= 3.1e-5: tmp = (t_0 * (F / B)) - (x * (1.0 / math.tan(B))) else: tmp = (1.0 / math.sin(B)) - t_1 return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 t_1 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+19) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -1e-107) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); elseif (F <= 3.1e-5) tmp = Float64(Float64(t_0 * Float64(F / B)) - Float64(x * Float64(1.0 / tan(B)))); 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; t_1 = x / tan(B); tmp = 0.0; if (F <= -5e+19) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -1e-107) tmp = ((F / sin(B)) * t_0) - (x / B); elseif (F <= 3.1e-5) tmp = (t_0 * (F / B)) - (x * (1.0 / tan(B))); else tmp = (1.0 / sin(B)) - t_1; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]}, Block[{t$95$1 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5e+19], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -1e-107], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-5], N[(N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
t_1 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5 \cdot 10^{+19}:\\
\;\;\;\;\frac{-1}{\sin B} - t_1\\
\mathbf{elif}\;F \leq -1 \cdot 10^{-107}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;t_0 \cdot \frac{F}{B} - x \cdot \frac{1}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_1\\
\end{array}
\end{array}
if F < -5e19Initial program 53.4%
div-inv53.5%
expm1-log1p-u38.3%
expm1-udef38.0%
Applied egg-rr38.0%
expm1-def38.3%
expm1-log1p53.5%
Simplified53.5%
Taylor expanded in F around -inf 78.3%
+-commutative78.3%
unsub-neg78.3%
associate-*l/99.8%
frac-2neg99.8%
metadata-eval99.8%
un-div-inv99.9%
Applied egg-rr99.9%
neg-mul-199.9%
*-commutative99.9%
remove-double-neg99.9%
*-commutative99.9%
neg-mul-199.9%
distribute-frac-neg99.9%
*-inverses99.9%
metadata-eval99.9%
Simplified99.9%
if -5e19 < F < -1e-107Initial program 99.5%
Taylor expanded in B around 0 87.9%
if -1e-107 < F < 3.10000000000000014e-5Initial program 99.6%
Taylor expanded in B around 0 82.0%
if 3.10000000000000014e-5 < F Initial program 66.3%
div-inv66.4%
expm1-log1p-u53.0%
expm1-udef53.0%
Applied egg-rr53.0%
expm1-def53.0%
expm1-log1p66.4%
Simplified66.4%
Taylor expanded in F around inf 98.5%
Final simplification92.2%
(FPCore (F B x) :precision binary64 (if (<= F -4.25e-35) (- (/ -1.0 (sin B)) (/ x (tan B))) (- (/ F (* (sin B) (+ F (/ 1.0 F)))) (* x (/ 1.0 (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -4.25e-35) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-4.25d-35)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -4.25e-35) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -4.25e-35: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) else: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -4.25e-35) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -4.25e-35) tmp = (-1.0 / sin(B)) - (x / tan(B)); else tmp = (F / (sin(B) * (F + (1.0 / F)))) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -4.25e-35], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -4.25 \cdot 10^{-35}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -4.2500000000000001e-35Initial program 60.0%
div-inv60.1%
expm1-log1p-u45.6%
expm1-udef45.3%
Applied egg-rr45.3%
expm1-def45.6%
expm1-log1p60.1%
Simplified60.1%
Taylor expanded in F around -inf 76.1%
+-commutative76.1%
unsub-neg76.1%
associate-*l/94.5%
frac-2neg94.5%
metadata-eval94.5%
un-div-inv94.5%
Applied egg-rr94.5%
neg-mul-194.5%
*-commutative94.5%
remove-double-neg94.5%
*-commutative94.5%
neg-mul-194.5%
distribute-frac-neg94.5%
*-inverses94.5%
metadata-eval94.5%
Simplified94.5%
if -4.2500000000000001e-35 < F Initial program 86.5%
+-commutative86.5%
*-commutative86.5%
fma-udef86.5%
fma-def86.5%
metadata-eval86.5%
metadata-eval86.5%
associate-*l/92.8%
associate-/l*92.8%
fma-def92.8%
fma-udef92.8%
*-commutative92.8%
fma-def92.8%
fma-def92.8%
Applied egg-rr92.8%
Taylor expanded in x around 0 92.7%
+-commutative92.7%
unpow292.7%
fma-udef92.7%
Simplified92.7%
Taylor expanded in F around inf 75.5%
Final simplification81.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (* x (/ 1.0 (tan B)))))
(if (<= F -1.2e-106)
(- (/ F (* (sin B) (- (/ -1.0 F) F))) t_0)
(- (/ F (* (sin B) (+ F (/ 1.0 F)))) t_0))))
double code(double F, double B, double x) {
double t_0 = x * (1.0 / tan(B));
double tmp;
if (F <= -1.2e-106) {
tmp = (F / (sin(B) * ((-1.0 / F) - F))) - t_0;
} else {
tmp = (F / (sin(B) * (F + (1.0 / F)))) - 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 * (1.0d0 / tan(b))
if (f <= (-1.2d-106)) then
tmp = (f / (sin(b) * (((-1.0d0) / f) - f))) - t_0
else
tmp = (f / (sin(b) * (f + (1.0d0 / f)))) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x * (1.0 / Math.tan(B));
double tmp;
if (F <= -1.2e-106) {
tmp = (F / (Math.sin(B) * ((-1.0 / F) - F))) - t_0;
} else {
tmp = (F / (Math.sin(B) * (F + (1.0 / F)))) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x * (1.0 / math.tan(B)) tmp = 0 if F <= -1.2e-106: tmp = (F / (math.sin(B) * ((-1.0 / F) - F))) - t_0 else: tmp = (F / (math.sin(B) * (F + (1.0 / F)))) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x * Float64(1.0 / tan(B))) tmp = 0.0 if (F <= -1.2e-106) tmp = Float64(Float64(F / Float64(sin(B) * Float64(Float64(-1.0 / F) - F))) - t_0); else tmp = Float64(Float64(F / Float64(sin(B) * Float64(F + Float64(1.0 / F)))) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x * (1.0 / tan(B)); tmp = 0.0; if (F <= -1.2e-106) tmp = (F / (sin(B) * ((-1.0 / F) - F))) - t_0; else tmp = (F / (sin(B) * (F + (1.0 / F)))) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.2e-106], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(N[(-1.0 / F), $MachinePrecision] - F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[(F + N[(1.0 / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := x \cdot \frac{1}{\tan B}\\
\mathbf{if}\;F \leq -1.2 \cdot 10^{-106}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(\frac{-1}{F} - F\right)} - t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{F}{\sin B \cdot \left(F + \frac{1}{F}\right)} - t_0\\
\end{array}
\end{array}
if F < -1.1999999999999999e-106Initial program 67.0%
+-commutative67.0%
*-commutative67.0%
fma-udef67.0%
fma-def67.0%
metadata-eval67.0%
metadata-eval67.0%
associate-*l/81.8%
associate-/l*81.8%
fma-def81.8%
fma-udef81.8%
*-commutative81.8%
fma-def81.8%
fma-def81.8%
Applied egg-rr81.8%
Taylor expanded in x around 0 81.8%
+-commutative81.8%
unpow281.8%
fma-udef81.8%
Simplified81.8%
Taylor expanded in F around -inf 84.7%
neg-mul-184.7%
Simplified84.7%
if -1.1999999999999999e-106 < F Initial program 84.9%
+-commutative84.9%
*-commutative84.9%
fma-udef84.9%
fma-def84.9%
metadata-eval84.9%
metadata-eval84.9%
associate-*l/92.0%
associate-/l*92.0%
fma-def92.0%
fma-udef92.0%
*-commutative92.0%
fma-def92.0%
fma-def92.0%
Applied egg-rr92.0%
Taylor expanded in x around 0 91.9%
+-commutative91.9%
unpow291.9%
fma-udef91.9%
Simplified91.9%
Taylor expanded in F around inf 79.9%
Final simplification81.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.4e-28)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 4.2e-158) (/ (- 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 <= -1.4e-28) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 4.2e-158) {
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 <= (-1.4d-28)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 4.2d-158) 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 <= -1.4e-28) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 4.2e-158) {
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 <= -1.4e-28: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 4.2e-158: 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 <= -1.4e-28) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 4.2e-158) tmp = Float64(Float64(-x) / tan(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.4e-28) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 4.2e-158) 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, -1.4e-28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 4.2e-158], 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 -1.4 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1}{\sin B} - t_0\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{-158}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t_0\\
\end{array}
\end{array}
if F < -1.3999999999999999e-28Initial program 59.5%
div-inv59.6%
expm1-log1p-u45.0%
expm1-udef44.7%
Applied egg-rr44.7%
expm1-def45.0%
expm1-log1p59.6%
Simplified59.6%
Taylor expanded in F around -inf 75.8%
+-commutative75.8%
unsub-neg75.8%
associate-*l/94.4%
frac-2neg94.4%
metadata-eval94.4%
un-div-inv94.4%
Applied egg-rr94.4%
neg-mul-194.4%
*-commutative94.4%
remove-double-neg94.4%
*-commutative94.4%
neg-mul-194.4%
distribute-frac-neg94.4%
*-inverses94.4%
metadata-eval94.4%
Simplified94.4%
if -1.3999999999999999e-28 < F < 4.19999999999999983e-158Initial program 99.7%
distribute-lft-neg-in99.7%
+-commutative99.7%
fma-def99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
associate-*r/99.8%
*-rgt-identity99.8%
Simplified99.8%
Taylor expanded in F around 0 66.2%
mul-1-neg66.2%
associate-*l/66.2%
distribute-rgt-neg-in66.2%
Simplified66.2%
associate-*l/66.2%
clear-num66.1%
add-sqr-sqrt18.5%
sqrt-unprod20.0%
sqr-neg20.0%
sqrt-unprod1.5%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
Simplified2.4%
*-commutative2.4%
div-inv2.4%
associate-/l*2.4%
tan-quot2.4%
un-div-inv2.4%
add-sqr-sqrt1.2%
sqrt-unprod22.9%
sqr-neg22.9%
sqrt-unprod33.8%
add-sqr-sqrt66.2%
neg-sub066.2%
un-div-inv66.3%
Applied egg-rr66.3%
neg-sub066.3%
distribute-frac-neg66.3%
Simplified66.3%
if 4.19999999999999983e-158 < F Initial program 75.2%
div-inv75.3%
expm1-log1p-u58.9%
expm1-udef58.8%
Applied egg-rr58.8%
expm1-def58.9%
expm1-log1p75.3%
Simplified75.3%
Taylor expanded in F around inf 83.6%
Final simplification81.7%
(FPCore (F B x)
:precision binary64
(if (<= F -3e-32)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 3.1e-5)
(/ (- x) (tan B))
(if (or (<= F 4.5e+71) (and (not (<= F 2.7e+113)) (<= F 2.5e+230)))
(- (/ 1.0 (* F (/ (sin B) F))) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3e-32) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 3.1e-5) {
tmp = -x / tan(B);
} else if ((F <= 4.5e+71) || (!(F <= 2.7e+113) && (F <= 2.5e+230))) {
tmp = (1.0 / (F * (sin(B) / F))) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3d-32)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 3.1d-5) then
tmp = -x / tan(b)
else if ((f <= 4.5d+71) .or. (.not. (f <= 2.7d+113)) .and. (f <= 2.5d+230)) then
tmp = (1.0d0 / (f * (sin(b) / f))) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3e-32) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 3.1e-5) {
tmp = -x / Math.tan(B);
} else if ((F <= 4.5e+71) || (!(F <= 2.7e+113) && (F <= 2.5e+230))) {
tmp = (1.0 / (F * (Math.sin(B) / F))) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3e-32: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 3.1e-5: tmp = -x / math.tan(B) elif (F <= 4.5e+71) or (not (F <= 2.7e+113) and (F <= 2.5e+230)): tmp = (1.0 / (F * (math.sin(B) / F))) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3e-32) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 3.1e-5) tmp = Float64(Float64(-x) / tan(B)); elseif ((F <= 4.5e+71) || (!(F <= 2.7e+113) && (F <= 2.5e+230))) tmp = Float64(Float64(1.0 / Float64(F * Float64(sin(B) / F))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3e-32) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 3.1e-5) tmp = -x / tan(B); elseif ((F <= 4.5e+71) || (~((F <= 2.7e+113)) && (F <= 2.5e+230))) tmp = (1.0 / (F * (sin(B) / F))) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3e-32], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.1e-5], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.5e+71], And[N[Not[LessEqual[F, 2.7e+113]], $MachinePrecision], LessEqual[F, 2.5e+230]]], N[(N[(1.0 / N[(F * N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3 \cdot 10^{-32}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 4.5 \cdot 10^{+71} \lor \neg \left(F \leq 2.7 \cdot 10^{+113}\right) \land F \leq 2.5 \cdot 10^{+230}:\\
\;\;\;\;\frac{1}{F \cdot \frac{\sin B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -3e-32Initial program 59.5%
div-inv59.6%
expm1-log1p-u45.0%
expm1-udef44.7%
Applied egg-rr44.7%
expm1-def45.0%
expm1-log1p59.6%
Simplified59.6%
Taylor expanded in F around -inf 75.8%
+-commutative75.8%
unsub-neg75.8%
associate-*l/94.4%
frac-2neg94.4%
metadata-eval94.4%
un-div-inv94.4%
Applied egg-rr94.4%
neg-mul-194.4%
*-commutative94.4%
remove-double-neg94.4%
*-commutative94.4%
neg-mul-194.4%
distribute-frac-neg94.4%
*-inverses94.4%
metadata-eval94.4%
Simplified94.4%
if -3e-32 < F < 3.10000000000000014e-5Initial program 99.6%
distribute-lft-neg-in99.6%
+-commutative99.6%
fma-def99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
fma-def99.6%
metadata-eval99.6%
metadata-eval99.6%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 60.6%
mul-1-neg60.6%
associate-*l/60.7%
distribute-rgt-neg-in60.7%
Simplified60.7%
associate-*l/60.6%
clear-num60.6%
add-sqr-sqrt18.9%
sqrt-unprod20.5%
sqr-neg20.5%
sqrt-unprod1.6%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
Simplified2.4%
*-commutative2.4%
div-inv2.4%
associate-/l*2.4%
tan-quot2.4%
un-div-inv2.4%
add-sqr-sqrt1.4%
sqrt-unprod21.9%
sqr-neg21.9%
sqrt-unprod30.8%
add-sqr-sqrt60.6%
neg-sub060.6%
un-div-inv60.7%
Applied egg-rr60.7%
neg-sub060.7%
distribute-frac-neg60.7%
Simplified60.7%
if 3.10000000000000014e-5 < F < 4.50000000000000043e71 or 2.70000000000000011e113 < F < 2.5000000000000001e230Initial program 83.1%
Taylor expanded in F around inf 92.2%
clear-num92.0%
frac-times92.2%
metadata-eval92.2%
Applied egg-rr92.2%
Taylor expanded in B around 0 84.5%
if 4.50000000000000043e71 < F < 2.70000000000000011e113 or 2.5000000000000001e230 < F Initial program 47.5%
Taylor expanded in F around inf 57.9%
Taylor expanded in B around 0 88.3%
Final simplification78.5%
(FPCore (F B x)
:precision binary64
(if (<= F -1.2e+200)
(/ (- -1.0 x) B)
(if (<= F -4.1e-53)
(- (* (/ F B) (/ -1.0 F)) (/ x (tan B)))
(if (<= F 4.4e-6)
(/ (- x) (tan B))
(if (or (<= F 4.6e+71) (and (not (<= F 1.25e+114)) (<= F 2.5e+230)))
(- (/ 1.0 (* F (/ (sin B) F))) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e+200) {
tmp = (-1.0 - x) / B;
} else if (F <= -4.1e-53) {
tmp = ((F / B) * (-1.0 / F)) - (x / tan(B));
} else if (F <= 4.4e-6) {
tmp = -x / tan(B);
} else if ((F <= 4.6e+71) || (!(F <= 1.25e+114) && (F <= 2.5e+230))) {
tmp = (1.0 / (F * (sin(B) / F))) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.2d+200)) then
tmp = ((-1.0d0) - x) / b
else if (f <= (-4.1d-53)) then
tmp = ((f / b) * ((-1.0d0) / f)) - (x / tan(b))
else if (f <= 4.4d-6) then
tmp = -x / tan(b)
else if ((f <= 4.6d+71) .or. (.not. (f <= 1.25d+114)) .and. (f <= 2.5d+230)) then
tmp = (1.0d0 / (f * (sin(b) / f))) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.2e+200) {
tmp = (-1.0 - x) / B;
} else if (F <= -4.1e-53) {
tmp = ((F / B) * (-1.0 / F)) - (x / Math.tan(B));
} else if (F <= 4.4e-6) {
tmp = -x / Math.tan(B);
} else if ((F <= 4.6e+71) || (!(F <= 1.25e+114) && (F <= 2.5e+230))) {
tmp = (1.0 / (F * (Math.sin(B) / F))) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.2e+200: tmp = (-1.0 - x) / B elif F <= -4.1e-53: tmp = ((F / B) * (-1.0 / F)) - (x / math.tan(B)) elif F <= 4.4e-6: tmp = -x / math.tan(B) elif (F <= 4.6e+71) or (not (F <= 1.25e+114) and (F <= 2.5e+230)): tmp = (1.0 / (F * (math.sin(B) / F))) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.2e+200) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= -4.1e-53) tmp = Float64(Float64(Float64(F / B) * Float64(-1.0 / F)) - Float64(x / tan(B))); elseif (F <= 4.4e-6) tmp = Float64(Float64(-x) / tan(B)); elseif ((F <= 4.6e+71) || (!(F <= 1.25e+114) && (F <= 2.5e+230))) tmp = Float64(Float64(1.0 / Float64(F * Float64(sin(B) / F))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.2e+200) tmp = (-1.0 - x) / B; elseif (F <= -4.1e-53) tmp = ((F / B) * (-1.0 / F)) - (x / tan(B)); elseif (F <= 4.4e-6) tmp = -x / tan(B); elseif ((F <= 4.6e+71) || (~((F <= 1.25e+114)) && (F <= 2.5e+230))) tmp = (1.0 / (F * (sin(B) / F))) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.2e+200], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, -4.1e-53], N[(N[(N[(F / B), $MachinePrecision] * N[(-1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.4e-6], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 4.6e+71], And[N[Not[LessEqual[F, 1.25e+114]], $MachinePrecision], LessEqual[F, 2.5e+230]]], N[(N[(1.0 / N[(F * N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.2 \cdot 10^{+200}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq -4.1 \cdot 10^{-53}:\\
\;\;\;\;\frac{F}{B} \cdot \frac{-1}{F} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 4.4 \cdot 10^{-6}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{+71} \lor \neg \left(F \leq 1.25 \cdot 10^{+114}\right) \land F \leq 2.5 \cdot 10^{+230}:\\
\;\;\;\;\frac{1}{F \cdot \frac{\sin B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < -1.2e200Initial program 23.8%
div-inv23.9%
expm1-log1p-u12.9%
expm1-udef12.5%
Applied egg-rr12.5%
expm1-def12.9%
expm1-log1p23.9%
Simplified23.9%
Taylor expanded in F around -inf 59.5%
Taylor expanded in B around 0 56.6%
associate-*r/56.6%
distribute-lft-in56.6%
metadata-eval56.6%
neg-mul-156.6%
Simplified56.6%
if -1.2e200 < F < -4.1000000000000001e-53Initial program 82.7%
div-inv82.8%
expm1-log1p-u67.7%
expm1-udef67.0%
Applied egg-rr67.0%
expm1-def67.7%
expm1-log1p82.8%
Simplified82.8%
Taylor expanded in F around -inf 79.1%
Taylor expanded in B around 0 54.3%
if -4.1000000000000001e-53 < F < 4.4000000000000002e-6Initial program 99.6%
distribute-lft-neg-in99.6%
+-commutative99.6%
fma-def99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 62.1%
mul-1-neg62.1%
associate-*l/62.2%
distribute-rgt-neg-in62.2%
Simplified62.2%
associate-*l/62.1%
clear-num62.1%
add-sqr-sqrt20.0%
sqrt-unprod21.6%
sqr-neg21.6%
sqrt-unprod1.5%
add-sqr-sqrt2.4%
Applied egg-rr2.4%
associate-/r/2.4%
Simplified2.4%
*-commutative2.4%
div-inv2.4%
associate-/l*2.4%
tan-quot2.4%
un-div-inv2.4%
add-sqr-sqrt1.4%
sqrt-unprod23.1%
sqr-neg23.1%
sqrt-unprod32.6%
add-sqr-sqrt62.2%
neg-sub062.2%
un-div-inv62.3%
Applied egg-rr62.3%
neg-sub062.3%
distribute-frac-neg62.3%
Simplified62.3%
if 4.4000000000000002e-6 < F < 4.6000000000000005e71 or 1.25e114 < F < 2.5000000000000001e230Initial program 83.1%
Taylor expanded in F around inf 92.2%
clear-num92.0%
frac-times92.2%
metadata-eval92.2%
Applied egg-rr92.2%
Taylor expanded in B around 0 84.5%
if 4.6000000000000005e71 < F < 1.25e114 or 2.5000000000000001e230 < F Initial program 47.5%
Taylor expanded in F around inf 57.9%
Taylor expanded in B around 0 88.3%
Final simplification66.2%
(FPCore (F B x)
:precision binary64
(if (<= F 3.1e-5)
(/ (- x) (tan B))
(if (or (<= F 5.5e+70) (and (not (<= F 1.5e+115)) (<= F 3.1e+230)))
(- (* (/ F (sin B)) (/ 1.0 F)) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= 3.1e-5) {
tmp = -x / tan(B);
} else if ((F <= 5.5e+70) || (!(F <= 1.5e+115) && (F <= 3.1e+230))) {
tmp = ((F / sin(B)) * (1.0 / F)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 3.1d-5) then
tmp = -x / tan(b)
else if ((f <= 5.5d+70) .or. (.not. (f <= 1.5d+115)) .and. (f <= 3.1d+230)) then
tmp = ((f / sin(b)) * (1.0d0 / f)) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 3.1e-5) {
tmp = -x / Math.tan(B);
} else if ((F <= 5.5e+70) || (!(F <= 1.5e+115) && (F <= 3.1e+230))) {
tmp = ((F / Math.sin(B)) * (1.0 / F)) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 3.1e-5: tmp = -x / math.tan(B) elif (F <= 5.5e+70) or (not (F <= 1.5e+115) and (F <= 3.1e+230)): tmp = ((F / math.sin(B)) * (1.0 / F)) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 3.1e-5) tmp = Float64(Float64(-x) / tan(B)); elseif ((F <= 5.5e+70) || (!(F <= 1.5e+115) && (F <= 3.1e+230))) tmp = Float64(Float64(Float64(F / sin(B)) * Float64(1.0 / F)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 3.1e-5) tmp = -x / tan(B); elseif ((F <= 5.5e+70) || (~((F <= 1.5e+115)) && (F <= 3.1e+230))) tmp = ((F / sin(B)) * (1.0 / F)) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 3.1e-5], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 5.5e+70], And[N[Not[LessEqual[F, 1.5e+115]], $MachinePrecision], LessEqual[F, 3.1e+230]]], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[(1.0 / F), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{+70} \lor \neg \left(F \leq 1.5 \cdot 10^{+115}\right) \land F \leq 3.1 \cdot 10^{+230}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \frac{1}{F} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < 3.10000000000000014e-5Initial program 81.9%
distribute-lft-neg-in81.9%
+-commutative81.9%
fma-def81.9%
+-commutative81.9%
*-commutative81.9%
fma-def81.9%
fma-def81.9%
metadata-eval81.9%
metadata-eval81.9%
associate-*r/82.0%
*-rgt-identity82.0%
Simplified82.0%
Taylor expanded in F around 0 53.9%
mul-1-neg53.9%
associate-*l/54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
associate-*l/53.9%
clear-num53.9%
add-sqr-sqrt16.8%
sqrt-unprod18.2%
sqr-neg18.2%
sqrt-unprod1.4%
add-sqr-sqrt2.2%
Applied egg-rr2.2%
associate-/r/2.2%
Simplified2.2%
*-commutative2.2%
div-inv2.2%
associate-/l*2.2%
tan-quot2.2%
un-div-inv2.2%
add-sqr-sqrt1.2%
sqrt-unprod17.8%
sqr-neg17.8%
sqrt-unprod25.7%
add-sqr-sqrt53.9%
neg-sub053.9%
un-div-inv54.0%
Applied egg-rr54.0%
neg-sub054.0%
distribute-frac-neg54.0%
Simplified54.0%
if 3.10000000000000014e-5 < F < 5.49999999999999986e70 or 1.5e115 < F < 3.09999999999999981e230Initial program 83.1%
Taylor expanded in F around inf 92.2%
Taylor expanded in B around 0 84.4%
if 5.49999999999999986e70 < F < 1.5e115 or 3.09999999999999981e230 < F Initial program 47.5%
Taylor expanded in F around inf 57.9%
Taylor expanded in B around 0 88.3%
Final simplification62.6%
(FPCore (F B x)
:precision binary64
(if (<= F 1.8e-5)
(/ (- x) (tan B))
(if (or (<= F 1.5e+72) (and (not (<= F 5e+113)) (<= F 2.8e+230)))
(- (/ 1.0 (* F (/ (sin B) F))) (/ x B))
(- (/ 1.0 B) (* x (/ 1.0 (tan B)))))))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.8e-5) {
tmp = -x / tan(B);
} else if ((F <= 1.5e+72) || (!(F <= 5e+113) && (F <= 2.8e+230))) {
tmp = (1.0 / (F * (sin(B) / F))) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1.8d-5) then
tmp = -x / tan(b)
else if ((f <= 1.5d+72) .or. (.not. (f <= 5d+113)) .and. (f <= 2.8d+230)) then
tmp = (1.0d0 / (f * (sin(b) / f))) - (x / b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1.8e-5) {
tmp = -x / Math.tan(B);
} else if ((F <= 1.5e+72) || (!(F <= 5e+113) && (F <= 2.8e+230))) {
tmp = (1.0 / (F * (Math.sin(B) / F))) - (x / B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.8e-5: tmp = -x / math.tan(B) elif (F <= 1.5e+72) or (not (F <= 5e+113) and (F <= 2.8e+230)): tmp = (1.0 / (F * (math.sin(B) / F))) - (x / B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.8e-5) tmp = Float64(Float64(-x) / tan(B)); elseif ((F <= 1.5e+72) || (!(F <= 5e+113) && (F <= 2.8e+230))) tmp = Float64(Float64(1.0 / Float64(F * Float64(sin(B) / F))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1.8e-5) tmp = -x / tan(B); elseif ((F <= 1.5e+72) || (~((F <= 5e+113)) && (F <= 2.8e+230))) tmp = (1.0 / (F * (sin(B) / F))) - (x / B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.8e-5], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[F, 1.5e+72], And[N[Not[LessEqual[F, 5e+113]], $MachinePrecision], LessEqual[F, 2.8e+230]]], N[(N[(1.0 / N[(F * N[(N[Sin[B], $MachinePrecision] / F), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{+72} \lor \neg \left(F \leq 5 \cdot 10^{+113}\right) \land F \leq 2.8 \cdot 10^{+230}:\\
\;\;\;\;\frac{1}{F \cdot \frac{\sin B}{F}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < 1.80000000000000005e-5Initial program 81.9%
distribute-lft-neg-in81.9%
+-commutative81.9%
fma-def81.9%
+-commutative81.9%
*-commutative81.9%
fma-def81.9%
fma-def81.9%
metadata-eval81.9%
metadata-eval81.9%
associate-*r/82.0%
*-rgt-identity82.0%
Simplified82.0%
Taylor expanded in F around 0 53.9%
mul-1-neg53.9%
associate-*l/54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
associate-*l/53.9%
clear-num53.9%
add-sqr-sqrt16.8%
sqrt-unprod18.2%
sqr-neg18.2%
sqrt-unprod1.4%
add-sqr-sqrt2.2%
Applied egg-rr2.2%
associate-/r/2.2%
Simplified2.2%
*-commutative2.2%
div-inv2.2%
associate-/l*2.2%
tan-quot2.2%
un-div-inv2.2%
add-sqr-sqrt1.2%
sqrt-unprod17.8%
sqr-neg17.8%
sqrt-unprod25.7%
add-sqr-sqrt53.9%
neg-sub053.9%
un-div-inv54.0%
Applied egg-rr54.0%
neg-sub054.0%
distribute-frac-neg54.0%
Simplified54.0%
if 1.80000000000000005e-5 < F < 1.50000000000000001e72 or 5e113 < F < 2.8000000000000002e230Initial program 83.1%
Taylor expanded in F around inf 92.2%
clear-num92.0%
frac-times92.2%
metadata-eval92.2%
Applied egg-rr92.2%
Taylor expanded in B around 0 84.5%
if 1.50000000000000001e72 < F < 5e113 or 2.8000000000000002e230 < F Initial program 47.5%
Taylor expanded in F around inf 57.9%
Taylor expanded in B around 0 88.3%
Final simplification62.6%
(FPCore (F B x) :precision binary64 (if (<= F 1.05e-18) (/ (- x) (tan B)) (- (/ 1.0 B) (* x (/ 1.0 (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= 1.05e-18) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / tan(B)));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 1.05d-18) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x * (1.0d0 / tan(b)))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 1.05e-18) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x * (1.0 / Math.tan(B)));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 1.05e-18: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x * (1.0 / math.tan(B))) return tmp
function code(F, B, x) tmp = 0.0 if (F <= 1.05e-18) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x * Float64(1.0 / tan(B)))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= 1.05e-18) tmp = -x / tan(B); else tmp = (1.0 / B) - (x * (1.0 / tan(B))); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 1.05e-18], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x * N[(1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 1.05 \cdot 10^{-18}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - x \cdot \frac{1}{\tan B}\\
\end{array}
\end{array}
if F < 1.05e-18Initial program 81.9%
distribute-lft-neg-in81.9%
+-commutative81.9%
fma-def81.9%
+-commutative81.9%
*-commutative81.9%
fma-def81.9%
fma-def81.9%
metadata-eval81.9%
metadata-eval81.9%
associate-*r/82.0%
*-rgt-identity82.0%
Simplified82.0%
Taylor expanded in F around 0 53.9%
mul-1-neg53.9%
associate-*l/54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
associate-*l/53.9%
clear-num53.9%
add-sqr-sqrt16.8%
sqrt-unprod18.2%
sqr-neg18.2%
sqrt-unprod1.4%
add-sqr-sqrt2.2%
Applied egg-rr2.2%
associate-/r/2.2%
Simplified2.2%
*-commutative2.2%
div-inv2.2%
associate-/l*2.2%
tan-quot2.2%
un-div-inv2.2%
add-sqr-sqrt1.2%
sqrt-unprod17.8%
sqr-neg17.8%
sqrt-unprod25.7%
add-sqr-sqrt53.9%
neg-sub053.9%
un-div-inv54.0%
Applied egg-rr54.0%
neg-sub054.0%
distribute-frac-neg54.0%
Simplified54.0%
if 1.05e-18 < F Initial program 66.3%
Taylor expanded in F around inf 76.1%
Taylor expanded in B around 0 67.3%
Final simplification57.6%
(FPCore (F B x) :precision binary64 (if (<= F 3.1e-5) (/ (- x) (tan B)) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 3.1e-5) {
tmp = -x / tan(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.1d-5) then
tmp = -x / tan(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.1e-5) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 3.1e-5: tmp = -x / math.tan(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 3.1e-5) tmp = Float64(Float64(-x) / tan(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.1e-5) tmp = -x / tan(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 3.1e-5], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 3.1 \cdot 10^{-5}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 3.10000000000000014e-5Initial program 81.9%
distribute-lft-neg-in81.9%
+-commutative81.9%
fma-def81.9%
+-commutative81.9%
*-commutative81.9%
fma-def81.9%
fma-def81.9%
metadata-eval81.9%
metadata-eval81.9%
associate-*r/82.0%
*-rgt-identity82.0%
Simplified82.0%
Taylor expanded in F around 0 53.9%
mul-1-neg53.9%
associate-*l/54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
associate-*l/53.9%
clear-num53.9%
add-sqr-sqrt16.8%
sqrt-unprod18.2%
sqr-neg18.2%
sqrt-unprod1.4%
add-sqr-sqrt2.2%
Applied egg-rr2.2%
associate-/r/2.2%
Simplified2.2%
*-commutative2.2%
div-inv2.2%
associate-/l*2.2%
tan-quot2.2%
un-div-inv2.2%
add-sqr-sqrt1.2%
sqrt-unprod17.8%
sqr-neg17.8%
sqrt-unprod25.7%
add-sqr-sqrt53.9%
neg-sub053.9%
un-div-inv54.0%
Applied egg-rr54.0%
neg-sub054.0%
distribute-frac-neg54.0%
Simplified54.0%
if 3.10000000000000014e-5 < F Initial program 66.3%
Taylor expanded in F around inf 76.1%
Taylor expanded in B around 0 60.7%
Taylor expanded in B around 0 51.9%
Final simplification53.5%
(FPCore (F B x) :precision binary64 (if (<= F -5.2e-56) (/ (- -1.0 x) B) (if (<= F 1.5e-18) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.2e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.5e-18) {
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 <= (-5.2d-56)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.5d-18) 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 <= -5.2e-56) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.5e-18) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.2e-56: tmp = (-1.0 - x) / B elif F <= 1.5e-18: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.2e-56) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.5e-18) 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 <= -5.2e-56) tmp = (-1.0 - x) / B; elseif (F <= 1.5e-18) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.2e-56], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.5e-18], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.2 \cdot 10^{-56}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.19999999999999994e-56Initial program 62.2%
div-inv62.3%
expm1-log1p-u48.6%
expm1-udef48.0%
Applied egg-rr48.0%
expm1-def48.6%
expm1-log1p62.3%
Simplified62.3%
Taylor expanded in F around -inf 72.3%
Taylor expanded in B around 0 46.4%
associate-*r/46.4%
distribute-lft-in46.4%
metadata-eval46.4%
neg-mul-146.4%
Simplified46.4%
if -5.19999999999999994e-56 < F < 1.49999999999999991e-18Initial program 99.6%
distribute-lft-neg-in99.6%
+-commutative99.6%
fma-def99.7%
+-commutative99.7%
*-commutative99.7%
fma-def99.7%
fma-def99.7%
metadata-eval99.7%
metadata-eval99.7%
associate-*r/99.7%
*-rgt-identity99.7%
Simplified99.7%
Taylor expanded in F around 0 62.1%
mul-1-neg62.1%
associate-*l/62.2%
distribute-rgt-neg-in62.2%
Simplified62.2%
Taylor expanded in B around 0 28.7%
associate-*r/28.7%
neg-mul-128.7%
Simplified28.7%
if 1.49999999999999991e-18 < F Initial program 66.3%
Taylor expanded in F around inf 76.1%
Taylor expanded in B around 0 60.7%
Taylor expanded in B around 0 51.9%
Final simplification41.0%
(FPCore (F B x) :precision binary64 (if (<= F 5.8e-19) (/ (- x) B) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 5.8e-19) {
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 <= 5.8d-19) 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 <= 5.8e-19) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 5.8e-19: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 5.8e-19) 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 <= 5.8e-19) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 5.8e-19], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 5.8 \cdot 10^{-19}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 5.8e-19Initial program 81.9%
distribute-lft-neg-in81.9%
+-commutative81.9%
fma-def81.9%
+-commutative81.9%
*-commutative81.9%
fma-def81.9%
fma-def81.9%
metadata-eval81.9%
metadata-eval81.9%
associate-*r/82.0%
*-rgt-identity82.0%
Simplified82.0%
Taylor expanded in F around 0 53.9%
mul-1-neg53.9%
associate-*l/54.0%
distribute-rgt-neg-in54.0%
Simplified54.0%
Taylor expanded in B around 0 27.0%
associate-*r/27.0%
neg-mul-127.0%
Simplified27.0%
if 5.8e-19 < F Initial program 66.3%
Taylor expanded in F around inf 76.1%
Taylor expanded in B around 0 60.7%
Taylor expanded in B around 0 51.9%
Final simplification33.6%
(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 77.8%
distribute-lft-neg-in77.8%
+-commutative77.8%
fma-def77.8%
+-commutative77.8%
*-commutative77.8%
fma-def77.8%
fma-def77.8%
metadata-eval77.8%
metadata-eval77.8%
associate-*r/77.9%
*-rgt-identity77.9%
Simplified77.9%
Taylor expanded in F around 0 51.4%
mul-1-neg51.4%
associate-*l/51.4%
distribute-rgt-neg-in51.4%
Simplified51.4%
Taylor expanded in B around 0 27.5%
associate-*r/27.5%
neg-mul-127.5%
Simplified27.5%
Final simplification27.5%
(FPCore (F B x) :precision binary64 (* B 0.16666666666666666))
double code(double F, double B, double x) {
return B * 0.16666666666666666;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = b * 0.16666666666666666d0
end function
public static double code(double F, double B, double x) {
return B * 0.16666666666666666;
}
def code(F, B, x): return B * 0.16666666666666666
function code(F, B, x) return Float64(B * 0.16666666666666666) end
function tmp = code(F, B, x) tmp = B * 0.16666666666666666; end
code[F_, B_, x_] := N[(B * 0.16666666666666666), $MachinePrecision]
\begin{array}{l}
\\
B \cdot 0.16666666666666666
\end{array}
Initial program 77.8%
Taylor expanded in F around inf 46.2%
Taylor expanded in B around 0 38.8%
Taylor expanded in B around inf 2.7%
*-commutative2.7%
Simplified2.7%
Final simplification2.7%
herbie shell --seed 2023306
(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))))))