
(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 16 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 -5e+155)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 950000.0)
(- (/ (/ F (sqrt (fma F F 2.0))) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5e+155) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 950000.0) {
tmp = ((F / sqrt(fma(F, F, 2.0))) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5e+155) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 950000.0) tmp = Float64(Float64(Float64(F / sqrt(fma(F, F, 2.0))) / sin(B)) - t_0); 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, -5e+155], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 950000.0], N[(N[(N[(F / N[Sqrt[N[(F * F + 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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^{+155}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 950000:\\
\;\;\;\;\frac{\frac{F}{\sqrt{\mathsf{fma}\left(F, F, 2\right)}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -4.9999999999999999e155Initial program 45.1%
Simplified60.1%
Taylor expanded in x around 0 60.1%
associate-*l/60.1%
*-lft-identity60.1%
+-commutative60.1%
unpow260.1%
fma-undefine60.1%
Simplified60.1%
Taylor expanded in F around -inf 99.6%
if -4.9999999999999999e155 < F < 9.5e5Initial program 77.0%
Simplified80.2%
Taylor expanded in x around 0 99.6%
associate-*l/99.6%
*-lft-identity99.6%
+-commutative99.6%
unpow299.6%
fma-undefine99.6%
Simplified99.6%
associate-*r/99.6%
sqrt-div99.6%
metadata-eval99.6%
un-div-inv99.6%
Applied egg-rr99.6%
if 9.5e5 < F Initial program 49.4%
Simplified66.4%
Taylor expanded in x around 0 74.3%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.7%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -270000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (* F (/ (sqrt 0.5) (sin B))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -270000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (sqrt(0.5) / sin(B))) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-270000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = (f * (sqrt(0.5d0) / sin(b))) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -270000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = (F * (Math.sqrt(0.5) / Math.sin(B))) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -270000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = (F * (math.sqrt(0.5) / math.sin(B))) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -270000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(F * Float64(sqrt(0.5) / sin(B))) - t_0); else tmp = Float64(Float64(1.0 / 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 <= -270000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = (F * (sqrt(0.5) / sin(B))) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -270000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(F * N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -270000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;F \cdot \frac{\sqrt{0.5}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.7e8Initial program 62.2%
Simplified77.0%
Taylor expanded in x around 0 81.9%
associate-*l/82.0%
*-lft-identity82.0%
+-commutative82.0%
unpow282.0%
fma-undefine82.0%
Simplified82.0%
Taylor expanded in F around -inf 99.8%
if -2.7e8 < F < 1.3999999999999999Initial program 77.2%
Simplified77.3%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
Taylor expanded in F around 0 99.1%
if 1.3999999999999999 < F Initial program 49.4%
Simplified66.4%
Taylor expanded in x around 0 74.3%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.7%
Final simplification99.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -270000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.4)
(- (/ (/ F (sqrt 2.0)) (sin B)) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -270000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((F / sqrt(2.0)) / sin(B)) - t_0;
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-270000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.4d0) then
tmp = ((f / sqrt(2.0d0)) / sin(b)) - t_0
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -270000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.4) {
tmp = ((F / Math.sqrt(2.0)) / Math.sin(B)) - t_0;
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -270000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.4: tmp = ((F / math.sqrt(2.0)) / math.sin(B)) - t_0 else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -270000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.4) tmp = Float64(Float64(Float64(F / sqrt(2.0)) / sin(B)) - t_0); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -270000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.4) tmp = ((F / sqrt(2.0)) / sin(B)) - t_0; else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -270000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.4], N[(N[(N[(F / N[Sqrt[2.0], $MachinePrecision]), $MachinePrecision] / N[Sin[B], $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 -270000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.4:\\
\;\;\;\;\frac{\frac{F}{\sqrt{2}}}{\sin B} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.7e8Initial program 62.2%
Simplified77.0%
Taylor expanded in x around 0 81.9%
associate-*l/82.0%
*-lft-identity82.0%
+-commutative82.0%
unpow282.0%
fma-undefine82.0%
Simplified82.0%
Taylor expanded in F around -inf 99.8%
if -2.7e8 < F < 1.3999999999999999Initial program 77.2%
Simplified77.3%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
associate-*r/99.5%
sqrt-div99.5%
metadata-eval99.5%
un-div-inv99.5%
Applied egg-rr99.5%
Taylor expanded in F around 0 99.1%
if 1.3999999999999999 < F Initial program 49.4%
Simplified66.4%
Taylor expanded in x around 0 74.3%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.7%
Final simplification99.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -1.8e-28)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 1.22e-88)
(* x (/ (cos B) (- (sin B))))
(if (<= F 118.0)
(- (* (/ F (sin B)) (pow (+ (+ 2.0 (* F F)) (* x 2.0)) -0.5)) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1.8e-28) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 1.22e-88) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 118.0) {
tmp = ((F / sin(B)) * pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-1.8d-28)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 1.22d-88) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 118.0d0) then
tmp = ((f / sin(b)) * (((2.0d0 + (f * f)) + (x * 2.0d0)) ** (-0.5d0))) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -1.8e-28) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 1.22e-88) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 118.0) {
tmp = ((F / Math.sin(B)) * Math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -1.8e-28: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 1.22e-88: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 118.0: tmp = ((F / math.sin(B)) * math.pow(((2.0 + (F * F)) + (x * 2.0)), -0.5)) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -1.8e-28) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 1.22e-88) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 118.0) tmp = Float64(Float64(Float64(F / sin(B)) * (Float64(Float64(2.0 + Float64(F * F)) + Float64(x * 2.0)) ^ -0.5)) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -1.8e-28) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 1.22e-88) tmp = x * (cos(B) / -sin(B)); elseif (F <= 118.0) tmp = ((F / sin(B)) * (((2.0 + (F * F)) + (x * 2.0)) ^ -0.5)) - (x / B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -1.8e-28], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 1.22e-88], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 118.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], 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.8 \cdot 10^{-28}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 1.22 \cdot 10^{-88}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 118:\\
\;\;\;\;\frac{F}{\sin B} \cdot {\left(\left(2 + F \cdot F\right) + x \cdot 2\right)}^{-0.5} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.7999999999999999e-28Initial program 63.2%
Simplified76.4%
Taylor expanded in x around 0 83.7%
associate-*l/83.8%
*-lft-identity83.8%
+-commutative83.8%
unpow283.8%
fma-undefine83.8%
Simplified83.8%
Taylor expanded in F around -inf 95.8%
if -1.7999999999999999e-28 < F < 1.2200000000000001e-88Initial program 76.6%
Taylor expanded in F around -inf 48.6%
Taylor expanded in x around inf 80.1%
mul-1-neg80.1%
associate-/l*80.1%
distribute-lft-neg-in80.1%
Simplified80.1%
if 1.2200000000000001e-88 < F < 118Initial program 83.0%
Taylor expanded in B around 0 77.6%
if 118 < F Initial program 49.4%
Simplified66.4%
Taylor expanded in x around 0 74.3%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.7%
Final simplification89.8%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -7e-29)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 9.5e-94)
(* x (/ (cos B) (- (sin B))))
(if (<= F 3.8e-5)
(- (* (/ F (sin B)) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -7e-29) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 9.5e-94) {
tmp = x * (cos(B) / -sin(B));
} else if (F <= 3.8e-5) {
tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-7d-29)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 9.5d-94) then
tmp = x * (cos(b) / -sin(b))
else if (f <= 3.8d-5) then
tmp = ((f / sin(b)) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -7e-29) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 9.5e-94) {
tmp = x * (Math.cos(B) / -Math.sin(B));
} else if (F <= 3.8e-5) {
tmp = ((F / Math.sin(B)) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -7e-29: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 9.5e-94: tmp = x * (math.cos(B) / -math.sin(B)) elif F <= 3.8e-5: tmp = ((F / math.sin(B)) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -7e-29) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 9.5e-94) tmp = Float64(x * Float64(cos(B) / Float64(-sin(B)))); elseif (F <= 3.8e-5) tmp = Float64(Float64(Float64(F / sin(B)) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -7e-29) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 9.5e-94) tmp = x * (cos(B) / -sin(B)); elseif (F <= 3.8e-5) tmp = ((F / sin(B)) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -7e-29], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 9.5e-94], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.8e-5], N[(N[(N[(F / N[Sin[B], $MachinePrecision]), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], 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^{-29}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 9.5 \cdot 10^{-94}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 3.8 \cdot 10^{-5}:\\
\;\;\;\;\frac{F}{\sin B} \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -6.9999999999999995e-29Initial program 63.2%
Simplified76.4%
Taylor expanded in x around 0 83.7%
associate-*l/83.8%
*-lft-identity83.8%
+-commutative83.8%
unpow283.8%
fma-undefine83.8%
Simplified83.8%
Taylor expanded in F around -inf 95.8%
if -6.9999999999999995e-29 < F < 9.4999999999999997e-94Initial program 76.6%
Taylor expanded in F around -inf 48.6%
Taylor expanded in x around inf 80.1%
mul-1-neg80.1%
associate-/l*80.1%
distribute-lft-neg-in80.1%
Simplified80.1%
if 9.4999999999999997e-94 < F < 3.8000000000000002e-5Initial program 83.0%
Taylor expanded in F around 0 80.9%
Taylor expanded in B around 0 75.5%
if 3.8000000000000002e-5 < F Initial program 49.4%
Simplified66.4%
Taylor expanded in x around 0 74.3%
associate-*l/74.4%
*-lft-identity74.4%
+-commutative74.4%
unpow274.4%
fma-undefine74.4%
Simplified74.4%
Taylor expanded in F around inf 99.7%
Final simplification89.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.1e-27)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.7e-80)
(* 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 <= -2.1e-27) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.7e-80) {
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 <= (-2.1d-27)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.7d-80) 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 <= -2.1e-27) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.7e-80) {
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 <= -2.1e-27: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.7e-80: 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 <= -2.1e-27) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.7e-80) tmp = Float64(x * Float64(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 <= -2.1e-27) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.7e-80) 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, -2.1e-27], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.7e-80], N[(x * N[(N[Cos[B], $MachinePrecision] / (-N[Sin[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 -2.1 \cdot 10^{-27}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.7 \cdot 10^{-80}:\\
\;\;\;\;x \cdot \frac{\cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.10000000000000015e-27Initial program 63.2%
Simplified76.4%
Taylor expanded in x around 0 83.7%
associate-*l/83.8%
*-lft-identity83.8%
+-commutative83.8%
unpow283.8%
fma-undefine83.8%
Simplified83.8%
Taylor expanded in F around -inf 95.8%
if -2.10000000000000015e-27 < F < 2.7000000000000002e-80Initial program 77.3%
Taylor expanded in F around -inf 48.2%
Taylor expanded in x around inf 78.8%
mul-1-neg78.8%
associate-/l*78.8%
distribute-lft-neg-in78.8%
Simplified78.8%
if 2.7000000000000002e-80 < F Initial program 54.4%
Simplified68.6%
Taylor expanded in x around 0 78.5%
associate-*l/78.6%
*-lft-identity78.6%
+-commutative78.6%
unpow278.6%
fma-undefine78.6%
Simplified78.6%
Taylor expanded in F around inf 90.6%
Final simplification87.4%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5.1e-30)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.2e-143) (/ (- x) (tan B)) (- (/ 1.0 B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.1e-30) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.2e-143) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5.1d-30)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.2d-143) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5.1e-30) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.2e-143) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.1e-30: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.2e-143: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.1e-30) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.2e-143) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5.1e-30) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.2e-143) tmp = -x / tan(B); else tmp = (1.0 / B) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.1e-30], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.2e-143], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -5.1 \cdot 10^{-30}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - t\_0\\
\end{array}
\end{array}
if F < -5.09999999999999972e-30Initial program 63.2%
Simplified76.4%
Taylor expanded in x around 0 83.7%
associate-*l/83.8%
*-lft-identity83.8%
+-commutative83.8%
unpow283.8%
fma-undefine83.8%
Simplified83.8%
Taylor expanded in F around -inf 95.8%
if -5.09999999999999972e-30 < F < 3.1999999999999998e-143Initial program 76.8%
Taylor expanded in F around -inf 47.3%
Taylor expanded in x around inf 80.5%
mul-1-neg80.5%
associate-/l*80.5%
distribute-lft-neg-in80.5%
Simplified80.5%
distribute-lft-neg-out80.5%
clear-num80.5%
tan-quot80.5%
div-inv80.5%
neg-sub080.5%
Applied egg-rr80.5%
neg-sub080.5%
distribute-frac-neg280.5%
Simplified80.5%
if 3.1999999999999998e-143 < F Initial program 57.4%
Simplified70.0%
Taylor expanded in x around 0 80.8%
associate-*l/80.8%
*-lft-identity80.8%
+-commutative80.8%
unpow280.8%
fma-undefine80.8%
Simplified80.8%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 65.8%
Final simplification78.7%
(FPCore (F B x) :precision binary64 (if (<= F -3.8e+101) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 3.2e-143) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e+101) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 3.2e-143) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.8d+101)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 3.2d-143) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.8e+101) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 3.2e-143) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.8e+101: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 3.2e-143: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.8e+101) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 3.2e-143) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.8e+101) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 3.2e-143) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.8e+101], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 3.2e-143], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.8 \cdot 10^{+101}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -3.7999999999999998e101Initial program 57.1%
Taylor expanded in B around 0 25.9%
Taylor expanded in F around -inf 65.1%
distribute-lft-in65.1%
mul-1-neg65.1%
unsub-neg65.1%
neg-mul-165.1%
distribute-neg-frac65.1%
metadata-eval65.1%
Simplified65.1%
if -3.7999999999999998e101 < F < 3.1999999999999998e-143Initial program 77.1%
Taylor expanded in F around -inf 54.0%
Taylor expanded in x around inf 79.4%
mul-1-neg79.4%
associate-/l*79.4%
distribute-lft-neg-in79.4%
Simplified79.4%
distribute-lft-neg-out79.4%
clear-num79.4%
tan-quot79.4%
div-inv79.5%
neg-sub079.5%
Applied egg-rr79.5%
neg-sub079.5%
distribute-frac-neg279.5%
Simplified79.5%
if 3.1999999999999998e-143 < F Initial program 57.4%
Simplified70.0%
Taylor expanded in x around 0 80.8%
associate-*l/80.8%
*-lft-identity80.8%
+-commutative80.8%
unpow280.8%
fma-undefine80.8%
Simplified80.8%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 65.8%
Final simplification71.4%
(FPCore (F B x) :precision binary64 (if (<= F -3.2e-7) (+ (* x (/ -1.0 (tan B))) (/ -1.0 B)) (if (<= F 2.6e-143) (/ (- x) (tan B)) (- (/ 1.0 B) (/ x (tan B))))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-7) {
tmp = (x * (-1.0 / tan(B))) + (-1.0 / B);
} else if (F <= 2.6e-143) {
tmp = -x / tan(B);
} else {
tmp = (1.0 / B) - (x / tan(B));
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-3.2d-7)) then
tmp = (x * ((-1.0d0) / tan(b))) + ((-1.0d0) / b)
else if (f <= 2.6d-143) then
tmp = -x / tan(b)
else
tmp = (1.0d0 / b) - (x / tan(b))
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -3.2e-7) {
tmp = (x * (-1.0 / Math.tan(B))) + (-1.0 / B);
} else if (F <= 2.6e-143) {
tmp = -x / Math.tan(B);
} else {
tmp = (1.0 / B) - (x / Math.tan(B));
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.2e-7: tmp = (x * (-1.0 / math.tan(B))) + (-1.0 / B) elif F <= 2.6e-143: tmp = -x / math.tan(B) else: tmp = (1.0 / B) - (x / math.tan(B)) return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.2e-7) tmp = Float64(Float64(x * Float64(-1.0 / tan(B))) + Float64(-1.0 / B)); elseif (F <= 2.6e-143) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(Float64(1.0 / B) - Float64(x / tan(B))); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -3.2e-7) tmp = (x * (-1.0 / tan(B))) + (-1.0 / B); elseif (F <= 2.6e-143) tmp = -x / tan(B); else tmp = (1.0 / B) - (x / tan(B)); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.2e-7], N[(N[(x * N[(-1.0 / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 2.6e-143], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / B), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.2 \cdot 10^{-7}:\\
\;\;\;\;x \cdot \frac{-1}{\tan B} + \frac{-1}{B}\\
\mathbf{elif}\;F \leq 2.6 \cdot 10^{-143}:\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{B} - \frac{x}{\tan B}\\
\end{array}
\end{array}
if F < -3.2000000000000001e-7Initial program 61.4%
Taylor expanded in F around -inf 98.2%
Taylor expanded in B around 0 78.1%
if -3.2000000000000001e-7 < F < 2.59999999999999987e-143Initial program 77.5%
Taylor expanded in F around -inf 47.0%
Taylor expanded in x around inf 79.0%
mul-1-neg79.0%
associate-/l*79.0%
distribute-lft-neg-in79.0%
Simplified79.0%
distribute-lft-neg-out79.0%
clear-num79.0%
tan-quot79.0%
div-inv79.1%
neg-sub079.1%
Applied egg-rr79.1%
neg-sub079.1%
distribute-frac-neg279.1%
Simplified79.1%
if 2.59999999999999987e-143 < F Initial program 57.4%
Simplified70.0%
Taylor expanded in x around 0 80.8%
associate-*l/80.8%
*-lft-identity80.8%
+-commutative80.8%
unpow280.8%
fma-undefine80.8%
Simplified80.8%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 65.8%
Final simplification73.6%
(FPCore (F B x) :precision binary64 (if (or (<= x -2.1e-246) (not (<= x 7.5e-159))) (/ (- x) (tan B)) (/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if ((x <= -2.1e-246) || !(x <= 7.5e-159)) {
tmp = -x / tan(B);
} else {
tmp = 1.0 / 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 ((x <= (-2.1d-246)) .or. (.not. (x <= 7.5d-159))) then
tmp = -x / tan(b)
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if ((x <= -2.1e-246) || !(x <= 7.5e-159)) {
tmp = -x / Math.tan(B);
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if (x <= -2.1e-246) or not (x <= 7.5e-159): tmp = -x / math.tan(B) else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if ((x <= -2.1e-246) || !(x <= 7.5e-159)) tmp = Float64(Float64(-x) / tan(B)); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if ((x <= -2.1e-246) || ~((x <= 7.5e-159))) tmp = -x / tan(B); else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[Or[LessEqual[x, -2.1e-246], N[Not[LessEqual[x, 7.5e-159]], $MachinePrecision]], N[((-x) / N[Tan[B], $MachinePrecision]), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-246} \lor \neg \left(x \leq 7.5 \cdot 10^{-159}\right):\\
\;\;\;\;\frac{-x}{\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if x < -2.09999999999999995e-246 or 7.5e-159 < x Initial program 65.1%
Taylor expanded in F around -inf 73.3%
Taylor expanded in x around inf 78.8%
mul-1-neg78.8%
associate-/l*78.8%
distribute-lft-neg-in78.8%
Simplified78.8%
distribute-lft-neg-out78.8%
clear-num78.7%
tan-quot78.8%
div-inv78.9%
neg-sub078.9%
Applied egg-rr78.9%
neg-sub078.9%
distribute-frac-neg278.9%
Simplified78.9%
if -2.09999999999999995e-246 < x < 7.5e-159Initial program 67.3%
Simplified72.2%
Taylor expanded in x around 0 72.2%
associate-*l/72.2%
*-lft-identity72.2%
+-commutative72.2%
unpow272.2%
fma-undefine72.2%
Simplified72.2%
Taylor expanded in F around inf 47.3%
Taylor expanded in x around 0 47.3%
Final simplification71.8%
(FPCore (F B x) :precision binary64 (if (<= B 2.65e+17) (/ (- 1.0 x) B) (/ 1.0 (sin B))))
double code(double F, double B, double x) {
double tmp;
if (B <= 2.65e+17) {
tmp = (1.0 - x) / B;
} else {
tmp = 1.0 / sin(B);
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (b <= 2.65d+17) then
tmp = (1.0d0 - x) / b
else
tmp = 1.0d0 / sin(b)
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (B <= 2.65e+17) {
tmp = (1.0 - x) / B;
} else {
tmp = 1.0 / Math.sin(B);
}
return tmp;
}
def code(F, B, x): tmp = 0 if B <= 2.65e+17: tmp = (1.0 - x) / B else: tmp = 1.0 / math.sin(B) return tmp
function code(F, B, x) tmp = 0.0 if (B <= 2.65e+17) tmp = Float64(Float64(1.0 - x) / B); else tmp = Float64(1.0 / sin(B)); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (B <= 2.65e+17) tmp = (1.0 - x) / B; else tmp = 1.0 / sin(B); end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[B, 2.65e+17], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision], N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;B \leq 2.65 \cdot 10^{+17}:\\
\;\;\;\;\frac{1 - x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B}\\
\end{array}
\end{array}
if B < 2.65e17Initial program 64.5%
Simplified75.8%
Taylor expanded in x around 0 89.8%
associate-*l/89.8%
*-lft-identity89.8%
+-commutative89.8%
unpow289.8%
fma-undefine89.8%
Simplified89.8%
Taylor expanded in F around inf 69.5%
Taylor expanded in B around 0 41.1%
if 2.65e17 < B Initial program 68.7%
Simplified68.8%
Taylor expanded in x around 0 82.7%
associate-*l/82.8%
*-lft-identity82.8%
+-commutative82.8%
unpow282.8%
fma-undefine82.8%
Simplified82.8%
Taylor expanded in F around inf 56.9%
Taylor expanded in x around 0 16.5%
Final simplification34.9%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (- B))))
(if (<= x -2.05e-213)
t_0
(if (<= x -3.7e-266) (/ -1.0 B) (if (<= x 9e-152) (/ (+ x 1.0) B) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (x <= -2.05e-213) {
tmp = t_0;
} else if (x <= -3.7e-266) {
tmp = -1.0 / B;
} else if (x <= 9e-152) {
tmp = (x + 1.0) / B;
} else {
tmp = 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 / -b
if (x <= (-2.05d-213)) then
tmp = t_0
else if (x <= (-3.7d-266)) then
tmp = (-1.0d0) / b
else if (x <= 9d-152) then
tmp = (x + 1.0d0) / b
else
tmp = t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / -B;
double tmp;
if (x <= -2.05e-213) {
tmp = t_0;
} else if (x <= -3.7e-266) {
tmp = -1.0 / B;
} else if (x <= 9e-152) {
tmp = (x + 1.0) / B;
} else {
tmp = t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / -B tmp = 0 if x <= -2.05e-213: tmp = t_0 elif x <= -3.7e-266: tmp = -1.0 / B elif x <= 9e-152: tmp = (x + 1.0) / B else: tmp = t_0 return tmp
function code(F, B, x) t_0 = Float64(x / Float64(-B)) tmp = 0.0 if (x <= -2.05e-213) tmp = t_0; elseif (x <= -3.7e-266) tmp = Float64(-1.0 / B); elseif (x <= 9e-152) tmp = Float64(Float64(x + 1.0) / B); else tmp = t_0; end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / -B; tmp = 0.0; if (x <= -2.05e-213) tmp = t_0; elseif (x <= -3.7e-266) tmp = -1.0 / B; elseif (x <= 9e-152) tmp = (x + 1.0) / B; else tmp = t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / (-B)), $MachinePrecision]}, If[LessEqual[x, -2.05e-213], t$95$0, If[LessEqual[x, -3.7e-266], N[(-1.0 / B), $MachinePrecision], If[LessEqual[x, 9e-152], N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{-B}\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{-213}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;x \leq -3.7 \cdot 10^{-266}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-152}:\\
\;\;\;\;\frac{x + 1}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if x < -2.04999999999999987e-213 or 9.0000000000000008e-152 < x Initial program 64.1%
Taylor expanded in F around -inf 76.3%
Taylor expanded in B around 0 35.8%
mul-1-neg35.8%
distribute-neg-frac235.8%
Simplified35.8%
Taylor expanded in x around inf 39.3%
mul-1-neg39.3%
distribute-neg-frac239.3%
Simplified39.3%
if -2.04999999999999987e-213 < x < -3.7000000000000003e-266Initial program 63.2%
Taylor expanded in F around -inf 39.7%
Taylor expanded in B around 0 26.9%
mul-1-neg26.9%
distribute-neg-frac226.9%
Simplified26.9%
Taylor expanded in x around 0 26.9%
if -3.7000000000000003e-266 < x < 9.0000000000000008e-152Initial program 71.5%
Taylor expanded in F around -inf 11.6%
Taylor expanded in B around 0 7.2%
mul-1-neg7.2%
distribute-neg-frac27.2%
Simplified7.2%
add-sqr-sqrt4.0%
sqrt-unprod13.4%
sqr-neg13.4%
sqrt-unprod16.5%
add-sqr-sqrt24.0%
*-un-lft-identity24.0%
Applied egg-rr24.0%
*-lft-identity24.0%
Simplified24.0%
Final simplification35.2%
(FPCore (F B x) :precision binary64 (if (<= F -3.1e-90) (/ (- -1.0 x) B) (if (<= F 3.2e-143) (/ x (- B)) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -3.1e-90) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.2e-143) {
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.1d-90)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 3.2d-143) 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.1e-90) {
tmp = (-1.0 - x) / B;
} else if (F <= 3.2e-143) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -3.1e-90: tmp = (-1.0 - x) / B elif F <= 3.2e-143: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -3.1e-90) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 3.2e-143) 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.1e-90) tmp = (-1.0 - x) / B; elseif (F <= 3.2e-143) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -3.1e-90], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 3.2e-143], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -3.1 \cdot 10^{-90}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 3.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -3.1000000000000001e-90Initial program 63.4%
Taylor expanded in F around -inf 92.8%
Taylor expanded in B around 0 39.6%
mul-1-neg39.6%
distribute-neg-frac239.6%
Simplified39.6%
if -3.1000000000000001e-90 < F < 3.1999999999999998e-143Initial program 77.6%
Taylor expanded in F around -inf 46.2%
Taylor expanded in B around 0 23.2%
mul-1-neg23.2%
distribute-neg-frac223.2%
Simplified23.2%
Taylor expanded in x around inf 35.2%
mul-1-neg35.2%
distribute-neg-frac235.2%
Simplified35.2%
if 3.1999999999999998e-143 < F Initial program 57.4%
Simplified70.0%
Taylor expanded in x around 0 80.8%
associate-*l/80.8%
*-lft-identity80.8%
+-commutative80.8%
unpow280.8%
fma-undefine80.8%
Simplified80.8%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 42.9%
Final simplification39.5%
(FPCore (F B x) :precision binary64 (if (<= F 2.2e-143) (/ x (- B)) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 2.2e-143) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 2.2d-143) then
tmp = x / -b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 2.2e-143) {
tmp = x / -B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 2.2e-143: tmp = x / -B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 2.2e-143) 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 <= 2.2e-143) tmp = x / -B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 2.2e-143], N[(x / (-B)), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 2.2 \cdot 10^{-143}:\\
\;\;\;\;\frac{x}{-B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 2.19999999999999989e-143Initial program 70.9%
Taylor expanded in F around -inf 68.1%
Taylor expanded in B around 0 30.9%
mul-1-neg30.9%
distribute-neg-frac230.9%
Simplified30.9%
Taylor expanded in x around inf 30.8%
mul-1-neg30.8%
distribute-neg-frac230.8%
Simplified30.8%
if 2.19999999999999989e-143 < F Initial program 57.4%
Simplified70.0%
Taylor expanded in x around 0 80.8%
associate-*l/80.8%
*-lft-identity80.8%
+-commutative80.8%
unpow280.8%
fma-undefine80.8%
Simplified80.8%
Taylor expanded in F around inf 86.9%
Taylor expanded in B around 0 42.9%
Final simplification35.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(x / Float64(-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 65.6%
Taylor expanded in F around -inf 60.1%
Taylor expanded in B around 0 29.3%
mul-1-neg29.3%
distribute-neg-frac229.3%
Simplified29.3%
Taylor expanded in x around inf 29.3%
mul-1-neg29.3%
distribute-neg-frac229.3%
Simplified29.3%
Final simplification29.3%
(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 65.6%
Taylor expanded in F around -inf 60.1%
Taylor expanded in B around 0 29.3%
mul-1-neg29.3%
distribute-neg-frac229.3%
Simplified29.3%
Taylor expanded in x around 0 7.1%
Final simplification7.1%
herbie shell --seed 2024068
(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))))))