
(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 -1e+121)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 6.1e-12)
(- (/ F (/ (sin B) (pow (fma F F 2.0) -0.5))) t_0)
(- (/ 1.0 (sin B)) t_0)))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -1e+121) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 6.1e-12) {
tmp = (F / (sin(B) / pow(fma(F, F, 2.0), -0.5))) - 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 <= -1e+121) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 6.1e-12) tmp = Float64(Float64(F / Float64(sin(B) / (fma(F, F, 2.0) ^ -0.5))) - 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, -1e+121], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.1e-12], N[(N[(F / N[(N[Sin[B], $MachinePrecision] / N[Power[N[(F * F + 2.0), $MachinePrecision], -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -1 \cdot 10^{+121}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 6.1 \cdot 10^{-12}:\\
\;\;\;\;\frac{F}{\frac{\sin B}{{\left(\mathsf{fma}\left(F, F, 2\right)\right)}^{-0.5}}} - t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -1.00000000000000004e121Initial program 40.5%
Simplified62.3%
Taylor expanded in x around 0 62.2%
associate-*l/62.3%
*-lft-identity62.3%
+-commutative62.3%
unpow262.3%
fma-undefine62.3%
Simplified62.3%
Taylor expanded in F around -inf 99.9%
if -1.00000000000000004e121 < F < 6.1000000000000003e-12Initial program 83.6%
Simplified84.5%
Taylor expanded in x around 0 99.5%
associate-*l/99.5%
*-lft-identity99.5%
+-commutative99.5%
unpow299.5%
fma-undefine99.5%
Simplified99.5%
clear-num99.6%
un-div-inv99.6%
inv-pow99.6%
sqrt-pow199.6%
metadata-eval99.6%
Applied egg-rr99.6%
if 6.1000000000000003e-12 < F Initial program 51.8%
Simplified64.3%
Taylor expanded in x around 0 72.4%
associate-*l/72.4%
*-lft-identity72.4%
+-commutative72.4%
unpow272.4%
fma-undefine72.4%
Simplified72.4%
Taylor expanded in F around inf 99.8%
Final simplification99.7%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2200000000000.0)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 6.1e-12)
(- (* 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 <= -2200000000000.0) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 6.1e-12) {
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 <= (-2200000000000.0d0)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 6.1d-12) 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 <= -2200000000000.0) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 6.1e-12) {
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 <= -2200000000000.0: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 6.1e-12: 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 <= -2200000000000.0) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 6.1e-12) 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 <= -2200000000000.0) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 6.1e-12) 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, -2200000000000.0], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 6.1e-12], 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 -2200000000000:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 6.1 \cdot 10^{-12}:\\
\;\;\;\;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.2e12Initial program 49.4%
Simplified67.8%
Taylor expanded in x around 0 70.7%
associate-*l/70.8%
*-lft-identity70.8%
+-commutative70.8%
unpow270.8%
fma-undefine70.8%
Simplified70.8%
Taylor expanded in F around -inf 99.9%
if -2.2e12 < F < 6.1000000000000003e-12Initial program 84.2%
Simplified84.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.3%
if 6.1000000000000003e-12 < F Initial program 51.8%
Simplified64.3%
Taylor expanded in x around 0 72.4%
associate-*l/72.4%
*-lft-identity72.4%
+-commutative72.4%
unpow272.4%
fma-undefine72.4%
Simplified72.4%
Taylor expanded in F around inf 99.8%
Final simplification99.6%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))) (t_1 (/ 1.0 (sin B))))
(if (<= F -3e-58)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.8e-68)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 1.1e-49)
(- (* (* F t_1) (sqrt (/ 1.0 (+ 2.0 (* x 2.0))))) (/ x B))
(- t_1 t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double t_1 = 1.0 / sin(B);
double tmp;
if (F <= -3e-58) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.8e-68) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 1.1e-49) {
tmp = ((F * t_1) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = t_1 - 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) :: t_1
real(8) :: tmp
t_0 = x / tan(b)
t_1 = 1.0d0 / sin(b)
if (f <= (-3d-58)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.8d-68) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 1.1d-49) then
tmp = ((f * t_1) * sqrt((1.0d0 / (2.0d0 + (x * 2.0d0))))) - (x / b)
else
tmp = t_1 - 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 t_1 = 1.0 / Math.sin(B);
double tmp;
if (F <= -3e-58) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.8e-68) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 1.1e-49) {
tmp = ((F * t_1) * Math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B);
} else {
tmp = t_1 - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) t_1 = 1.0 / math.sin(B) tmp = 0 if F <= -3e-58: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.8e-68: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 1.1e-49: tmp = ((F * t_1) * math.sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B) else: tmp = t_1 - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) t_1 = Float64(1.0 / sin(B)) tmp = 0.0 if (F <= -3e-58) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.8e-68) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 1.1e-49) tmp = Float64(Float64(Float64(F * t_1) * sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0))))) - Float64(x / B)); else tmp = Float64(t_1 - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); t_1 = 1.0 / sin(B); tmp = 0.0; if (F <= -3e-58) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.8e-68) tmp = (x * cos(B)) / -sin(B); elseif (F <= 1.1e-49) tmp = ((F * t_1) * sqrt((1.0 / (2.0 + (x * 2.0))))) - (x / B); else tmp = t_1 - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -3e-58], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.8e-68], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 1.1e-49], N[(N[(N[(F * t$95$1), $MachinePrecision] * N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
t_1 := \frac{1}{\sin B}\\
\mathbf{if}\;F \leq -3 \cdot 10^{-58}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.8 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 1.1 \cdot 10^{-49}:\\
\;\;\;\;\left(F \cdot t\_1\right) \cdot \sqrt{\frac{1}{2 + x \cdot 2}} - \frac{x}{B}\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\_0\\
\end{array}
\end{array}
if F < -3.00000000000000008e-58Initial program 52.7%
Simplified68.9%
Taylor expanded in x around 0 74.1%
associate-*l/74.2%
*-lft-identity74.2%
+-commutative74.2%
unpow274.2%
fma-undefine74.2%
Simplified74.2%
Taylor expanded in F around -inf 95.0%
if -3.00000000000000008e-58 < F < 2.8000000000000001e-68Initial program 85.1%
Taylor expanded in F around -inf 44.5%
Taylor expanded in x around inf 85.5%
if 2.8000000000000001e-68 < F < 1.09999999999999995e-49Initial program 99.0%
Taylor expanded in F around 0 99.0%
Taylor expanded in B around 0 99.0%
div-inv99.5%
Applied egg-rr99.5%
if 1.09999999999999995e-49 < F Initial program 52.3%
Simplified64.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.1%
*-lft-identity74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in F around inf 97.4%
Final simplification92.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -5.6e-54)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 3.45e-68)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 5.4e-51)
(* (sqrt (/ 1.0 (+ 2.0 (* x 2.0)))) (/ F (sin B)))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -5.6e-54) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 3.45e-68) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 5.4e-51) {
tmp = sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / sin(B));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-5.6d-54)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 3.45d-68) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 5.4d-51) then
tmp = sqrt((1.0d0 / (2.0d0 + (x * 2.0d0)))) * (f / sin(b))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -5.6e-54) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 3.45e-68) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 5.4e-51) {
tmp = Math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / Math.sin(B));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -5.6e-54: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 3.45e-68: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 5.4e-51: tmp = math.sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / math.sin(B)) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -5.6e-54) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 3.45e-68) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 5.4e-51) tmp = Float64(sqrt(Float64(1.0 / Float64(2.0 + Float64(x * 2.0)))) * Float64(F / sin(B))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -5.6e-54) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 3.45e-68) tmp = (x * cos(B)) / -sin(B); elseif (F <= 5.4e-51) tmp = sqrt((1.0 / (2.0 + (x * 2.0)))) * (F / sin(B)); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -5.6e-54], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 3.45e-68], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5.4e-51], N[(N[Sqrt[N[(1.0 / N[(2.0 + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(F / 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 -5.6 \cdot 10^{-54}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 3.45 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 5.4 \cdot 10^{-51}:\\
\;\;\;\;\sqrt{\frac{1}{2 + x \cdot 2}} \cdot \frac{F}{\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -5.6000000000000004e-54Initial program 52.7%
Simplified68.9%
Taylor expanded in x around 0 74.1%
associate-*l/74.2%
*-lft-identity74.2%
+-commutative74.2%
unpow274.2%
fma-undefine74.2%
Simplified74.2%
Taylor expanded in F around -inf 95.0%
if -5.6000000000000004e-54 < F < 3.45000000000000016e-68Initial program 85.1%
Taylor expanded in F around -inf 44.5%
Taylor expanded in x around inf 85.5%
if 3.45000000000000016e-68 < F < 5.3999999999999994e-51Initial program 99.0%
Taylor expanded in F around 0 99.0%
Taylor expanded in F around inf 99.0%
if 5.3999999999999994e-51 < F Initial program 52.3%
Simplified64.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.1%
*-lft-identity74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in F around inf 97.4%
Final simplification92.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.3e-53)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 2.75e-68)
(/ (* x (cos B)) (- (sin B)))
(if (<= F 5e-50)
(* F (- (/ (sqrt 0.5) (sin B)) (/ x (* F B))))
(- (/ 1.0 (sin B)) t_0))))))
double code(double F, double B, double x) {
double t_0 = x / tan(B);
double tmp;
if (F <= -2.3e-53) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 2.75e-68) {
tmp = (x * cos(B)) / -sin(B);
} else if (F <= 5e-50) {
tmp = F * ((sqrt(0.5) / sin(B)) - (x / (F * B)));
} else {
tmp = (1.0 / sin(B)) - t_0;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = x / tan(b)
if (f <= (-2.3d-53)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 2.75d-68) then
tmp = (x * cos(b)) / -sin(b)
else if (f <= 5d-50) then
tmp = f * ((sqrt(0.5d0) / sin(b)) - (x / (f * b)))
else
tmp = (1.0d0 / sin(b)) - t_0
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = x / Math.tan(B);
double tmp;
if (F <= -2.3e-53) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 2.75e-68) {
tmp = (x * Math.cos(B)) / -Math.sin(B);
} else if (F <= 5e-50) {
tmp = F * ((Math.sqrt(0.5) / Math.sin(B)) - (x / (F * B)));
} else {
tmp = (1.0 / Math.sin(B)) - t_0;
}
return tmp;
}
def code(F, B, x): t_0 = x / math.tan(B) tmp = 0 if F <= -2.3e-53: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 2.75e-68: tmp = (x * math.cos(B)) / -math.sin(B) elif F <= 5e-50: tmp = F * ((math.sqrt(0.5) / math.sin(B)) - (x / (F * B))) else: tmp = (1.0 / math.sin(B)) - t_0 return tmp
function code(F, B, x) t_0 = Float64(x / tan(B)) tmp = 0.0 if (F <= -2.3e-53) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 2.75e-68) tmp = Float64(Float64(x * cos(B)) / Float64(-sin(B))); elseif (F <= 5e-50) tmp = Float64(F * Float64(Float64(sqrt(0.5) / sin(B)) - Float64(x / Float64(F * B)))); else tmp = Float64(Float64(1.0 / sin(B)) - t_0); end return tmp end
function tmp_2 = code(F, B, x) t_0 = x / tan(B); tmp = 0.0; if (F <= -2.3e-53) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 2.75e-68) tmp = (x * cos(B)) / -sin(B); elseif (F <= 5e-50) tmp = F * ((sqrt(0.5) / sin(B)) - (x / (F * B))); else tmp = (1.0 / sin(B)) - t_0; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[F, -2.3e-53], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 2.75e-68], N[(N[(x * N[Cos[B], $MachinePrecision]), $MachinePrecision] / (-N[Sin[B], $MachinePrecision])), $MachinePrecision], If[LessEqual[F, 5e-50], N[(F * N[(N[(N[Sqrt[0.5], $MachinePrecision] / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[(F * B), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{x}{\tan B}\\
\mathbf{if}\;F \leq -2.3 \cdot 10^{-53}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 2.75 \cdot 10^{-68}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{elif}\;F \leq 5 \cdot 10^{-50}:\\
\;\;\;\;F \cdot \left(\frac{\sqrt{0.5}}{\sin B} - \frac{x}{F \cdot B}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.3000000000000001e-53Initial program 52.7%
Simplified68.9%
Taylor expanded in x around 0 74.1%
associate-*l/74.2%
*-lft-identity74.2%
+-commutative74.2%
unpow274.2%
fma-undefine74.2%
Simplified74.2%
Taylor expanded in F around -inf 95.0%
if -2.3000000000000001e-53 < F < 2.7500000000000001e-68Initial program 85.1%
Taylor expanded in F around -inf 44.5%
Taylor expanded in x around inf 85.5%
if 2.7500000000000001e-68 < F < 4.99999999999999968e-50Initial program 99.0%
Taylor expanded in F around 0 99.0%
Taylor expanded in B around 0 99.0%
Taylor expanded in F around inf 99.5%
Taylor expanded in x around 0 99.2%
if 4.99999999999999968e-50 < F Initial program 52.3%
Simplified64.0%
Taylor expanded in x around 0 74.1%
associate-*l/74.1%
*-lft-identity74.1%
+-commutative74.1%
unpow274.1%
fma-undefine74.1%
Simplified74.1%
Taylor expanded in F around inf 97.4%
Final simplification92.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ x (tan B))))
(if (<= F -2.2e-53)
(- (/ -1.0 (sin B)) t_0)
(if (<= F 7.2e-15)
(/ (* 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.2e-53) {
tmp = (-1.0 / sin(B)) - t_0;
} else if (F <= 7.2e-15) {
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.2d-53)) then
tmp = ((-1.0d0) / sin(b)) - t_0
else if (f <= 7.2d-15) 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.2e-53) {
tmp = (-1.0 / Math.sin(B)) - t_0;
} else if (F <= 7.2e-15) {
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.2e-53: tmp = (-1.0 / math.sin(B)) - t_0 elif F <= 7.2e-15: 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.2e-53) tmp = Float64(Float64(-1.0 / sin(B)) - t_0); elseif (F <= 7.2e-15) 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 <= -2.2e-53) tmp = (-1.0 / sin(B)) - t_0; elseif (F <= 7.2e-15) 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.2e-53], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[F, 7.2e-15], 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 -2.2 \cdot 10^{-53}:\\
\;\;\;\;\frac{-1}{\sin B} - t\_0\\
\mathbf{elif}\;F \leq 7.2 \cdot 10^{-15}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\sin B} - t\_0\\
\end{array}
\end{array}
if F < -2.20000000000000018e-53Initial program 52.7%
Simplified68.9%
Taylor expanded in x around 0 74.1%
associate-*l/74.2%
*-lft-identity74.2%
+-commutative74.2%
unpow274.2%
fma-undefine74.2%
Simplified74.2%
Taylor expanded in F around -inf 95.0%
if -2.20000000000000018e-53 < F < 7.2000000000000002e-15Initial program 84.6%
Taylor expanded in F around -inf 43.3%
Taylor expanded in x around inf 81.1%
if 7.2000000000000002e-15 < F Initial program 52.5%
Simplified64.8%
Taylor expanded in x around 0 72.8%
associate-*l/72.8%
*-lft-identity72.8%
+-commutative72.8%
unpow272.8%
fma-undefine72.8%
Simplified72.8%
Taylor expanded in F around inf 98.6%
Final simplification90.2%
(FPCore (F B x) :precision binary64 (if (<= F -6.5e+71) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 6.2e+61) (/ (* x (cos B)) (- (sin B))) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e+71) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 6.2e+61) {
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 <= (-6.5d+71)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 6.2d+61) 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 <= -6.5e+71) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 6.2e+61) {
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 <= -6.5e+71: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 6.2e+61: 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 <= -6.5e+71) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 6.2e+61) 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 <= -6.5e+71) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 6.2e+61) tmp = (x * cos(B)) / -sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.5e+71], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 6.2e+61], 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 -6.5 \cdot 10^{+71}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{+61}:\\
\;\;\;\;\frac{x \cdot \cos B}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.49999999999999954e71Initial program 45.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.1%
if -6.49999999999999954e71 < F < 6.1999999999999998e61Initial program 83.3%
Taylor expanded in F around -inf 48.6%
Taylor expanded in x around inf 75.7%
if 6.1999999999999998e61 < F Initial program 43.5%
Simplified60.0%
Taylor expanded in x around 0 63.6%
associate-*l/63.6%
*-lft-identity63.6%
+-commutative63.6%
unpow263.6%
fma-undefine63.6%
Simplified63.6%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 57.7%
Final simplification72.4%
(FPCore (F B x) :precision binary64 (if (<= F -2.3e-53) (- (/ -1.0 (sin B)) (/ x (tan B))) (if (<= F 5.7e+57) (/ x (- (tan B))) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-53) {
tmp = (-1.0 / sin(B)) - (x / tan(B));
} else if (F <= 5.7e+57) {
tmp = x / -tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-2.3d-53)) then
tmp = ((-1.0d0) / sin(b)) - (x / tan(b))
else if (f <= 5.7d+57) then
tmp = x / -tan(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -2.3e-53) {
tmp = (-1.0 / Math.sin(B)) - (x / Math.tan(B));
} else if (F <= 5.7e+57) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -2.3e-53: tmp = (-1.0 / math.sin(B)) - (x / math.tan(B)) elif F <= 5.7e+57: tmp = x / -math.tan(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -2.3e-53) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / tan(B))); elseif (F <= 5.7e+57) tmp = Float64(x / Float64(-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 <= -2.3e-53) tmp = (-1.0 / sin(B)) - (x / tan(B)); elseif (F <= 5.7e+57) tmp = x / -tan(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -2.3e-53], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / N[Tan[B], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 5.7e+57], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -2.3 \cdot 10^{-53}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{\tan B}\\
\mathbf{elif}\;F \leq 5.7 \cdot 10^{+57}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -2.3000000000000001e-53Initial program 52.7%
Simplified68.9%
Taylor expanded in x around 0 74.1%
associate-*l/74.2%
*-lft-identity74.2%
+-commutative74.2%
unpow274.2%
fma-undefine74.2%
Simplified74.2%
Taylor expanded in F around -inf 95.0%
if -2.3000000000000001e-53 < F < 5.6999999999999998e57Initial program 83.6%
Taylor expanded in F around -inf 45.0%
Taylor expanded in x around inf 77.3%
*-un-lft-identity77.3%
clear-num77.1%
*-un-lft-identity77.1%
times-frac77.1%
tan-quot77.0%
Applied egg-rr77.0%
*-lft-identity77.0%
associate-/r*77.1%
remove-double-div77.3%
Simplified77.3%
if 5.6999999999999998e57 < F Initial program 43.5%
Simplified60.0%
Taylor expanded in x around 0 63.6%
associate-*l/63.6%
*-lft-identity63.6%
+-commutative63.6%
unpow263.6%
fma-undefine63.6%
Simplified63.6%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 57.7%
Final simplification78.3%
(FPCore (F B x) :precision binary64 (if (<= F -5e+116) (/ (- -1.0 x) B) (if (<= F 4.6e-14) (/ x (- (sin B))) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -5e+116) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.6e-14) {
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 <= (-5d+116)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 4.6d-14) 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 <= -5e+116) {
tmp = (-1.0 - x) / B;
} else if (F <= 4.6e-14) {
tmp = x / -Math.sin(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -5e+116: tmp = (-1.0 - x) / B elif F <= 4.6e-14: tmp = x / -math.sin(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -5e+116) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 4.6e-14) tmp = Float64(x / 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 <= -5e+116) tmp = (-1.0 - x) / B; elseif (F <= 4.6e-14) tmp = x / -sin(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -5e+116], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 4.6e-14], 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 \cdot 10^{+116}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 4.6 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{-\sin B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -5.00000000000000025e116Initial program 40.5%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 53.4%
mul-1-neg53.4%
distribute-neg-frac253.4%
Simplified53.4%
if -5.00000000000000025e116 < F < 4.59999999999999996e-14Initial program 83.5%
Taylor expanded in F around -inf 50.9%
Taylor expanded in x around inf 77.9%
Taylor expanded in B around 0 37.7%
if 4.59999999999999996e-14 < F Initial program 52.5%
Simplified64.8%
Taylor expanded in x around 0 72.8%
associate-*l/72.8%
*-lft-identity72.8%
+-commutative72.8%
unpow272.8%
fma-undefine72.8%
Simplified72.8%
Taylor expanded in F around inf 98.6%
Taylor expanded in B around 0 51.0%
Final simplification44.7%
(FPCore (F B x) :precision binary64 (if (<= F -6.5e+71) (- (/ -1.0 (sin B)) (/ x B)) (if (<= F 4.2e+62) (/ x (- (tan B))) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e+71) {
tmp = (-1.0 / sin(B)) - (x / B);
} else if (F <= 4.2e+62) {
tmp = x / -tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-6.5d+71)) then
tmp = ((-1.0d0) / sin(b)) - (x / b)
else if (f <= 4.2d+62) then
tmp = x / -tan(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -6.5e+71) {
tmp = (-1.0 / Math.sin(B)) - (x / B);
} else if (F <= 4.2e+62) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -6.5e+71: tmp = (-1.0 / math.sin(B)) - (x / B) elif F <= 4.2e+62: tmp = x / -math.tan(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -6.5e+71) tmp = Float64(Float64(-1.0 / sin(B)) - Float64(x / B)); elseif (F <= 4.2e+62) tmp = Float64(x / Float64(-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 <= -6.5e+71) tmp = (-1.0 / sin(B)) - (x / B); elseif (F <= 4.2e+62) tmp = x / -tan(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -6.5e+71], N[(N[(-1.0 / N[Sin[B], $MachinePrecision]), $MachinePrecision] - N[(x / B), $MachinePrecision]), $MachinePrecision], If[LessEqual[F, 4.2e+62], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -6.5 \cdot 10^{+71}:\\
\;\;\;\;\frac{-1}{\sin B} - \frac{x}{B}\\
\mathbf{elif}\;F \leq 4.2 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -6.49999999999999954e71Initial program 45.1%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 78.1%
if -6.49999999999999954e71 < F < 4.2e62Initial program 83.3%
Taylor expanded in F around -inf 48.6%
Taylor expanded in x around inf 75.7%
*-un-lft-identity75.7%
clear-num75.5%
*-un-lft-identity75.5%
times-frac75.5%
tan-quot75.5%
Applied egg-rr75.5%
*-lft-identity75.5%
associate-/r*75.6%
remove-double-div75.7%
Simplified75.7%
if 4.2e62 < F Initial program 43.5%
Simplified60.0%
Taylor expanded in x around 0 63.6%
associate-*l/63.6%
*-lft-identity63.6%
+-commutative63.6%
unpow263.6%
fma-undefine63.6%
Simplified63.6%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 57.7%
Final simplification72.4%
(FPCore (F B x) :precision binary64 (if (<= F 4.6e+57) (/ x (- (tan B))) (/ (- 1.0 x) B)))
double code(double F, double B, double x) {
double tmp;
if (F <= 4.6e+57) {
tmp = x / -tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= 4.6d+57) then
tmp = x / -tan(b)
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= 4.6e+57) {
tmp = x / -Math.tan(B);
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= 4.6e+57: tmp = x / -math.tan(B) else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= 4.6e+57) tmp = Float64(x / Float64(-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 <= 4.6e+57) tmp = x / -tan(B); else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, 4.6e+57], N[(x / (-N[Tan[B], $MachinePrecision])), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq 4.6 \cdot 10^{+57}:\\
\;\;\;\;\frac{x}{-\tan B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < 4.5999999999999998e57Initial program 72.1%
Taylor expanded in F around -inf 63.6%
Taylor expanded in x around inf 68.5%
*-un-lft-identity68.5%
clear-num68.3%
*-un-lft-identity68.3%
times-frac68.3%
tan-quot68.3%
Applied egg-rr68.3%
*-lft-identity68.3%
associate-/r*68.4%
remove-double-div68.5%
Simplified68.5%
if 4.5999999999999998e57 < F Initial program 43.5%
Simplified60.0%
Taylor expanded in x around 0 63.6%
associate-*l/63.6%
*-lft-identity63.6%
+-commutative63.6%
unpow263.6%
fma-undefine63.6%
Simplified63.6%
Taylor expanded in F around inf 99.8%
Taylor expanded in B around 0 57.7%
Final simplification66.2%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) B)))
(if (<= F -2.2e+184)
t_0
(if (<= F -5e+116) (/ -1.0 B) (if (<= F 6.7e+16) t_0 (/ (+ x 1.0) B))))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (F <= -2.2e+184) {
tmp = t_0;
} else if (F <= -5e+116) {
tmp = -1.0 / B;
} else if (F <= 6.7e+16) {
tmp = t_0;
} else {
tmp = (x + 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) :: t_0
real(8) :: tmp
t_0 = -x / b
if (f <= (-2.2d+184)) then
tmp = t_0
else if (f <= (-5d+116)) then
tmp = (-1.0d0) / b
else if (f <= 6.7d+16) then
tmp = t_0
else
tmp = (x + 1.0d0) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (F <= -2.2e+184) {
tmp = t_0;
} else if (F <= -5e+116) {
tmp = -1.0 / B;
} else if (F <= 6.7e+16) {
tmp = t_0;
} else {
tmp = (x + 1.0) / B;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if F <= -2.2e+184: tmp = t_0 elif F <= -5e+116: tmp = -1.0 / B elif F <= 6.7e+16: tmp = t_0 else: tmp = (x + 1.0) / B return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (F <= -2.2e+184) tmp = t_0; elseif (F <= -5e+116) tmp = Float64(-1.0 / B); elseif (F <= 6.7e+16) tmp = t_0; else tmp = Float64(Float64(x + 1.0) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / B; tmp = 0.0; if (F <= -2.2e+184) tmp = t_0; elseif (F <= -5e+116) tmp = -1.0 / B; elseif (F <= 6.7e+16) tmp = t_0; else tmp = (x + 1.0) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[F, -2.2e+184], t$95$0, If[LessEqual[F, -5e+116], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 6.7e+16], t$95$0, N[(N[(x + 1.0), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;F \leq -2.2 \cdot 10^{+184}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -5 \cdot 10^{+116}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 6.7 \cdot 10^{+16}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{x + 1}{B}\\
\end{array}
\end{array}
if F < -2.2e184 or -5.00000000000000025e116 < F < 6.7e16Initial program 73.5%
Taylor expanded in F around -inf 60.4%
Taylor expanded in B around 0 25.1%
mul-1-neg25.1%
distribute-neg-frac225.1%
Simplified25.1%
Taylor expanded in x around inf 33.6%
mul-1-neg33.6%
distribute-neg-frac233.6%
Simplified33.6%
if -2.2e184 < F < -5.00000000000000025e116Initial program 53.9%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 64.3%
mul-1-neg64.3%
distribute-neg-frac264.3%
Simplified64.3%
Taylor expanded in x around 0 54.0%
if 6.7e16 < F Initial program 49.8%
Taylor expanded in F around -inf 37.9%
Taylor expanded in B around 0 18.6%
mul-1-neg18.6%
distribute-neg-frac218.6%
Simplified18.6%
*-un-lft-identity18.6%
add-sqr-sqrt12.1%
sqrt-unprod21.4%
sqr-neg21.4%
sqrt-unprod20.3%
add-sqr-sqrt35.2%
*-un-lft-identity35.2%
times-frac35.2%
metadata-eval35.2%
Applied egg-rr35.2%
*-lft-identity35.2%
Simplified35.2%
Final simplification35.5%
(FPCore (F B x)
:precision binary64
(let* ((t_0 (/ (- x) B)))
(if (<= F -8.5e+183)
t_0
(if (<= F -5e+116) (/ -1.0 B) (if (<= F 1e-116) t_0 (/ (- 1.0 x) B))))))
double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (F <= -8.5e+183) {
tmp = t_0;
} else if (F <= -5e+116) {
tmp = -1.0 / B;
} else if (F <= 1e-116) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: t_0
real(8) :: tmp
t_0 = -x / b
if (f <= (-8.5d+183)) then
tmp = t_0
else if (f <= (-5d+116)) then
tmp = (-1.0d0) / b
else if (f <= 1d-116) then
tmp = t_0
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double t_0 = -x / B;
double tmp;
if (F <= -8.5e+183) {
tmp = t_0;
} else if (F <= -5e+116) {
tmp = -1.0 / B;
} else if (F <= 1e-116) {
tmp = t_0;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): t_0 = -x / B tmp = 0 if F <= -8.5e+183: tmp = t_0 elif F <= -5e+116: tmp = -1.0 / B elif F <= 1e-116: tmp = t_0 else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) t_0 = Float64(Float64(-x) / B) tmp = 0.0 if (F <= -8.5e+183) tmp = t_0; elseif (F <= -5e+116) tmp = Float64(-1.0 / B); elseif (F <= 1e-116) tmp = t_0; else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) t_0 = -x / B; tmp = 0.0; if (F <= -8.5e+183) tmp = t_0; elseif (F <= -5e+116) tmp = -1.0 / B; elseif (F <= 1e-116) tmp = t_0; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := Block[{t$95$0 = N[((-x) / B), $MachinePrecision]}, If[LessEqual[F, -8.5e+183], t$95$0, If[LessEqual[F, -5e+116], N[(-1.0 / B), $MachinePrecision], If[LessEqual[F, 1e-116], t$95$0, N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{-x}{B}\\
\mathbf{if}\;F \leq -8.5 \cdot 10^{+183}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;F \leq -5 \cdot 10^{+116}:\\
\;\;\;\;\frac{-1}{B}\\
\mathbf{elif}\;F \leq 10^{-116}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -8.5000000000000004e183 or -5.00000000000000025e116 < F < 9.9999999999999999e-117Initial program 73.4%
Taylor expanded in F around -inf 61.5%
Taylor expanded in B around 0 25.8%
mul-1-neg25.8%
distribute-neg-frac225.8%
Simplified25.8%
Taylor expanded in x around inf 35.7%
mul-1-neg35.7%
distribute-neg-frac235.7%
Simplified35.7%
if -8.5000000000000004e183 < F < -5.00000000000000025e116Initial program 53.9%
Taylor expanded in F around -inf 99.8%
Taylor expanded in B around 0 64.3%
mul-1-neg64.3%
distribute-neg-frac264.3%
Simplified64.3%
Taylor expanded in x around 0 54.0%
if 9.9999999999999999e-117 < F Initial program 56.4%
Simplified66.5%
Taylor expanded in x around 0 77.5%
associate-*l/77.5%
*-lft-identity77.5%
+-commutative77.5%
unpow277.5%
fma-undefine77.5%
Simplified77.5%
Taylor expanded in F around inf 90.5%
Taylor expanded in B around 0 44.1%
Final simplification40.0%
(FPCore (F B x) :precision binary64 (if (<= F -1.32e-53) (/ (- -1.0 x) B) (if (<= F 6.2e-117) (/ (- x) B) (/ (- 1.0 x) B))))
double code(double F, double B, double x) {
double tmp;
if (F <= -1.32e-53) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.2e-117) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
real(8) :: tmp
if (f <= (-1.32d-53)) then
tmp = ((-1.0d0) - x) / b
else if (f <= 6.2d-117) then
tmp = -x / b
else
tmp = (1.0d0 - x) / b
end if
code = tmp
end function
public static double code(double F, double B, double x) {
double tmp;
if (F <= -1.32e-53) {
tmp = (-1.0 - x) / B;
} else if (F <= 6.2e-117) {
tmp = -x / B;
} else {
tmp = (1.0 - x) / B;
}
return tmp;
}
def code(F, B, x): tmp = 0 if F <= -1.32e-53: tmp = (-1.0 - x) / B elif F <= 6.2e-117: tmp = -x / B else: tmp = (1.0 - x) / B return tmp
function code(F, B, x) tmp = 0.0 if (F <= -1.32e-53) tmp = Float64(Float64(-1.0 - x) / B); elseif (F <= 6.2e-117) tmp = Float64(Float64(-x) / B); else tmp = Float64(Float64(1.0 - x) / B); end return tmp end
function tmp_2 = code(F, B, x) tmp = 0.0; if (F <= -1.32e-53) tmp = (-1.0 - x) / B; elseif (F <= 6.2e-117) tmp = -x / B; else tmp = (1.0 - x) / B; end tmp_2 = tmp; end
code[F_, B_, x_] := If[LessEqual[F, -1.32e-53], N[(N[(-1.0 - x), $MachinePrecision] / B), $MachinePrecision], If[LessEqual[F, 6.2e-117], N[((-x) / B), $MachinePrecision], N[(N[(1.0 - x), $MachinePrecision] / B), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;F \leq -1.32 \cdot 10^{-53}:\\
\;\;\;\;\frac{-1 - x}{B}\\
\mathbf{elif}\;F \leq 6.2 \cdot 10^{-117}:\\
\;\;\;\;\frac{-x}{B}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - x}{B}\\
\end{array}
\end{array}
if F < -1.31999999999999997e-53Initial program 52.7%
Taylor expanded in F around -inf 94.9%
Taylor expanded in B around 0 46.5%
mul-1-neg46.5%
distribute-neg-frac246.5%
Simplified46.5%
if -1.31999999999999997e-53 < F < 6.20000000000000022e-117Initial program 86.4%
Taylor expanded in F around -inf 41.9%
Taylor expanded in B around 0 16.8%
mul-1-neg16.8%
distribute-neg-frac216.8%
Simplified16.8%
Taylor expanded in x around inf 37.6%
mul-1-neg37.6%
distribute-neg-frac237.6%
Simplified37.6%
if 6.20000000000000022e-117 < F Initial program 56.4%
Simplified66.5%
Taylor expanded in x around 0 77.5%
associate-*l/77.5%
*-lft-identity77.5%
+-commutative77.5%
unpow277.5%
fma-undefine77.5%
Simplified77.5%
Taylor expanded in F around inf 90.5%
Taylor expanded in B around 0 44.1%
Final simplification42.5%
(FPCore (F B x) :precision binary64 (/ (- x) B))
double code(double F, double B, double x) {
return -x / B;
}
real(8) function code(f, b, x)
real(8), intent (in) :: f
real(8), intent (in) :: b
real(8), intent (in) :: x
code = -x / b
end function
public static double code(double F, double B, double x) {
return -x / B;
}
def code(F, B, x): return -x / B
function code(F, B, x) return Float64(Float64(-x) / B) end
function tmp = code(F, B, x) tmp = -x / B; end
code[F_, B_, x_] := N[((-x) / B), $MachinePrecision]
\begin{array}{l}
\\
\frac{-x}{B}
\end{array}
Initial program 66.0%
Taylor expanded in F around -inf 57.5%
Taylor expanded in B around 0 26.3%
mul-1-neg26.3%
distribute-neg-frac226.3%
Simplified26.3%
Taylor expanded in x around inf 28.4%
mul-1-neg28.4%
distribute-neg-frac228.4%
Simplified28.4%
Final simplification28.4%
(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 66.0%
Taylor expanded in F around -inf 57.5%
Taylor expanded in B around 0 26.3%
mul-1-neg26.3%
distribute-neg-frac226.3%
Simplified26.3%
Taylor expanded in x around 0 8.7%
Final simplification8.7%
herbie shell --seed 2024066
(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))))))