
(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 -10000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 100000000.0)
(- (/ F (* (sin B) (sqrt (fma 2.0 x (fma F F 2.0))))) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -10000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 100000000.0) {
tmp = (F / (sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B));
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -10000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 100000000.0) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(fma(2.0, x, fma(F, F, 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -10000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 100000000.0], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 * x + N[(F * F + 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -10000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 100000000:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{\mathsf{fma}\left(2, x, \mathsf{fma}\left(F, F, 2\right)\right)}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1e10Initial program 51.2%
Simplified71.2%
Taylor expanded in F around -inf 99.8%
if -1e10 < F < 1e8Initial program 99.4%
Simplified99.6%
associate-*r/99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
fma-define99.6%
fma-undefine99.6%
+-commutative99.6%
add-sqr-sqrt99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
Simplified99.6%
sub-neg99.6%
un-div-inv99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/l/99.7%
Simplified99.7%
if 1e8 < F Initial program 50.8%
Simplified77.2%
Taylor expanded in F around inf 99.9%
(FPCore (F B x)
:precision binary64
(if (<= F -102000000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F 140000000.0)
(+
(/ -1.0 (/ (tan B) x))
(* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -102000000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 140000000.0) {
tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / sin(B)) - ((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 (f <= (-102000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 140000000.0d0) then
tmp = ((-1.0d0) / (tan(b) / x)) + ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)))
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -102000000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 140000000.0) {
tmp = (-1.0 / (Math.tan(B) / x)) + ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5));
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -102000000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 140000000.0: tmp = (-1.0 / (math.tan(B) / x)) + ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -102000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 140000000.0) tmp = Float64(Float64(-1.0 / Float64(tan(B) / x)) + Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -102000000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 140000000.0) tmp = (-1.0 / (tan(B) / x)) + ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)); else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -102000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 140000000.0], N[(N[(-1.0 / N[(N[Tan[B], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Power[N[(N[(2.0 + N[(F * F), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -102000000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 140000000:\\
\;\;\;\;\frac{-1}{\frac{\tan B}{x}} + \frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.02e8Initial program 51.2%
Simplified71.2%
Taylor expanded in F around -inf 99.8%
if -1.02e8 < F < 1.4e8Initial program 99.4%
metadata-eval99.4%
metadata-eval99.4%
Applied egg-rr99.4%
div-inv99.6%
neg-mul-199.6%
clear-num99.4%
un-div-inv99.4%
Applied egg-rr99.4%
if 1.4e8 < F Initial program 50.8%
Simplified77.2%
Taylor expanded in F around inf 99.9%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)))
(if (<= F -1100000.0)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -4.4e-232)
(- (* (/ F (sin B)) t_0) (/ x B))
(if (<= F 1.05e-13)
(+ (* x (/ -1.0 (tan B))) (* t_0 (/ F B)))
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B))))))))
double code(double F, double B, double x) {
double t_0 = pow(((2.0 + (F * F)) + (x * 2.0)), -0.5);
double tmp;
if (F <= -1100000.0) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -4.4e-232) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else if (F <= 1.05e-13) {
tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B));
} else {
tmp = (1.0 / sin(B)) - ((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) :: t_0
real(8) :: tmp
t_0 = ((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0)
if (f <= (-1100000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-4.4d-232)) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else if (f <= 1.05d-13) then
tmp = (x * ((-1.0d0) / tan(b))) + (t_0 * (f / b))
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
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 tmp;
if (F <= -1100000.0) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -4.4e-232) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else if (F <= 1.05e-13) {
tmp = (x * (-1.0 / Math.tan(B))) + (t_0 * (F / B));
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5) tmp = 0 if F <= -1100000.0: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -4.4e-232: tmp = ((F / math.sin(B)) * t_0) - (x / B) elif F <= 1.05e-13: tmp = (x * (-1.0 / math.tan(B))) + (t_0 * (F / B)) else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5 tmp = 0.0 if (F <= -1100000.0) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -4.4e-232) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); elseif (F <= 1.05e-13) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_0 * Float64(F / B))); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = ((2.0 + (F * F)) + (x * 2.0)) ^ -0.5; tmp = 0.0; if (F <= -1100000.0) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -4.4e-232) tmp = ((F / sin(B)) * t_0) - (x / B); elseif (F <= 1.05e-13) tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / B)); else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); 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]}, If[LessEqual[F, -1100000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -4.4e-232], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-13], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5}\\
\mathbf{if}\;F \leq -1100000:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -4.4 \cdot 10^{-232}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0 \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.1e6Initial program 51.2%
Simplified71.2%
Taylor expanded in F around -inf 99.8%
if -1.1e6 < F < -4.40000000000000004e-232Initial program 99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
Taylor expanded in B around 0 80.1%
associate-*r/80.1%
neg-mul-180.1%
Simplified80.1%
if -4.40000000000000004e-232 < F < 1.04999999999999994e-13Initial program 99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 88.2%
if 1.04999999999999994e-13 < F Initial program 53.7%
Simplified78.6%
Taylor expanded in F around inf 97.2%
Final simplification91.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.52)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ F (* (sin B) (sqrt (+ 2.0 (* x 2.0))))) t_0)
(- (/ 1.0 (sin B)) (/ (* x (cos B)) (sin B)))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.52) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / sin(B)) - ((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) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.52d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f / (sin(b) * sqrt((2.0d0 + (x * 2.0d0))))) - t_0
else
tmp = (1.0d0 / sin(b)) - ((x * cos(b)) / sin(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.52) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F / (Math.sin(B) * Math.sqrt((2.0 + (x * 2.0))))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - ((x * Math.cos(B)) / Math.sin(B));
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.52: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F / (math.sin(B) * math.sqrt((2.0 + (x * 2.0))))) - t_0 else: tmp = (1.0 / math.sin(B)) - ((x * math.cos(B)) / math.sin(B)) return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.52) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F / Float64(sin(B) * sqrt(Float64(2.0 + Float64(x * 2.0))))) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - Float64(Float64(x * cos(B)) / sin(B))); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.52) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F / (sin(B) * sqrt((2.0 + (x * 2.0))))) - t_0; else tmp = (1.0 / sin(B)) - ((x * cos(B)) / sin(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.52], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F / N[(N[Sin[B], $MachinePrecision] * N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1.52:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{F}{\sin B \cdot \sqrt{2 + x \cdot 2}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - \frac{x \cdot \cos B}{\sin B}\\
\end{array}
\end{array}
if F < -1.52Initial program 52.0%
Simplified71.7%
Taylor expanded in F around -inf 99.5%
if -1.52 < F < 1.3999999999999999Initial program 99.4%
Simplified99.6%
associate-*r/99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
fma-define99.6%
fma-undefine99.6%
+-commutative99.6%
add-sqr-sqrt99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
Simplified99.6%
sub-neg99.6%
un-div-inv99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in F around 0 99.2%
*-commutative99.2%
Simplified99.2%
if 1.3999999999999999 < F Initial program 50.8%
Simplified77.2%
Taylor expanded in F around inf 99.9%
(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 -800000.0)
(- (/ -1.0 (sin B)) t_1)
(if (<= F -3e-232)
(- (* (/ F (sin B)) t_0) (/ x B))
(if (<= F 1.05e-13)
(+ (* x (/ -1.0 (tan B))) (* t_0 (/ F 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 <= -800000.0) {
tmp = (-1.0 / sin(B)) - t_1;
} else if (F <= -3e-232) {
tmp = ((F / sin(B)) * t_0) - (x / B);
} else if (F <= 1.05e-13) {
tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / 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 <= (-800000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_1
else if (f <= (-3d-232)) then
tmp = ((f / sin(b)) * t_0) - (x / b)
else if (f <= 1.05d-13) then
tmp = (x * ((-1.0d0) / tan(b))) + (t_0 * (f / 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 <= -800000.0) {
tmp = (-1.0 / Math.sin(B)) - t_1;
} else if (F <= -3e-232) {
tmp = ((F / Math.sin(B)) * t_0) - (x / B);
} else if (F <= 1.05e-13) {
tmp = (x * (-1.0 / Math.tan(B))) + (t_0 * (F / 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 <= -800000.0: tmp = (-1.0 / math.sin(B)) - t_1 elif F <= -3e-232: tmp = ((F / math.sin(B)) * t_0) - (x / B) elif F <= 1.05e-13: tmp = (x * (-1.0 / math.tan(B))) + (t_0 * (F / 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 <= -800000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_1); elseif (F <= -3e-232) tmp = Float64(Float64(Float64(F / sin(B)) * t_0) - Float64(x / B)); elseif (F <= 1.05e-13) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(t_0 * Float64(F / 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 <= -800000.0) tmp = (-1.0 / sin(B)) - t_1; elseif (F <= -3e-232) tmp = ((F / sin(B)) * t_0) - (x / B); elseif (F <= 1.05e-13) tmp = (x * (-1.0 / tan(B))) + (t_0 * (F / 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, -800000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[F, -3e-232], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.05e-13], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t$95$0 * N[(F / B), $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 -800000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_1\\
\mathbf{elif}\;F \leq -3 \cdot 10^{-232}:\\
\;\;\;\;\frac{F}{\sin B} \cdot t\_0 - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.05 \cdot 10^{-13}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + t\_0 \cdot \frac{F}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_1\\
\end{array}
\end{array}
if F < -8e5Initial program 51.2%
Simplified71.2%
Taylor expanded in F around -inf 99.8%
if -8e5 < F < -2.9999999999999999e-232Initial program 99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
Taylor expanded in B around 0 80.1%
associate-*r/80.1%
neg-mul-180.1%
Simplified80.1%
if -2.9999999999999999e-232 < F < 1.04999999999999994e-13Initial program 99.5%
metadata-eval99.5%
metadata-eval99.5%
Applied egg-rr99.5%
Taylor expanded in B around 0 88.2%
if 1.04999999999999994e-13 < F Initial program 53.7%
Simplified78.6%
Taylor expanded in F around inf 97.1%
Final simplification91.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -700000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -1.2e-203)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(if (<= F 6.3e-18)
(/ (* x (cos B)) (- (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 <= -700000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -1.2e-203) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 6.3e-18) {
tmp = (x * cos(B)) / -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 <= (-700000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-1.2d-203)) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else if (f <= 6.3d-18) then
tmp = (x * cos(b)) / -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 <= -700000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -1.2e-203) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else if (F <= 6.3e-18) {
tmp = (x * Math.cos(B)) / -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 <= -700000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -1.2e-203: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) elif F <= 6.3e-18: tmp = (x * math.cos(B)) / -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 <= -700000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -1.2e-203) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); elseif (F <= 6.3e-18) tmp = Float64(Float64(x * cos(B)) / Float64(-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 <= -700000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -1.2e-203) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); elseif (F <= 6.3e-18) tmp = (x * cos(B)) / -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, -700000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -1.2e-203], 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], If[LessEqual[F, 6.3e-18], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[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 -700000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -1.2 \cdot 10^{-203}:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.3 \cdot 10^{-18}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -7e5Initial program 51.2%
Simplified71.2%
Taylor expanded in F around -inf 99.8%
if -7e5 < F < -1.1999999999999999e-203Initial program 99.3%
metadata-eval99.3%
metadata-eval99.3%
Applied egg-rr99.3%
Taylor expanded in B around 0 79.6%
associate-*r/79.6%
neg-mul-179.6%
Simplified79.6%
if -1.1999999999999999e-203 < F < 6.3000000000000004e-18Initial program 99.4%
Simplified99.7%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
fma-define99.7%
fma-undefine99.7%
+-commutative99.7%
add-sqr-sqrt99.8%
unpow-prod-down99.8%
+-commutative99.8%
fma-undefine99.8%
fma-define99.8%
+-commutative99.8%
fma-undefine99.8%
fma-define99.8%
Applied egg-rr99.8%
pow-sqr99.8%
metadata-eval99.8%
unpow-199.8%
Simplified99.8%
sub-neg99.8%
un-div-inv99.8%
Applied egg-rr99.8%
sub-neg99.8%
associate-/l/99.8%
Simplified99.8%
Taylor expanded in F around 0 75.5%
associate-*r/75.5%
neg-mul-175.5%
distribute-rgt-neg-in75.5%
Simplified75.5%
if 6.3000000000000004e-18 < F Initial program 53.7%
Simplified78.6%
Taylor expanded in F around inf 97.1%
Final simplification87.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -6.7e-9)
(- (/ -1.0 (sin B)) t_0)
(if (<= F -5.6e-49)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 9e-16)
(/ (* x (cos B)) (- (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 <= -6.7e-9) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= -5.6e-49) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 9e-16) {
tmp = (x * cos(B)) / -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 <= (-6.7d-9)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= (-5.6d-49)) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 9d-16) then
tmp = (x * cos(b)) / -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 <= -6.7e-9) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= -5.6e-49) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 9e-16) {
tmp = (x * Math.cos(B)) / -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 <= -6.7e-9: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= -5.6e-49: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 9e-16: tmp = (x * math.cos(B)) / -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 <= -6.7e-9) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= -5.6e-49) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 9e-16) tmp = Float64(Float64(x * cos(B)) / Float64(-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 <= -6.7e-9) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= -5.6e-49) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 9e-16) tmp = (x * cos(B)) / -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, -6.7e-9], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, -5.6e-49], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 9e-16], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[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 -6.7 \cdot 10^{-9}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq -5.6 \cdot 10^{-49}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 9 \cdot 10^{-16}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.69999999999999961e-9Initial program 52.7%
Simplified72.1%
Taylor expanded in F around -inf 98.1%
if -6.69999999999999961e-9 < F < -5.59999999999999995e-49Initial program 99.6%
Simplified99.1%
Taylor expanded in B around 0 67.5%
Taylor expanded in F around 0 67.9%
mul-1-neg67.9%
+-commutative67.9%
unsub-neg67.9%
*-commutative67.9%
*-commutative67.9%
Simplified67.9%
if -5.59999999999999995e-49 < F < 9.0000000000000003e-16Initial program 99.4%
Simplified99.6%
associate-*r/99.6%
fma-define99.6%
fma-undefine99.6%
*-commutative99.6%
fma-define99.6%
fma-define99.6%
Applied egg-rr99.6%
fma-define99.6%
fma-undefine99.6%
+-commutative99.6%
add-sqr-sqrt99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
Simplified99.6%
sub-neg99.6%
un-div-inv99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in F around 0 72.0%
associate-*r/72.0%
neg-mul-172.0%
distribute-rgt-neg-in72.0%
Simplified72.0%
if 9.0000000000000003e-16 < F Initial program 53.7%
Simplified78.6%
Taylor expanded in F around inf 97.1%
Final simplification84.8%
(FPCore (F B x)
:precision binary64
(if (<= F -0.006)
(- (/ -1.0 (sin B)) (/ x (tan B)))
(if (<= F -8e-47)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 7e+58) (/ (* x (cos B)) (- (sin B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.006) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= -8e-47) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 7e+58) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.006d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= (-8d-47)) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 7d+58) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.006) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= -8e-47) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 7e+58) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.006: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= -8e-47: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 7e+58: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.006) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= -8e-47) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 7e+58) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.006) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= -8e-47) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 7e+58) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.006], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -8e-47], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 7e+58], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.006:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq -8 \cdot 10^{-47}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 7 \cdot 10^{+58}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.0060000000000000001Initial program 52.7%
Simplified72.1%
Taylor expanded in F around -inf 98.1%
if -0.0060000000000000001 < F < -7.9999999999999998e-47Initial program 99.6%
Simplified99.1%
Taylor expanded in B around 0 67.5%
Taylor expanded in F around 0 67.9%
mul-1-neg67.9%
+-commutative67.9%
unsub-neg67.9%
*-commutative67.9%
*-commutative67.9%
Simplified67.9%
if -7.9999999999999998e-47 < F < 6.9999999999999995e58Initial program 98.7%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
fma-define99.7%
fma-undefine99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
Simplified99.6%
sub-neg99.6%
un-div-inv99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in F around 0 70.4%
associate-*r/70.4%
neg-mul-170.4%
distribute-rgt-neg-in70.4%
Simplified70.4%
if 6.9999999999999995e58 < F Initial program 47.3%
Simplified74.8%
Taylor expanded in B around 0 50.8%
Taylor expanded in F around inf 62.1%
Final simplification75.3%
(FPCore (F B x)
:precision binary64
(if (<= F -0.026)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -2.45e-49)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 1.65e+62) (/ (* x (cos B)) (- (sin B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.026) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -2.45e-49) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 1.65e+62) {
tmp = (x * cos(B)) / -sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.026d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-2.45d-49)) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 1.65d+62) then
tmp = (x * cos(b)) / -sin(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.026) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -2.45e-49) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 1.65e+62) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.026: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -2.45e-49: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 1.65e+62: tmp = (x * math.cos(B)) / -math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.026) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -2.45e-49) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 1.65e+62) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.026) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -2.45e-49) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 1.65e+62) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.026], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.45e-49], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.65e+62], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.026:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.45 \cdot 10^{-49}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.65 \cdot 10^{+62}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.0259999999999999988Initial program 52.7%
Simplified72.1%
Taylor expanded in F around -inf 98.1%
Taylor expanded in B around 0 83.5%
if -0.0259999999999999988 < F < -2.4500000000000001e-49Initial program 99.6%
Simplified99.1%
Taylor expanded in B around 0 67.5%
Taylor expanded in F around 0 67.9%
mul-1-neg67.9%
+-commutative67.9%
unsub-neg67.9%
*-commutative67.9%
*-commutative67.9%
Simplified67.9%
if -2.4500000000000001e-49 < F < 1.65e62Initial program 98.7%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
fma-define99.7%
fma-undefine99.7%
+-commutative99.7%
add-sqr-sqrt99.6%
unpow-prod-down99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
+-commutative99.6%
fma-undefine99.6%
fma-define99.6%
Applied egg-rr99.6%
pow-sqr99.6%
metadata-eval99.6%
unpow-199.6%
Simplified99.6%
sub-neg99.6%
un-div-inv99.6%
Applied egg-rr99.6%
sub-neg99.6%
associate-/l/99.7%
Simplified99.7%
Taylor expanded in F around 0 70.4%
associate-*r/70.4%
neg-mul-170.4%
distribute-rgt-neg-in70.4%
Simplified70.4%
if 1.65e62 < F Initial program 47.3%
Simplified74.8%
Taylor expanded in B around 0 50.8%
Taylor expanded in F around inf 62.1%
Final simplification71.7%
(FPCore (F B x)
:precision binary64
(if (<= F -0.025)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F -2.2e-49)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 2.6e+55) (* (- x) (/ (cos B) (sin B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.025) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= -2.2e-49) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 2.6e+55) {
tmp = -x * (cos(B) / sin(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-0.025d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= (-2.2d-49)) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 2.6d+55) then
tmp = -x * (cos(b) / sin(b))
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -0.025) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= -2.2e-49) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 2.6e+55) {
tmp = -x * (Math.cos(B) / Math.sin(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.025: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= -2.2e-49: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 2.6e+55: tmp = -x * (math.cos(B) / math.sin(B)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.025) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= -2.2e-49) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 2.6e+55) tmp = Float64(Float64(-x) * Float64(cos(B) / sin(B))); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -0.025) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= -2.2e-49) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 2.6e+55) tmp = -x * (cos(B) / sin(B)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.025], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, -2.2e-49], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.6e+55], N[((-x) * N[(N[Cos[B], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.025:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq -2.2 \cdot 10^{-49}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{+55}:\\
\;\;\;\;\left(-x\right) \cdot \frac{\cos B}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.025000000000000001Initial program 52.7%
Simplified72.1%
Taylor expanded in F around -inf 98.1%
Taylor expanded in B around 0 83.5%
if -0.025000000000000001 < F < -2.1999999999999999e-49Initial program 99.6%
Simplified99.1%
Taylor expanded in B around 0 67.5%
Taylor expanded in F around 0 67.9%
mul-1-neg67.9%
+-commutative67.9%
unsub-neg67.9%
*-commutative67.9%
*-commutative67.9%
Simplified67.9%
if -2.1999999999999999e-49 < F < 2.6e55Initial program 98.7%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 70.4%
mul-1-neg70.4%
associate-/l*70.3%
distribute-lft-neg-in70.3%
Simplified70.3%
if 2.6e55 < F Initial program 47.3%
Simplified74.8%
Taylor expanded in B around 0 50.8%
Taylor expanded in F around inf 62.1%
Final simplification71.6%
(FPCore (F B x)
:precision binary64
(if (<= F -0.026)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 6.6e-64)
(- (* (/ F B) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(if (<= F 1.9e+45) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.026) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 6.6e-64) {
tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 1.9e+45) {
tmp = (-1.0 / B) - (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 <= (-0.026d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 6.6d-64) then
tmp = ((f / b) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else if (f <= 1.9d+45) then
tmp = ((-1.0d0) / b) - (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 <= -0.026) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 6.6e-64) {
tmp = ((F / B) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else if (F <= 1.9e+45) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.026: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 6.6e-64: tmp = ((F / B) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) elif F <= 1.9e+45: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.026) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 6.6e-64) tmp = Float64(Float64(Float64(F / B) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); elseif (F <= 1.9e+45) tmp = Float64(Float64(-1.0 / B) - 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 <= -0.026) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 6.6e-64) tmp = ((F / B) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); elseif (F <= 1.9e+45) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.026], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.6e-64], N[(N[(N[(F / B), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 1.9e+45], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.026:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.6 \cdot 10^{-64}:\\
\;\;\;\;\frac{F}{B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+45}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.0259999999999999988Initial program 52.7%
Simplified72.1%
Taylor expanded in F around -inf 98.1%
Taylor expanded in B around 0 83.5%
if -0.0259999999999999988 < F < 6.5999999999999999e-64Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 51.8%
Taylor expanded in F around 0 51.9%
mul-1-neg51.9%
+-commutative51.9%
unsub-neg51.9%
*-commutative51.9%
*-commutative51.9%
Simplified51.9%
if 6.5999999999999999e-64 < F < 1.9000000000000001e45Initial program 99.2%
Simplified99.5%
Taylor expanded in F around -inf 51.0%
Taylor expanded in B around 0 55.3%
if 1.9000000000000001e45 < F Initial program 47.5%
Simplified75.7%
Taylor expanded in B around 0 50.9%
Taylor expanded in F around inf 61.8%
Final simplification62.2%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0215)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 6.2e-64)
(/ (- (* F (/ 1.0 (sqrt (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 2.2e+45) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0215) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 6.2e-64) {
tmp = ((F * (1.0 / sqrt((2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 2.2e+45) {
tmp = (-1.0 / B) - (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 <= (-0.0215d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 6.2d-64) then
tmp = ((f * (1.0d0 / sqrt((2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 2.2d+45) then
tmp = ((-1.0d0) / b) - (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 <= -0.0215) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 6.2e-64) {
tmp = ((F * (1.0 / Math.sqrt((2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 2.2e+45) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.0215: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 6.2e-64: tmp = ((F * (1.0 / math.sqrt((2.0 + (x * 2.0))))) - x) / B elif F <= 2.2e+45: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.0215) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 6.2e-64) tmp = Float64(Float64(Float64(F * Float64(1.0 / sqrt(Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 2.2e+45) tmp = Float64(Float64(-1.0 / B) - 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 <= -0.0215) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 6.2e-64) tmp = ((F * (1.0 / sqrt((2.0 + (x * 2.0))))) - x) / B; elseif (F <= 2.2e+45) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.0215], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e-64], N[(N[(N[(F * N[(1.0 / N[Sqrt[N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 2.2e+45], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0215:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-64}:\\
\;\;\;\;\frac{F \cdot \frac{1}{\sqrt{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{+45}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.021499999999999998Initial program 52.7%
Simplified72.1%
Taylor expanded in F around -inf 98.1%
Taylor expanded in B around 0 83.5%
if -0.021499999999999998 < F < 6.20000000000000049e-64Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 51.8%
sqrt-div51.8%
metadata-eval51.8%
fma-define51.8%
Applied egg-rr51.8%
Taylor expanded in F around 0 51.8%
*-commutative51.8%
Simplified51.8%
if 6.20000000000000049e-64 < F < 2.2e45Initial program 99.2%
Simplified99.5%
Taylor expanded in F around -inf 51.0%
Taylor expanded in B around 0 55.3%
if 2.2e45 < F Initial program 47.5%
Simplified75.7%
Taylor expanded in B around 0 50.9%
Taylor expanded in F around inf 61.8%
(FPCore (F B x)
:precision binary64
(if (<= F -0.0122)
(- (/ -1.0 (sin B)) (/ x B))
(if (<= F 2.2e-63)
(/ (- (* F (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) x) B)
(if (<= F 4e+45) (- (/ -1.0 B) (/ x (tan B))) (/ (- 1.0 x) B)))))
double code(double F, double B, double x) {
double tmp;
if (F <= -0.0122) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 2.2e-63) {
tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 4e+45) {
tmp = (-1.0 / B) - (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 <= (-0.0122d0)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 2.2d-63) then
tmp = ((f * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - x) / b
else if (f <= 4d+45) then
tmp = ((-1.0d0) / b) - (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 <= -0.0122) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 2.2e-63) {
tmp = ((F * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B;
} else if (F <= 4e+45) {
tmp = (-1.0 / B) - (x / Math.tan(B));
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -0.0122: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 2.2e-63: tmp = ((F * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B elif F <= 4e+45: tmp = (-1.0 / B) - (x / math.tan(B)) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -0.0122) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 2.2e-63) tmp = Float64(Float64(Float64(F * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - x) / B); elseif (F <= 4e+45) tmp = Float64(Float64(-1.0 / B) - 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 <= -0.0122) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 2.2e-63) tmp = ((F * sqrt((1.0 / (2.0 + (x * 2.0))))) - x) / B; elseif (F <= 4e+45) tmp = (-1.0 / B) - (x / tan(B)); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -0.0122], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.2e-63], N[(N[(N[(F * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4e+45], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -0.0122:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 2.2 \cdot 10^{-63}:\\
\;\;\;\;\frac{F \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - x}{B}\\
\mathbf{elif}\;F \leq 4 \cdot 10^{+45}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -0.0122000000000000008Initial program 52.7%
Simplified72.1%
Taylor expanded in F around -inf 98.1%
Taylor expanded in B around 0 83.5%
if -0.0122000000000000008 < F < 2.2e-63Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 51.8%
Taylor expanded in F around 0 51.8%
*-commutative51.8%
Simplified51.8%
if 2.2e-63 < F < 3.9999999999999997e45Initial program 99.2%
Simplified99.5%
Taylor expanded in F around -inf 51.0%
Taylor expanded in B around 0 55.3%
if 3.9999999999999997e45 < F Initial program 47.5%
Simplified75.7%
Taylor expanded in B around 0 50.9%
Taylor expanded in F around inf 61.8%
(FPCore (F B x) :precision binary64 (if (<= B 8.5e-207) (/ (- -1.0 x) B) (if (<= B 2.4e-5) (/ x (- B)) (- (/ -1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (B <= 8.5e-207) {
tmp = (-1.0 - x) / B;
} else if (B <= 2.4e-5) {
tmp = 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 (b <= 8.5d-207) then
tmp = ((-1.0d0) - x) / b
else if (b <= 2.4d-5) then
tmp = 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 (B <= 8.5e-207) {
tmp = (-1.0 - x) / B;
} else if (B <= 2.4e-5) {
tmp = x / -B;
} else {
tmp = (-1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 8.5e-207: tmp = (-1.0 - x) / B elif B <= 2.4e-5: tmp = x / -B else: tmp = (-1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 8.5e-207) tmp = Float64(Float64(-1.0 - x) / B); elseif (B <= 2.4e-5) tmp = Float64(x / Float64(-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 (B <= 8.5e-207) tmp = (-1.0 - x) / B; elseif (B <= 2.4e-5) tmp = x / -B; else tmp = (-1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 8.5e-207], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[B, 2.4e-5], N[(x / (-B)), $MachinePrecision], N[(N[(-1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 8.5 \cdot 10^{-207}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;B \leq 2.4 \cdot 10^{-5}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if B < 8.49999999999999962e-207Initial program 70.8%
Simplified85.5%
Taylor expanded in F around -inf 53.3%
Taylor expanded in B around 0 36.3%
associate-*r/36.3%
distribute-lft-in36.3%
metadata-eval36.3%
neg-mul-136.3%
unsub-neg36.3%
Simplified36.3%
if 8.49999999999999962e-207 < B < 2.4000000000000001e-5Initial program 76.6%
Simplified91.9%
Taylor expanded in B around 0 92.0%
Taylor expanded in F around 0 74.1%
associate-*r/74.1%
neg-mul-174.1%
Simplified74.1%
if 2.4000000000000001e-5 < B Initial program 88.6%
Simplified88.8%
Taylor expanded in F around -inf 56.3%
Taylor expanded in B around 0 47.7%
Final simplification45.5%
(FPCore (F B x) :precision binary64 (if (<= F -5.6e-65) (/ (- -1.0 x) B) (if (<= F 1.9e+45) (/ (- x) (sin B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-65) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.9e+45) {
tmp = -x / sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-5.6d-65)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 1.9d+45) then
tmp = -x / sin(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -5.6e-65) {
tmp = (-1.0 - x) / B;
} else if (F <= 1.9e+45) {
tmp = -x / Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5.6e-65: tmp = (-1.0 - x) / B elif F <= 1.9e+45: tmp = -x / math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5.6e-65) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 1.9e+45) tmp = Float64(Float64(-x) / sin(B)); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -5.6e-65) tmp = (-1.0 - x) / B; elseif (F <= 1.9e+45) tmp = -x / sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5.6e-65], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 1.9e+45], N[((-x) / N[Sin[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -5.6 \cdot 10^{-65}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 1.9 \cdot 10^{+45}:\\
\;\;\;\;\frac{-x}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.6000000000000001e-65Initial program 61.7%
Simplified77.3%
Taylor expanded in F around -inf 85.5%
Taylor expanded in B around 0 50.9%
associate-*r/50.9%
distribute-lft-in50.9%
metadata-eval50.9%
neg-mul-150.9%
unsub-neg50.9%
Simplified50.9%
if -5.6000000000000001e-65 < F < 1.9000000000000001e45Initial program 99.4%
Simplified99.6%
associate-*r/99.7%
fma-define99.7%
fma-undefine99.7%
*-commutative99.7%
fma-define99.7%
fma-define99.7%
Applied egg-rr99.7%
Taylor expanded in F around 0 71.7%
Taylor expanded in B around 0 41.0%
if 1.9000000000000001e45 < F Initial program 47.5%
Simplified75.7%
Taylor expanded in B around 0 50.9%
Taylor expanded in F around inf 61.8%
Final simplification48.7%
(FPCore (F B x) :precision binary64 (if (<= F -3.3e-68) (/ (- -1.0 x) B) (if (<= F 5.5e-46) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e-68) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.5e-46) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.3d-68)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 5.5d-46) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.3e-68) {
tmp = (-1.0 - x) / B;
} else if (F <= 5.5e-46) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.3e-68: tmp = (-1.0 - x) / B elif F <= 5.5e-46: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.3e-68) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 5.5e-46) tmp = Float64(x / Float64(-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.3e-68) tmp = (-1.0 - x) / B; elseif (F <= 5.5e-46) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.3e-68], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 5.5e-46], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.3 \cdot 10^{-68}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 5.5 \cdot 10^{-46}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.2999999999999998e-68Initial program 61.7%
Simplified77.3%
Taylor expanded in F around -inf 85.5%
Taylor expanded in B around 0 50.9%
associate-*r/50.9%
distribute-lft-in50.9%
metadata-eval50.9%
neg-mul-150.9%
unsub-neg50.9%
Simplified50.9%
if -3.2999999999999998e-68 < F < 5.49999999999999983e-46Initial program 99.4%
Simplified99.6%
Taylor expanded in B around 0 51.1%
Taylor expanded in F around 0 41.1%
associate-*r/41.1%
neg-mul-141.1%
Simplified41.1%
if 5.49999999999999983e-46 < F Initial program 58.7%
Simplified80.8%
Taylor expanded in B around 0 45.7%
Taylor expanded in F around inf 53.0%
Final simplification47.5%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.6e-216) (not (<= x 2.15e-97))) (/ x (- B)) (/ -1.0 B)))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.6e-216) || !(x <= 2.15e-97)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if ((x <= (-2.6d-216)) .or. (.not. (x <= 2.15d-97))) then
tmp = x / -b
else
tmp = (-1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -2.6e-216) || !(x <= 2.15e-97)) {
tmp = x / -B;
} else {
tmp = -1.0 / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.6e-216) or not (x <= 2.15e-97): tmp = x / -B else: tmp = -1.0 / B return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.6e-216) || !(x <= 2.15e-97)) tmp = Float64(x / Float64(-B)); else tmp = Float64(-1.0 / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -2.6e-216) || ~((x <= 2.15e-97))) tmp = x / -B; else tmp = -1.0 / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.6e-216], N[Not[LessEqual[x, 2.15e-97]], $MachinePrecision]], N[(x / (-B)), $MachinePrecision], N[(-1.0 / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{-216} \lor \neg \left(x \leq 2.15 \cdot 10^{-97}\right):\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{B}\\
\end{array}
\end{array}
if x < -2.5999999999999999e-216 or 2.15e-97 < x Initial program 76.6%
Simplified91.8%
Taylor expanded in B around 0 51.2%
Taylor expanded in F around 0 44.4%
associate-*r/44.4%
neg-mul-144.4%
Simplified44.4%
if -2.5999999999999999e-216 < x < 2.15e-97Initial program 75.2%
Simplified77.7%
Taylor expanded in F around -inf 32.0%
Taylor expanded in B around 0 19.9%
associate-*r/19.9%
distribute-lft-in19.9%
metadata-eval19.9%
neg-mul-119.9%
unsub-neg19.9%
Simplified19.9%
Taylor expanded in x around 0 19.9%
Final simplification36.8%
(FPCore (F B x) :precision binary64 (if (<= F -7.2e-62) (/ (- -1.0 x) B) (/ x (- B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-62) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-7.2d-62)) then
tmp = ((-1.0d0) - x) / b
else
tmp = x / -b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -7.2e-62) {
tmp = (-1.0 - x) / B;
} else {
tmp = x / -B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -7.2e-62: tmp = (-1.0 - x) / B else: tmp = x / -B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -7.2e-62) tmp = Float64(Float64(-1.0 - x) / B); else tmp = Float64(x / Float64(-B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -7.2e-62) tmp = (-1.0 - x) / B; else tmp = x / -B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -7.2e-62], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(x / (-B)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -7.2 \cdot 10^{-62}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{-B}\\
\end{array}
\end{array}
if F < -7.1999999999999999e-62Initial program 61.7%
Simplified77.3%
Taylor expanded in F around -inf 85.5%
Taylor expanded in B around 0 50.9%
associate-*r/50.9%
distribute-lft-in50.9%
metadata-eval50.9%
neg-mul-150.9%
unsub-neg50.9%
Simplified50.9%
if -7.1999999999999999e-62 < F Initial program 82.5%
Simplified91.8%
Taylor expanded in B around 0 48.8%
Taylor expanded in F around 0 36.6%
associate-*r/36.6%
neg-mul-136.6%
Simplified36.6%
Final simplification41.0%
(FPCore (F B x) :precision binary64 (/ -1.0 B))
double code(double F, double B, double x) {
return -1.0 / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = (-1.0d0) / b
end function
public static double code(double F, double B, double x) {
return -1.0 / B;
}
def code(F, B, x): return -1.0 / B
function code(F, B, x) return Float64(-1.0 / B) end
function tmp = code(F, B, x) tmp = -1.0 / B; end
code[F_, B_, x_] := N[(-1.0 / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-1}{B}
\end{array}
Initial program 76.1%
Simplified87.4%
Taylor expanded in F around -inf 53.7%
Taylor expanded in B around 0 31.0%
associate-*r/31.0%
distribute-lft-in31.0%
metadata-eval31.0%
neg-mul-131.0%
unsub-neg31.0%
Simplified31.0%
Taylor expanded in x around 0 10.7%
herbie shell --seed 2024186
(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))))))